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

Problem building matcaffe with XCode 6 #1212

Closed
dgolden1 opened this issue Oct 3, 2014 · 10 comments
Closed

Problem building matcaffe with XCode 6 #1212

dgolden1 opened this issue Oct 3, 2014 · 10 comments

Comments

@dgolden1
Copy link
Contributor

dgolden1 commented Oct 3, 2014

Using the dev branch, commit 6af4575, I get the following error when running make matcaffe:

Building with 'Xcode Clang++'.
ld: framework not found vecLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have what I believe is the latest version of XCode 6 (Version 6.0.1 (6A317)) and command line tools (6.0.0.0.1.1410400753) installed:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 6.0.0.0.1.1410400753
volume: /
location: /
install-time: 1412278538
groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group 

Here's my Makefile.config: https://gist.github.com/drdan14/cedd7c5eab6ba503c16b

I'm on a Macbook Air with no GPU and OS X 10.9.5.

@damro
Copy link

damro commented Oct 3, 2014

Yes, same error here for make matcaffe with OS X 10.9.5

@shelhamer
Copy link
Member

Perhaps the vecLib path has changed in the latest Xcode. Try to patch the
Makefile or as a workaround configure your installation for OpenBLAS
instead of ATLAS / Accelerate / vecLib.

On Thu, Oct 2, 2014 at 5:31 PM, damro notifications@github.com wrote:

Yes, same error here for make matcaffe...


Reply to this email directly or view it on GitHub
#1212 (comment).

@shelhamer
Copy link
Member

That should have been try to patch your mexopts.sh build configuration, not
the Makefile. If the Makefile paths were wrong nothing would build at all.

On Thu, Oct 2, 2014 at 5:47 PM, Evan Shelhamer <
shelhamer@imaginarynumber.net> wrote:

Perhaps the vecLib path has changed in the latest Xcode. Try to patch the
Makefile or as a workaround configure your installation for OpenBLAS
instead of ATLAS / Accelerate / vecLib.

On Thu, Oct 2, 2014 at 5:31 PM, damro notifications@github.com wrote:

Yes, same error here for make matcaffe...


Reply to this email directly or view it on GitHub
#1212 (comment).

@vimalthilak
Copy link

You can get over the vecLib hump with the following change:

    # OS X packages atlas as the vecLib framework
  •   BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
    
  •   # BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
    
  •   BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
    LIBRARIES += cblas
    
  •   LDFLAGS += -framework vecLib
    
  •   # LDFLAGS += -framework vecLib
    
  •   LDFLAGS += -framework Accelerate
    

(saw this on caffe users google groups IIRC).

After this, I encountered a LD-related error that I resolved by pointing to the correct C++ run-time. (libstdc++)

This allowed me to build the mex binary but I haven't tested it out to ensure it works correctly at run-time.

@dgolden1
Copy link
Contributor Author

Here's a Makefile patch against 5c4125d (master): https://gist.github.com/drdan14/19596fe46d4b92db2012

This solves the vecLib problem (and it was @vimalthilak's idea).

However, after applying that patch, I run into other errors that look like this:

Building with 'Xcode Clang++'.
Undefined symbols for architecture x86_64:
  "std::string::find(char, unsigned long) const", referenced from:
      boost::basic_format<char, std::char_traits<char>, std::allocator<char> >::parse(std::string const&) in libcaffe.a(math_functions.o)
      int boost::io::detail::upper_bound_from_fstring<std::string, std::ctype<char> >(std::string const&, std::string::value_type, std::ctype<char> const&, unsigned char) in libcaffe.a(math_functions.o)
  "std::string::compare(char const*) const", referenced from:
      _mexFunction in matcaffe.o
      caffe::UpgradeV0PaddingLayers(caffe::NetParameter const&, caffe::NetParameter*) in libcaffe.a(upgrade_proto.o)
      caffe::UpgradeLayerParameter(caffe::LayerParameter const&, caffe::LayerParameter*) in libcaffe.a(upgrade_proto.o)
      caffe::UpgradeV0LayerType(std::string const&) in libcaffe.a(upgrade_proto.o)
      caffe::Filler<float>* caffe::GetFiller<float>(caffe::FillerParameter const&) in libcaffe.a(dummy_data_layer.o)
      caffe::Filler<double>* caffe::GetFiller<double>(caffe::FillerParameter const&) in libcaffe.a(dummy_data_layer.o)
      caffe::WindowDataLayer<float>::DataLayerSetUp(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> >*) in libcaffe.a(window_data_layer.o)
...

@dgolden1
Copy link
Contributor Author

Fix available in #1310

@dgolden1
Copy link
Contributor Author

Credit @vimalthilak for coming up with it

@shelhamer
Copy link
Member

This should be fixed with #1740. Please follow-up if not. Sorry for the turnaround time on 10.10!

@zyzn
Copy link

zyzn commented Nov 13, 2017

Hi, I add this in my Makefile according to vimalthilak' suggestion, but it still comes the error "ld: framework not found vecLib". Could you help me of that?

@soulslicer
Copy link

I have the same error as well

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

No branches or pull requests

6 participants