-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems building on OSX #26
Comments
This makefile works for OSX, assuming you have installed Xcode. Ellen RM := rm -rf OSX_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk All of the sources participating in the build are defined hereSOURCES = src/PyramidalSimulation.cpp SRCEXT := cpp CPP_DEPS = $(OBJECTS:.o=.d) LIBS := -framework Python -framework OpenGL -framework GLUT -framework OpenCL All Targetall: Smoothed-Particle-Hydrodynamics Tool invocationsSmoothed-Particle-Hydrodynamics: $(OBJECTS)
use this to compile against homebrew installed pythonchange version number as necessary (2.7.n)/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Headers/
Other Targetsclean: .PHONY: all clean dependents On Apr 20, 2014, at 11:32 AM, Stephen Larson [email protected] wrote:
|
Many thanks to @emcgowen for providing a more OSX orthodox way of referencing the Frameworks (aka libraries). If I can get a spare moment I want to update the OSX makefile to build on the example posted above. To really be robust, the makefile needs to autodetect what version of Darwin the build is running on so it can use the appropriate paths. There is a more serious issue that needs eventually to be addressed. The original build environment was set up to depend on a Homebrew install of Python. This was done because the project intends to eventually link to NEURON and NumPy/SciPy. Currently only NumPy is used, and only in a very rudimentary manner. My research on SciPy and especially NEURON on OSX indicates that the stock version of Python is not suitable for supporting these packages. This led to my choice of linking against a Homebrew version of Python, which has been reported as working with all of the above software. Macports Python is also reported to work, but I had to start somewhere. Ideally, the makefiles for Linux and OSX should be unified with autodetect of platform enabled (example here: http://stackoverflow.com/questions/714100/os-detecting-makefile). We should also decide on a common directory structure. Naturally, I prefer the one I used in the OSX version. |
In the meantime, in lieu of a platform autodetect, I added a couple of variables to the makefile in order to allow command-line specification of the python directories. (I have installed Python through MacPorts). This allowed me to compile okay! It's not a complete fix like @Neurophile was asking for, but it's a start. EDIT: The correct pull request is #31. |
I had another issue with compiling the makefile for OSX: After modifying the directory to the right version of python, I keep on getting this error: After some troubleshooting, I found that removing the line I realized Any thoughts? |
Hi @wilzh40 many thanks for let me know! I found that in makefile for Mac variable BINARYTESTDIR isn't defined, I've fixed it, unfortunately I have no possibility to check this on mac so please let me know how it work for you (test code from development branch). |
@skhayrulin |
For this you should make little chages in code change const generateWormBodyConfiguration at this line. Then rebuild code (make clean then make in terminal). It should run simulation with worm body configuration. If any question or problem please let me know. |
@skhayrulin |
$ make all -f makefile.OSX
Building file: src/PyramidalSimulation.cpp
Invoking: clang C++ Compiler
g++ -O1 -Wall -c -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Headers/ -framework OpenCL -fmessage-length=0 -MMD -MP -MF"build/PyramidalSimulation.d" -MT"build/PyramidalSimulation.d" -o "build/PyramidalSimulation.o" "src/PyramidalSimulation.cpp"
clang: warning: -framework OpenCL: 'linker' input unused
src/PyramidalSimulation.cpp:10:10: fatal error: 'Python.h' file not found
include <Python.h>
1 error generated.
make: *** [build/PyramidalSimulation.o] Error 1
The makefile seems to presume that Python was installed with Homebrew.
The text was updated successfully, but these errors were encountered: