Skip to content
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

OS X 10.9 install with macports #447

Closed
szagoruyko opened this issue May 24, 2014 · 7 comments
Closed

OS X 10.9 install with macports #447

szagoruyko opened this issue May 24, 2014 · 7 comments

Comments

@szagoruyko
Copy link

I can not compile caffe on OSX 10.9.3 with CUDA 5/6.
Using this settings:
CXX := /usr/bin/clang++
CXXFLAGS := -stdlib=libstdc++

I use macports and custom opencv build.

getting numerous errors like this:
/usr/local/cuda/bin/nvcc -ccbin=/usr/bin/clang++ -Xcompiler -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I/opt/local/include -I/opt/opencv/install/include -I./src -I./include -I/usr/local/cuda/include -I/opt/intel/mkl/include -gencode arch=compute_30,code=sm_30 -c src/caffe/layers/bnll_layer.cu -o build/src/caffe/layers/bnll_layer.cuo
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(226): error: identifier "__char16_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(227): error: identifier "__char32_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(348): error: expected an identifier

@shelhamer
Copy link
Member

You have to follow the installation details for 10.9. Caffe and its linked
dependencies all need to be compiled with libstdc++. Macports is entirely
untested by us for this purpose-that is why we give a homebrew guide and
explain how to edit the install formula so that dependencies are built
correctly.

Plus, are you compiling with the command line tools (Apple developer CLT)
or Xcode? Try the CLT.

Le samedi 24 mai 2014, Sergey Zagoruyko notifications@github.com a écrit :

I can not compile caffe on OSX 10.9.3 with CUDA 5/6.
Using this settings:
CXX := /usr/bin/clang++
CXXFLAGS := -stdlib=libstdc++

I use macports and custom opencv build.

getting numerous errors like this:
/usr/local/cuda/bin/nvcc -ccbin=/usr/bin/clang++ -Xcompiler -fPIC -DNDEBUG
-O2 -I/usr/include/python2.7
-I/usr/local/lib/python2.7/dist-packages/numpy/core/include
-I/usr/local/include -I/opt/local/include -I/opt/opencv/install/include
-I./src -I./include -I/usr/local/cuda/include -I/opt/intel/mkl/include
-gencode arch=compute_30,code=sm_30 -c src/caffe/layers/bnll_layer.cu -o
build/src/caffe/layers/bnll_layer.cuo
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(226):
error: identifier "__char16_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(227):
error: identifier "__char32_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(348):
error: expected an identifier


Reply to this email directly or view it on GitHubhttps://github.com//issues/447
.

Evan Shelhamer

@szagoruyko
Copy link
Author

Thanks Evan,
I don't enter the linking step, problems start when compiling with nvcc. I've tried both CLT and Xcode, got the same error.
Switching from macports to brew is not very handy at all when you got lots of projects configured for macports, and they do not coexist.. Do you think it is possible to adjust the build system for macports?

@szagoruyko
Copy link
Author

I was able to overcome the problem with nvcc. The root was that nvcc call in Makefile should contain the line

-Xcompiler -stdlib=libstdc++ -Xlinker -stdlib=libstdc++ instead of just -Xcompiler -fPIC

@shelhamer shelhamer changed the title OS X 10.9 compile problem OS X 10.9 install with macports May 26, 2014
@shelhamer
Copy link
Member

Thanks for posting your fix. I haven't had to include those flags on my OSX 10.9 install with homebrew–the included Makefile is fine–but whatever works.

@shelhamer
Copy link
Member

@luzhi re: #715 (comment)

Follow the official instructions except install the dependencies by macports if you insist. Should you succeed, please write up your steps in our unofficial documentation on the wiki: https://github.com/BVLC/caffe/wiki. While the broader Caffe community may be able to give you further advice for non-standard choices, we can only recommend our official documentation.

Good luck.

@luzhi
Copy link

luzhi commented Jul 18, 2014

@shelhamer Thanks! I will have a try on my Macbook pro. :)

@szagoruyko
Copy link
Author

I tried to continue, got a strange boost compile error which I couldn't overcome and switched to homebrew. Don't use caffe on this machine though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants