Problems with building MXNet Shared Library from source on Mac OS (for Scala)

Hi all,

I would like to use MXNet in a Scala application, but I have problems with the installation procedure (on Mac OSX Sierra 10.12.6). I have installed all the dependencies and I would like to build the shared library now, so that I can create the packages for Scala. But the build fails when I run the command
make -j$(sysctl -n hw.ncpu)

The first issue was this:
ld: library not found for -llibopencv_stitching.3.3.1.dylib clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have been able to work around this by excluding OpenCV for the moment:
in config.mk:
USE_OPENCV = 1 -> USE_OPENCV = 0

Now I am getting this error:
"cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const", referenced from: mxnet::io::DefaultImageDetAugmenter::Process(cv::Mat const&, std::__1::vector<float, std::__1::allocator<float> >*, std::__1::mersenne_twister_engine<unsigned int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul, 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>*) in image_det_aug_default.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation

make: *** [lib/libmxnet.so] Error 1

I am not sure how to resolve that one, as “x86_64” seems to be the right architecture, but something is missing for the linker, it seems.

Any ideas on how to resolve this? Thanks a lot.

Cheers,

Martin

I see that as well on my mac. The strange thing is that if I look at the linker command, I see:

 -L/usr/local/Cellar/opencv/3.3.1_1/lib -llibopencv_stitching.3.3.1.dylib

and there is indeed a libopencv_stitching.3.3.1.dylib file in that directory, so I don’t know why this is failing. Perhaps the problem is an indirect dependency?

In any case, I was able to build with USE_OPENCV set to 0 when building from scratch, so you may have to do a make clean or perhaps you can get away with just removing the .o files that have errors to force them to be recompiled.

This should probably be filed as a bug.

Issue created: https://github.com/apache/incubator-mxnet/issues/8667