This project is read-only.
1
Vote

CNTK build on Intel CPU with MKL

description

Hello,

I am trying to build the CPU version of the code with Intel MKL and Intel MPI.

I am using mpicxx and the latest MKL.

My Config.make file looks like

cat Config.make

Configuration file for cntk

BUILDTYPE=release
MATHLIB=mkl
MKL_PATH=/opt/intel/compilers_and_libraries_2016.1.150/linux/

when I am trying to build, I get the following error:

building output for with build type release
mpicxx -L/localdisk/igokhale/ML/cntk/build/release/lib -L/opt/intel/compilers_and_libraries_2016.1.150/linux//compiler/lib/intel64 -L/opt/intel/compilers_and_libraries_2016.1.150/linux//mkl/lib/intel64 -L/opt/intel/compilers_and_libraries_2016.1.150/linux//compiler/lib/mic -L/opt/intel/compilers_and_libraries_2016.1.150/linux//mkl/lib/mic -Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,/opt/intel/compilers_and_libraries_2016.1.150/linux//compiler/lib/intel64 -Wl,-rpath,/opt/intel/compilers_and_libraries_2016.1.150/linux//mkl/lib/intel64 -Wl,-rpath,/opt/intel/compilers_and_libraries_2016.1.150/linux//compiler/lib/mic -Wl,-rpath,/opt/intel/compilers_and_libraries_2016.1.150/linux//mkl/lib/mic -o /localdisk/igokhale/ML/cntk/build/release/bin/cntk MachineLearning/CNTK/buildinfo.h /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/CNTK.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/ModelEditLanguage.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/NetworkDescriptionLanguage.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/SimpleNetworkBuilder.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/SynchronousExecutionEngine.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/tests.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNode.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetwork.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetworkEvaluation.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetworkAnalysis.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetworkEditing.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetworkBuilder.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKComputationNetworkLib/ComputationNetworkScripting.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKSGDLib/Profiler.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKSGDLib/SGD.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKActionsLib/TrainActions.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKActionsLib/EvalActions.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKActionsLib/OtherActions.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKActionsLib/EsotericActions.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKSequenceTrainingLib/latticeforwardbackward.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKSequenceTrainingLib/parallelforwardbackward.o /localdisk/igokhale/ML/cntk/build/release/.build/BrainScript/BrainScriptEvaluator.o /localdisk/igokhale/ML/cntk/build/release/.build/BrainScript/BrainScriptParser.o /localdisk/igokhale/ML/cntk/build/release/.build/BrainScript/BrainScriptTest.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/ExperimentalNetworkBuilder.o /localdisk/igokhale/ML/cntk/build/release/.build/Common/BestGpu.o /localdisk/igokhale/ML/cntk/build/release/.build/Common/MPIWrapper.o /localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTKSequenceTrainingLib/latticeNoGPU.o -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -liomp5 -lpthread -lcntkmath -fopenmp
/localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::CheckName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfE9CheckNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb[_ZN9Microsoft3MSR4CNTK9NDLScriptIfE9CheckNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb]+0x6c): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
/localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::NDLScript(Microsoft::MSR::CNTK::ConfigValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfEC2ERKNS1_11ConfigValueENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb[_ZN9Microsoft3MSR4CNTK9NDLScriptIfEC5ERKNS1_11ConfigValueENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb]+0x30e): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
/localdisk/igokhale/ML/cntk/build/release/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::ParseValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfE10ParseValueERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm[_ZN9Microsoft3MSR4CNTK9NDLScriptIfE10ParseValueERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm]+0x2d2): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
collect2: error: ld returned 1 exit status
make[1]: *** [/localdisk/igokhale/ML/cntk/build/release/bin/cntk] Error 1
make[1]: Leaving directory `/localdisk/igokhale/ML/cntk'
make: *** [all] Error 2

can someone please assist/guide me on what I may be doing incorrectly?

comments

igokhale wrote Dec 15, 2015 at 11:13 PM

i manually added #include "NetworkDescriptionLanguage.h" in CNTK.cpp and now, i get a different error -

/localdisk/igokhale/ML/cntk/build/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::CheckName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfE9CheckNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb[_ZN9Microsoft3MSR4CNTK9NDLScriptIfE9CheckNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb]+0x6c): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
/localdisk/igokhale/ML/cntk/build/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::NDLScript(Microsoft::MSR::CNTK::ConfigValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfEC2ERKNS1_11ConfigValueENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb[_ZN9Microsoft3MSR4CNTK9NDLScriptIfEC5ERKNS1_11ConfigValueENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb]+0x30e): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
/localdisk/igokhale/ML/cntk/build/.build/MachineLearning/CNTK/CNTK.o: In function Microsoft::MSR::CNTK::NDLScript<float>::ParseValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long)':
CNTK.cpp:(.text._ZN9Microsoft3MSR4CNTK9NDLScriptIfE10ParseValueERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm[_ZN9Microsoft3MSR4CNTK9NDLScriptIfE10ParseValueERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmm]+0x2d2): undefined reference to
bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
collect2: error: ld returned 1 exit status
make[1]: *** [/localdisk/igokhale/ML/cntk/build/bin/cntk] Error 1
make[1]: Leaving directory `/l

it's looks like there is some issue with the linker, though I am unable to pin point yet. debugging. any assistance is appreciated, thanks!

trungnt13 wrote Dec 25, 2015 at 12:09 PM

Hi,
This is the configuration I used for building CNTK
https://gist.github.com/trungnt13/7744039eb0551da210ac

It seem to me that you used too old version of gcc (must be >4.8.4 as I remember)

Regards,
Trung