Comments (28)
I installed TeamViewer, I'm desperate. Before I go ahead and let a helpful, trustworthy-looking random stranger into my computer, can you like make a .dmg file and put it on dropbox or something?
from gridfluidsim3d.
Got it:
cmake ../ -DOpenCL_INCLUDE_DIR:PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenCL.framework"
make -j12
from gridfluidsim3d.
Hey, I'm glad you're interested in the program. I do not have an OS X machine to build and test on so I'm not sure if the program will compile and run without errors. Let me know if you run into any errors and I will try my best to fix them.
To compile program you will need to install the GCC compiler and install GNU Make. This link gives instructions for how to install GCC and GNU Make on OS X.
The program uses the OpenCL library, so you will need make sure you have the library and header files on your machine. OS X may already have the files that you need, but I am not entirely sure.
You will also need to edit the Makefile and change the OPENCLINCLUDE and OPENCLLIB variables to point to where your OpenCL include directory is, and where your OpenCL library file is.
Let me know if you run into any problems, and I will try to help!
The program does not use OpenVDB. The particle meshing methods are all contained within the program.
from gridfluidsim3d.
I would gladly fire up a VM you can ssh or vnc into if you wanted to tweak it for OS X.
from gridfluidsim3d.
You people are amazing. You should try developing for blender.
from gridfluidsim3d.
Can't find OpenCL.framework in /libraries/frameworks any mac developers here to help?
from gridfluidsim3d.
Thank you very much for the offer, magnusviri. I may take you up on it if I need to.
I have acquired access to a Mac computer to test on over this coming weekend, so I'll try to work out how to get this program running on OS X as soon as I can.
from gridfluidsim3d.
How did it go? Any luck building it.
from gridfluidsim3d.
Hello rtolps,
I was able to build the program on OS X, but I am encountering an error ( _Assertion failed: (particleAdvector.initialize()) ) when trying to run the program, and I am currently working on resolving that error. Updates for the program to build on OS X are currently located in the osx_build branch.
Here is what I have done to get the program to build on OS X (El Capitan Version 10.11.4):
Install Xcode from the Apple App Store. Installing Xcode gave me access to GNU Make, the clang c++ compiler, and the OpenCL headers and libraries.
I found that my machine was missing the cl.hpp header, so you might need to download cl.hpp from khronos.org and place it in:
For Xcode < 4.3
/Developer/SDKs/MacOSX <Version>.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers
For Xcode >=4.3
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX <Version>.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers
You will probably need the cl.hpp file version that matches the version of OpenCL on your machine. I needed version 1.1.
Once I had done that, I was able to build the program using the command
make -f Makefile-OSX
And run with the command
./fluidsim
I'll keep you updated on my progress with getting this program to run on OS X.
Best Regards,
Ryan
from gridfluidsim3d.
Update: The program now builds and runs on the OS X machine that I am testing on. The updates to the program are now merged into the master branch.
Let me know if you run into any problems building/running the program.
Best Regards,
Ryan
from gridfluidsim3d.
What program/library or terminal extension do I need to run the makefile? Terminal doesn't recognise any of the commands.
from gridfluidsim3d.
The GNU Make program is used to run the makefile. The program was installed automatically when I installed Xcode. It looks like some users may have to enable the download within Xcode.
from gridfluidsim3d.
when you say run with the command do you mean in the same line? (make command should work, I realized what I did wrong. I was lazy and double clicked, maybe you should make a "build/run this program" batch file for noobs who want to build it without opening terminal?).
from gridfluidsim3d.
I'm afraid if I type it in wrong I'll screw up.
from gridfluidsim3d.
Hello rtolps,
When I said run with ./fluidsim, I meant to execute that command after the make -f Makefile-OSX command finishes running. The make command invokes the GNU Make program and tells it to run the script located in the the Makefile-OSX file. Once the make command finished running, it will create the executable simulation file fluidsim. The command ./fluidsim simply just executes that file.
If you want, you can create a shell script named something like "runandbuild.sh", place it in the fluid simulation directory, and copy these lines into the file:
#!/bin/bash
make -f Makefile-OSX
./fluidsim
The first line tells your system to use the bash program, which is what your terminal runs, to execute the commands in the script. Make sure that the file has permission to execute and it should run when you double click it.
If you want to become more familiar with using the command line interface, you may read the articles listed under "The Command Line" in Apple's guide on using the terminal.
The simulation program has no graphic user interface, and all information/errors during the simulation run time is output through the terminal.
I hope this information helps!
Greatest Regards,
Ryan
from gridfluidsim3d.
I got this error
src/clscalarfield.h:28:14: fatal error: 'OpenCL/cl.hpp' file not found #include <OpenCL/cl.hpp>
I downloaded and installed the header file into the Xcode library folder. what's going on?
from gridfluidsim3d.
Wait does the cl.hpp need to be in the src folder with all the other header files??
from gridfluidsim3d.
I checked within MacOSX .sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers the cl.hpp file is there
from gridfluidsim3d.
But there is two files, cl.h and cl.hpp
from gridfluidsim3d.
The cl.hpp file should not go in the src/ folder. The cl.hpp file should be in the same folder as the cl.h file, so it sounds like it is in the right place. The problem seems to be that the compiler is not searching the OpenCL header directory.
Sorry, I'm not able to test anything right now, so I'm not able to give a solution to this error at the moment. What OS X version and Xcode version are you running?
You could try modifying the Makefile-OSX file to explicityly specify which directory to search for headers by replacing this line (line 4):
CXXFLAGS=$(OPTIMIZE) -std=c++11 -Wall
with this line:
CXXFLAGS=$(OPTIMIZE) -I"PATH_TO_HEADER_DIRECTORY" -std=c++11 -Wall
where PATH_TO_HEADER_DIRECTORY is the directory that contains the cl.hpp and cl.h files.
example:
CXXFLAGS=$(OPTIMIZE) -I"/Developer/SDKs/MacOSX <Version>.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers" -std=c++11 -Wall
from gridfluidsim3d.
Still not working even though I held its hand. At this point I am willing to give you remote access to my computer so you can fix this unless I made a simple mistake with a quick fix. Have you tried testing it on a brand new macbook pro retina 2015? (possibly do it in the apple store when no one is looking or something).
`Last login: Tue May 10 16:40:42 on ttys001
Roberts-MBP:~ rstolppi$ cd ~/Downloads/GridFluidSim3D-osx_build
Roberts-MBP:GridFluidSim3D-osx_build rstolppi$ make -f Makefile-OSX
c++ -O3 -I"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers" -std=c++11 -Wall -c -o src/aabb.o src/aabb.cpp
c++ -O3 -I"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers" -std=c++11 -Wall -c -o src/anisotropicparticlemesher.o src/anisotropicparticlemesher.cpp
c++ -O3 -I"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers" -std=c++11 -Wall -c -o src/clscalarfield.o src/clscalarfield.cpp
In file included from src/clscalarfield.cpp:24:
src/clscalarfield.h:28:14: fatal error: 'OpenCL/cl.hpp' file not found
#include <OpenCL/cl.hpp>
^
1 error generated.
make: *** [src/clscalarfield.o] Error 1
Roberts-MBP:GridFluidSim3D-osx_build rstolppi$
`
from gridfluidsim3d.
Hello rtolps,
I am sorry that the program still will not build for you!
I am not very familiar with program distribution so I would not able to create a .dmg file to install this program. I am also not very familiar with the OS X operating system, so unfortunately I don't think I'd be able to solve this issue if I was given remote access to your machine.
There is one last thing you could try that comes to mind. Try replacing the same line as before with this line:
CXXFLAGS=$(OPTIMIZE) -F"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/" -std=c++11 -Wall
I believe that line will tell the compiler to search that specific framework directory in the case that it is not already looking there.
If you still get the same build error, I would suggest posting a question to Stack Overflow asking why the OpenCL/cl.hpp file cannot be found by the compiler.
Best Regards,
Ryan
from gridfluidsim3d.
IT WORKS OMG
from gridfluidsim3d.
Is there any chance you can make it so that I can export simulations from blender. Pls make like a python plugin or something for blender for easy import export. And change that code in the makefile to whatever you suggested to me because it worked like a charm. Now I got to figure out how to import the animation.
from gridfluidsim3d.
Another suggestion, I've mentioned Openvdb for particle meshing (it's much faster and has overall better results) but how about making the cache format the same as blender's "animated mesh" format for easier import through the El'Beem simulator. Even better, use alembic cache library for simulations (Blender will get support for it supposedly soon) in addition to the library for blender's animated mesh cache for fluids.
from gridfluidsim3d.
Hello rtolps,
I am very glad to hear that the program is building and running for you! I have updated the master branch with a FRAMEWORKSPATH variable that can be edited to add a directory to the compiler search path.
Thanks for the suggestions! I am currently not very experienced in using Blender, so I will have to look into these features and options in the future.
I will be closing this issue now that it has been solved.
Best Regards,
Ryan
from gridfluidsim3d.
Hello @rlguy
Do you have a way to make it work with the now cmake process on sierra ?
Thanks
from gridfluidsim3d.
Hello @melMass i've tried with the make file but can't get past a fatal error and it seems you've gotten installation to work a different way care to shed some insight on what exactly you did?
from gridfluidsim3d.
Related Issues (18)
- Addition of a build system generator HOT 3
- cannot import name FluidSimulation HOT 2
- Python mode? HOT 2
- Vector subscript out of range when running the basic example HOT 2
- unable to load library HOT 6
- The drop ball excample works not good HOT 2
- Using GridFluidSim3D to simulate liquid in a STL (mesh)
- How to improve the efficiency of simulation for fluid on surface? HOT 1
- issues with compilation HOT 2
- Building for windows! HOT 2
- OpenCL error -37 (CL_INVALID_HOST_PTR) HOT 9
- How can i define a scene? HOT 3
- Is it possible to generate particle map instead of meshes? HOT 6
- Compilation error HOT 1
- error: '_hypot' was not declared in this scope {return (float)(_hypot));} HOT 2
- error: CL/cl.hpp: No such file or directory #include <CL/cl.hpp> HOT 6
- Catch exceptions in main()? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridfluidsim3d.