CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

CNTK compile Error on Linux

Open qingwang24 opened this issue 10 years ago • 9 comments

I tried to install CNTK on Linux. But I have following compile errors:

mpic++ -rdynamic -L/CNTK/cntk/build/release/lib -L/usr/local/cuda-7.5/lib64 -L/usr/local/cudnn-5.1/cuda/lib64 -L//x64/parallel -L/usr -Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,/usr/local/cuda-7.5/lib64 -Wl,-rpath,/usr/local/cudnn-5.1/cuda/lib64 -Wl,-rpath,//x64/parallel -o /CNTK/cntk/build/release/bin/v2librarytests /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/FeedForwardTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/Main.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/Common.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/NDArrayViewTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/RecurrentFunctionTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/TensorTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/TrainerTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/CifarResNet.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/SerializationTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/LearnerTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/FunctionTests.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/SequenceClassification.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/Seq2Seq.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/TruncatedLSTMAcousticModel.o /CNTK/cntk/build/release/.build/Tests/UnitTests/V2LibraryTests/DeviceSelectionTests.o /CNTK/cntk/build/release/.build/Examples/Evaluation/CPPEvalV2Client/EvalMultithreads.o -lcublas -lcudart -lcuda -lcurand -lcusparse -lnvidia-ml -lcudnn -lm -lmkl_cntk_p -liomp5 -lpthread -lcntklibrary-2.0 -lcntkmath /usr/lib/libmkl_cntk_p.so: undefined reference to `memcpy@GLIBC_2.14'

collect2: 错误:ld 返回 1 make[1]: *** [/CNTK/cntk/build/release/bin/v2librarytests] 错误 1 make[1]: Leaving directory `/CNTK/cntk' make: *** [all] 错误 2

I installed necessary components. I install glibc-2.17 and add its path to $LD_LIBRARY_PATH. I can not figure out why it failed. So, could you give me any suggestion to fix this problem? Thank you.

qingwang24 avatar Nov 17 '16 13:11 qingwang24

It says /usr/lib/libmkl_cntk_p.so: undefined reference tomemcpy@GLIBC_2.14'`. Probably caused by your previous installed glibc-2.14. You may try rebuild the packages with latest glibc-2.17.

junjieqian avatar Nov 17 '16 22:11 junjieqian

Thank you, junjieqian. I can not find my previous installed glibc-2.14, so I uninstall glibc-2.17 and install glibc-2.14. It works. But when I make again, I got the follow errors:

/CNTK/cntk/build/release/.build/Source/Common/BestGpu.o /CNTK/cntk/build/release/.build/Source/Common/MPIWrapper.o /CNTK/cntk/build/release/.build/Source/SequenceTrainingLib/latticeforwardbackward.o /CNTK/cntk/build/release/.build/Source/SequenceTrainingLib/parallelforwardbackward.o /CNTK/cntk/build/release/.build/Source/Math/cudalattice.o /CNTK/cntk/build/release/.build/Source/Math/cudalib.o -lcublas -lcudart -lcuda -lcurand -lcusparse -lnvidia-ml -lcudnn -lm -lmkl_cntk_p -liomp5 -lpthread -lcntkmath -lmultiverso /usr/local/protobuf-3.1.0/lib/libprotobuf.a /usr/bin/ld: cannot find -lmultiverso collect2: error: ld returned 1 exit status make[1]: *** [/CNTK/cntk/build/release/lib/libeval.so] Error 1 make[1]: Leaving directory `/CNTK/cntk' make: *** [all] Error 2

However, I did not use the option "--asgd=yes" in the configure command. Why there is still "-lmultiverso" when I execute the command "make all" ?

qingwang24 avatar Nov 18 '16 06:11 qingwang24

The option "asgd" is yes by default. You can add Multiverso by running git submodule update --init Source/Multiverso in your CNTK root folder.

Or specify --asgd=no to disable this module.

feiga avatar Nov 18 '16 07:11 feiga

Thank you feiga. I have executed git submodule update --init Source/Multiverso in my CNTK root folder, but got the same error. I will try to use --asgd=no in the configure command.

qingwang24 avatar Nov 18 '16 07:11 qingwang24

@xqustc please make sure that you have Cmake installed, which will be used for multiverso building.

P.s. Clean your build after changing configures.

chivee avatar Nov 18 '16 08:11 chivee

@chivee My Cmake version is 2.8.12.2, and I cleaned the old project after changing configures. But still got the same error. When I use --asgd=no to disable the module, I got the following errors:

Source/../Tests/UnitTests/MathTests/BlockMultiplierTests.cpp:113:9: required from 'void Microsoft::MSR::CNTK::TEST::TestMultiplierSub(int, int, int, MultiplierT&, int, ScalarCT) [with ScalarAT = short int; ScalarBT = short int; ScalarCT = int; MultiplierT = Microsoft::MSR::CNTK::BlockMultiplierMicrosoft::MSR::CNTK::BlockHandlerSSE]' Source/../Tests/UnitTests/MathTests/BlockMultiplierTests.cpp:137:104: required from 'void Microsoft::MSR::CNTK::TEST::TestMultiplierSub(int, int, int, int, ScalarCT) [with ScalarAT = short int; ScalarBT = short int; ScalarCT = int; MultiplierT = Microsoft::MSR::CNTK::BlockMultiplierMicrosoft::MSR::CNTK::BlockHandlerSSE]' Source/../Tests/UnitTests/MathTests/BlockMultiplierTests.cpp:144:96: required from here Source/../Tests/UnitTests/MathTests/../../../Source/Math/BlockMultiplierPlatform.h:13:69: error: 'aligned_alloc' was not declared in this scope #define ALIGNED_ALLOC(bytes,alignment) aligned_alloc(alignment,bytes) ^ Source/../Tests/UnitTests/MathTests/../../../Source/Math/BlockMultiplier.h:454:48: note: in expansion of macro 'ALIGNED_ALLOC' __m128i* resultStorage = (_m128i)ALIGNED_ALLOC(sizeof(__m128i) * ha.rowsPerBlock * ha.n, 64); ^ make[1]: *_* [/disk2/qingwang/CNTK/cntk/build/release/.build/Source/../Tests/UnitTests/MathTests/BlockMultiplierTests.o] Error 1 make[1]: Leaving directory `/disk2/qingwang/CNTK/cntk' make: *** [all] Error 2

qingwang24 avatar Nov 18 '16 12:11 qingwang24

Please refer to this https://github.com/Microsoft/CNTK/issues/729. It is glibc version issue.

junjieqian avatar Nov 18 '16 17:11 junjieqian

OK Thank you. I will try.

qingwang24 avatar Nov 19 '16 04:11 qingwang24

no follow-up for a long time, please open a new issue if you experience this in a more recent CNTK installation

wolfma61 avatar Jun 28 '17 08:06 wolfma61