Building MXNET 1.0.0 from source for macOS


#1

So I’m attempting to build from source for macOS 10.13.2. I following the docs and have Xcode installed. Using the osx.mk file.

I get these errors:

/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(cudnn_algoreg.o) has no symbols
/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(cudnn_batch_norm.o) has no symbols
/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(mkl_cppwrapper.o) has no symbols
/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(mkl_memory.o) has no symbols
/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(nnpack_util.o) has no symbols
/Applications/Xcode8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libmxnet.a(rtc.o) has no symbols


ld: warning: directory not found for option '-Lenvironment/lib64'
ld: warning: directory not found for option '-Lenvironment/lib'
ld: warning: option -noall_load is obsolete and being ignored
Undefined symbols for architecture x86_64:
  "mxnet::common::random::RandGenerator<mshadow::cpu, mshadow::half::half_t>::kNumRandomStates", referenced from:
      mxnet::op::SamplerCaller<mshadow::cpu, float, mshadow::half::half_t, mxnet::op::UniformSampler<mshadow::cpu>, 2>::op(std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, mxnet::common::random::RandGenerator<mshadow::cpu, mshadow::half::half_t>*, mshadow::Stream<mshadow::cpu>*) in multisample_op.o
      mxnet::op::SamplerCaller<mshadow::cpu, double, mshadow::half::half_t, mxnet::op::UniformSampler<mshadow::cpu>, 2>::op(std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, mxnet::common::random::RandGenerator<mshadow::cpu, mshadow::half::half_t>*, mshadow::Stream<mshadow::cpu>*) in multisample_op.o
      mxnet::op::SamplerCaller<mshadow::cpu, mshadow::half::half_t, mshadow::half::half_t, mxnet::op::UniformSampler<mshadow::cpu>, 2>::op(std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > const&, std::__1::vector<mxnet::TBlob, std::__1::allocator<mxnet::TBlob> > c

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libmxnet.so] Error 1

Has anyone manage to build this recently on a mac? I’m new to this, so guess I’m missing something.


#2

Following the docs I have been able to build on 10.12.6 w/o problem.
Can you build from master and your problem is specific to 1.0.0?
Please see also Building from source for macOS with cuda 9


#3

Yep managed to get it to work now, with cuda 9 and cuDNN 7 and mxnet 1.0.1.

In case any one else attempt this, I put some steps together here: https://github.com/apache/incubator-mxnet/issues/9217


#4

Hi helloniklas,

I am also having problem building MXNet v 1.0.0 on OS X 10.13.2

I have just looked at the last version of MXNet here


and it was 1.0.0. Where did you find 1.0.1?


#5

I just pulled the latest without specifying version and that’s what came down. Might have been a nightly build.


#6

I did the same and your method worked.
Thanks!