0

I am trying to build CNTK from the source on Arch Linux.

git commands:

git clone https://github.com/Microsoft/CNTK
cd CNTK
git submodule sync --recursive
git submodule update --init --recursive

configure and make commands:

./configure --with-mkl=/usr/local/CNTKCustomMKL --1bitsgd=yes --asgd=no
make all

The error:

building ./bin/cppevalclient for Linux with build type release
/usr/bin/mpic++  -rdynamic -L./lib -L/usr/local/CNTKCustomMKL/3/x64/parallel -L/usr/lib -L/usr/lib -L/usr/release/lib -Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,/usr/local/CNTKCustomMKL/3/x64/parallel -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/release/lib -o bin/cppevalclient .build/Source/../Examples/Evaluation/CPPEvalClient/CPPEvalClient.o -lm -lmkl_cntk_p -liomp5 -lpthread -lCntk.Eval-2.0 -lCntk.Math-2.0 -lCntk.PerformanceProfiler-2.0 
./lib/libCntk.Eval-2.0.so: undefined reference to `Microsoft::MSR::CNTK::TensorView<double> const* CNTK::NDArrayView::GetTensorView<double>() const'
./lib/libCntk.Eval-2.0.so: undefined reference to `Microsoft::MSR::CNTK::TensorView<float> const* CNTK::NDArrayView::GetTensorView<float>() const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:628: bin/cppevalclient] Error 1

TensorView is part of Source/Math, so I expect libCntk.Math-2.0.so. But in the error message, libCntk.Eval-2.0.so complains about undefined reference to TensorView.

Thanks!

Edit 1:

All three .so files are built and avaiable:

-rwxr-xr-x 1 a a 252658744 2017-06-21 21:01 libCntk.Eval-2.0.so
-rwxr-xr-x 1 a a 59993400  2017-06-21 21:00 libCntk.Math-2.0.so
-rwxr-xr-x 1 a a 1911472   2017-06-21 21:00 libCntk.PerformanceProfiler-2.0.so

Edit 2:

mpic++ --version gives g++ (GCC) 7.1.1

The authors suggest to use gcc 4.8. However, I would not like to have two versions of gcc on the machine.

Edit 3:

Based on a suggestion I got from the authors (https://github.com/Microsoft/CNTK/issues/2025), I commented out the EVAL_CLIENT target in the Makefile. However, the error moved to the next target in the Makefile: CNTKLIBRARY_CPP_EVAL_EXAMPLES

Edit 4:

It seems the error is related to the linker and some flags such as --as-needed, --whole-archive, and so on. However, I could not fix it yet.

Thanks!

imriss
  • 1,815
  • 4
  • 31
  • 46

1 Answers1

1

Not sure whether it is caused by GCC 7.1.1. If you do not want to install two versions of gcc on the machine, are you able to run docker? CNTK supports docker container too. Details can be found https://learn.microsoft.com/en-us/cognitive-toolkit/CNTK-Docker-Containers.

Zhou
  • 546
  • 3
  • 3
  • Thanks. I am using the Docker containers of CNTK. However, I use Arch Linux as the baseline OS, and I would like to find a solution to compile it with higher versions of GCC to streamline CNTK installation on Arch Linux. – imriss Jul 10 '17 at 12:37