CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction<float>

Open pannous opened this issue 10 years ago • 6 comments

somehow the compiler gets confused by the template

template <typename ElemType> bool CheckFunction(std::string& p_nodeType, bool* allowUndeterminedVariable = nullptr);

=-----------------------------------------------------------=
mpic++  -shared -L./lib -L/opt/acml5.3.1/ifort64_mp/lib -L/opt/opencv-3.0.0/release/lib -Wl,-rpath,'$ORIGIN' -Wl,-rpath,/opt/acml5.3.1/ifort64_mp/lib -Wl,-rpath,/opt/opencv-3.0.0/release/lib -o lib/ImageReader.so .build/Source/Readers/ImageReader/Exports.o .build/Source/Readers/ImageReader/ImageReader.o -lcntkmath -lopencv_core -lopencv_imgproc -lopencv_imgcodecs
=-----------------------------------------------------------=
building output for with build type release
mpic++  -L./lib -L/opt/acml5.3.1/ifort64_mp/lib -L/opt/opencv-3.0.0/release/lib -Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,/opt/acml5.3.1/ifort64_mp/lib -Wl,-rpath,/opt/opencv-3.0.0/release/lib -o bin/cntk Source/CNTK/buildinfo.h .build/Source/CNTK/CNTK.o .build/Source/CNTK/ModelEditLanguage.o .build/Source/CNTK/NetworkDescriptionLanguage.o .build/Source/CNTK/SimpleNetworkBuilder.o .build/Source/CNTK/SynchronousExecutionEngine.o .build/Source/CNTK/tests.o .build/Source/ComputationNetworkLib/ComputationNode.o .build/Source/ComputationNetworkLib/ComputationNetwork.o .build/Source/ComputationNetworkLib/ComputationNetworkEvaluation.o .build/Source/ComputationNetworkLib/ComputationNetworkAnalysis.o .build/Source/ComputationNetworkLib/ComputationNetworkEditing.o .build/Source/ComputationNetworkLib/ComputationNetworkBuilder.o .build/Source/ComputationNetworkLib/ComputationNetworkScripting.o .build/Source/SGDLib/Profiler.o .build/Source/SGDLib/SGD.o .build/Source/ActionsLib/TrainActions.o .build/Source/ActionsLib/EvalActions.o .build/Source/ActionsLib/OtherActions.o .build/Source/ActionsLib/SpecialPurposeActions.o .build/Source/SequenceTrainingLib/latticeforwardbackward.o .build/Source/SequenceTrainingLib/parallelforwardbackward.o .build/Source/CNTK/BrainScript/BrainScriptEvaluator.o .build/Source/CNTK/BrainScript/BrainScriptParser.o .build/Source/CNTK/BrainScript/BrainScriptTest.o .build/Source/CNTK/BrainScript/ExperimentalNetworkBuilder.o .build/Source/Common/BestGpu.o .build/Source/Common/MPIWrapper.o .build/Source/SequenceTrainingLib/latticeNoGPU.o  -lacml_mp -liomp5 -lm -lpthread -lcntkmath -fopenmp
.build/Source/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)':
/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:800: undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
.build/Source/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)':
/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:525: undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*)'
.build/Source/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)':
/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:1022: 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
Makefile:494: recipe for target 'bin/cntk' failed
make: *** [bin/cntk] Error 1

pannous avatar Jan 26 '16 16:01 pannous

@pannous, what version of gcc are you using? mpic++ -v

From: pannous [mailto:[email protected]] Sent: Tuesday, January 26, 2016 8:01 AM To: Microsoft/CNTK [email protected] Subject: [CNTK] undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction (#26)

somehow the compiler gets confused by the template

template bool CheckFunction(std::string& p_nodeType, bool* allowUndeterminedVariable = nullptr);

=-----------------------------------------------------------=

mpic++ -shared -L./lib -L/opt/acml5.3.1/ifort64_mp/lib -L/opt/opencv-3.0.0/release/lib -Wl,-rpath,'$ORIGIN' -Wl,-rpath,/opt/acml5.3.1/ifort64_mp/lib -Wl,-rpath,/opt/opencv-3.0.0/release/lib -o lib/ImageReader.so .build/Source/Readers/ImageReader/Exports.o .build/Source/Readers/ImageReader/ImageReader.o -lcntkmath -lopencv_core -lopencv_imgproc -lopencv_imgcodecs

=-----------------------------------------------------------=

building output for with build type release

mpic++ -L./lib -L/opt/acml5.3.1/ifort64_mp/lib -L/opt/opencv-3.0.0/release/lib -Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,/opt/acml5.3.1/ifort64_mp/lib -Wl,-rpath,/opt/opencv-3.0.0/release/lib -o bin/cntk Source/CNTK/buildinfo.h .build/Source/CNTK/CNTK.o .build/Source/CNTK/ModelEditLanguage.o .build/Source/CNTK/NetworkDescriptionLanguage.o .build/Source/CNTK/SimpleNetworkBuilder.o .build/Source/CNTK/SynchronousExecutionEngine.o .build/Source/CNTK/tests.o .build/Source/ComputationNetworkLib/ComputationNode.o .build/Source/ComputationNetworkLib/ComputationNetwork.o .build/Source/ComputationNetworkLib/ComputationNetworkEvaluation.o .build/Source/ComputationNetworkLib/ComputationNetworkAnalysis.o .build/Source/ComputationNetworkLib/ComputationNetworkEditing.o .build/Source/ComputationNetworkLib/ComputationNetworkBuilder.o .build/Source/ComputationNetworkLib/ComputationNetworkScripting.o .build/Source/SGDLib/Profiler.o .build/Source/SGDLib/SGD.o .build/Source/ActionsLib/TrainActions.o .build

/Source/ActionsLib/EvalActions.o .build/Source/ActionsLib/OtherActions.o .build/Source/ActionsLib/SpecialPurposeActions.o .build/Source/SequenceTrainingLib/latticeforwardbackward.o .build/Source/SequenceTrainingLib/parallelforwardbackward.o .build/Source/CNTK/BrainScript/BrainScriptEvaluator.o .build/Source/CNTK/BrainScript/BrainScriptParser.o .build/Source/CNTK/BrainScript/BrainScriptTest.o .build/Source/CNTK/BrainScript/ExperimentalNetworkBuilder.o .build/Source/Common/BestGpu.o .build/Source/Common/MPIWrapper.o .build/Source/SequenceTrainingLib/latticeNoGPU.o -lacml_mp -liomp5 -lm -lpthread -lcntkmath -fopenmp

.build/Source/CNTK/CNTK.o: In function `Microsoft::MSR::CNTK::NDLScript::CheckName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)':

/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:800: undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, bool*)'

.build/Source/CNTK/CNTK.o: In function `Microsoft::MSR::CNTK::NDLScript::NDLScript(Microsoft::MSR::CNTK::ConfigValue const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool)':

/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:525: undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, bool*)'

.build/Source/CNTK/CNTK.o: In function `Microsoft::MSR::CNTK::NDLScript::ParseValue(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned long, unsigned long)':

/home/me/CNTK-r2016-01-26/Source/CNTK/NetworkDescriptionLanguage.h:1022: undefined reference to `bool Microsoft::MSR::CNTK::CheckFunction(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, bool*)'

collect2: error: ld returned 1 exit status

Makefile:494: recipe for target 'bin/cntk' failed

make: *** [bin/cntk] Error 1

— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/26.

chrisbasoglu avatar Jan 26 '16 16:01 chrisbasoglu

Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-22ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) 

pannous avatar Jan 26 '16 16:01 pannous

l $HOME/mpi/bin/mpic++ lrwxrwxrwx 1 me 12 Jan 25 21:01 ~/mpi/bin/mpic++ -> opal_wrapper if that helps

pannous avatar Jan 26 '16 16:01 pannous

@pannous: We currently test our builds with gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04). We will file a work item to test with later versions of gcc. In the meantime, would it be possible for you to try with version 4.8.4?

chrisbasoglu avatar Jan 26 '16 18:01 chrisbasoglu

@pannous: Did this get you going? Any more related issues?

thx Wolfgang

wolfma61 avatar Feb 14 '16 07:02 wolfma61

Closing since there has been no further information from 'pannous'

wolfma61 avatar Feb 22 '16 16:02 wolfma61