-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Remove python2 from matlab CMakeLists.txt #2279
Conversation
This is a proposed fix for Issue #2078 Builds with MATLAB support are complaining `library not found for -lpython2` when Python support is enabled. Linking to Python is not necessary for the MATLAB build, so that library should be stripped out.
@eshelman @shelhamer this is not the right fix after PythonLayer is introduced. Python lib could be necessary if you want to use a net in MatCaffe that has PythonLayer, so it shouldn't be stripped. I think the correct solution to #2078 would be changing |
@eshelman @shelhamer @ronghanghu For PythonLayer, is python linked to Caffe directly now? If so, than it shouldn't be a an issue, right? Or, have I missed something? I can't check this now, I am here from tablet device. |
@ronghanghu Just checked, Python was added to Caffe link list in 3d30510, when PythonLayer was introduced. It seems after that, this issue with Matlab appeared. From my view, just removing python form the list is ok. LGTM |
@Nerei Forgive me if I am wrong, but I think Dynamic linking #1842 did not cover matcaffe, and matcaffe is still using static linking against libcaffe.a instead of libcaffe.so? Why "only shared Caffe is supported now"? |
@ronghanghu By default CMake builds shared caffe (it doesn't build both). With static caffe Matlab doesn't work at all. For Matlab, I didn't find flags equivalent to |
@Nerei I am using the Makefile and use make instead of cmake, and I believe matcaffe is still statically linked against libcaffe.a instead of libcaffe.so, at least so with the Makefile (and it works). To verify this, I deleted caffe/build/lib/libcaffe.so after building. After that, although the command line tools became broken, I can still use matcaffe without any problem.
I am not very familiar with CMake and those CMakeLists.txt in Caffe. Not sure why it is. |
The addition of However if python is indeed not required for matlab wrapper, then it should be removed. However the fix proposed in this pull request of simply removing python from the linkerflags by string matching is very hacky. |
Let's not hack things. I'll close this, as it's my hack ;-) |
This is a proposed fix for Issue #2078
Builds with MATLAB support are complaining
library not found for -lpython2
when Python support is enabled. Linking to Python is not necessary for the MATLAB build, so that library should be stripped out.