I'm trying to build wav2letter++ for CPU on server without Nvidia GPU and successfully used following cmake config: cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CPU -DBUILD_TESTS=OFF.
After trying to run make -j4 I get following error message about CUDA:
firun@trunk:~/wav2letter/build$ make -j4
[ 25%] Built target wav2letter++
[ 27%] Linking CXX executable Test
[ 27%] Linking CXX executable Decoder
[ 28%] Linking CXX executable Train
//usrusr//binbin//ldld:: cannotcannot findfind --lCUDA_CUDART_LIBRARYlCUDA_CUDART_LIBRARY--NOTFOUNDNOTFOUND
//usrusr//binbin//ldld:: cannotcannot findfind --lwarpctclwarpctc
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
CMakeFiles/Decoder.dir/build.make:1134: recipe for target 'Decoder' failed
make[2]: *** [Decoder] Error 1
CMakeFiles/Test.dir/build.make:1134: recipe for target 'Test' failed
make[2]: *** [Test] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Decoder.dir/all' failed
make[1]: *** [CMakeFiles/Decoder.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Test.dir/all' failed
make[1]: *** [CMakeFiles/Test.dir/all] Error 2
/usr/bin/ld: cannot find -lCUDA_CUDART_LIBRARY-NOTFOUND
/usr/bin/ld: cannot find -lwarpctc
collect2: error: ld returned 1 exit status
CMakeFiles/Train.dir/build.make:1134: recipe for target 'Train' failed
make[2]: *** [Train] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/Train.dir/all' failed
make[1]: *** [CMakeFiles/Train.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
So is CUDA required although in requirements it's said that it's optional.
@firun — thanks for flagging: that's a bug in the build config. I'll send a fix for that later today.
@firun @jacobkahn I got the same errors as well.
thanks.
Fixed in 06befd0623d266dea240506a512a9fbc80115e94.
@jacobkahn Thanks for the fix but I still got following errors:
/usr/bin/ld: warning: libcuda.so.1, needed by /opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1, not found (try using -rpath or -rpath-link)
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference to cuLaunchKernel'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference tocuLinkComplete'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference to cuModuleGetFunction'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference tocuModuleLoadDataEx'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference to cuLinkAddData_v2'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference tocuLinkDestroy'
/opt/arrayfire-no-gl/lib/libafcuda.so.3.6.1: undefined reference to `cuLinkCreate_v2'
collect2: error: ld returned 1 exit status
CMakeFiles/Decoder.dir/build.make:1137: recipe for target 'Decoder' failed
make[2]: * [Decoder] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/Decoder.dir/all' failed
make[1]: * [CMakeFiles/Decoder.dir/all] Error 2
@firun Did you get any errors now?
@auvilink yep, I've got the same error as you, after I've pulled update from git:
1188 git fetch --all
1190 git reset --hard origin/master
1193 cd build/
1195 cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CPU -DBUILD_TESTS=OFF
1196 make -j4
Here is my full error log:
[ 96%] Linking CXX executable Test
/usr/bin/ld: warning: libcuda.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libGL.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
CMakeFiles/Test.dir/src/runtime/Logger.cpp.o: In function `w2l::getStatus(w2l::TrainMeters&, long, double, double, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Logger.cpp:(.text+0x202e): undefined reference to `fl::getWorldSize()'
CMakeFiles/Test.dir/src/runtime/Logger.cpp.o: In function `w2l::allreduceSet(fl::TimeMeter&, af::array&)':
Logger.cpp:(.text+0x26cf): undefined reference to `fl::getWorldSize()'
CMakeFiles/Test.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<w2l::TrainMeters>(w2l::TrainMeters&)':
Logger.cpp:(.text+0x276c): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2779): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x27f1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2802): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x281d): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x2835): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2850): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28a9): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28c1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x28e6): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Test.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::TimeMeter>(fl::TimeMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x61): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Test.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::EditDistanceMeter>(fl::EditDistanceMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x52): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Test.dir/src/runtime/Distributed.cpp.o: In function `w2l::maybeInitDistributedEnv(bool, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Distributed.cpp:(.text+0xcb4): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
Distributed.cpp:(.text+0xe59): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
//opt/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLaunchKernel'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkComplete'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleGetFunction'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleLoadDataEx'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorString'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkAddData_v2'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkCreate_v2'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorName'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
collect2: error: ld returned 1 exit status
CMakeFiles/Test.dir/build.make:1134: recipe for target 'Test' failed
make[2]: *** [Test] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Test.dir/all' failed
make[1]: *** [CMakeFiles/Test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Building CXX object CMakeFiles/Decoder.dir/src/runtime/Distributed.cpp.o
[ 97%] Building CXX object CMakeFiles/Train.dir/src/runtime/Serial.cpp.o
[ 98%] Building CXX object CMakeFiles/Train.dir/src/runtime/SpeechStatMeter.cpp.o
[ 98%] Building CXX object CMakeFiles/Train.dir/src/runtime/Distributed.cpp.o
[ 99%] Linking CXX executable Decoder
/usr/bin/ld: warning: libcuda.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libGL.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
CMakeFiles/Decoder.dir/src/runtime/Logger.cpp.o: In function `w2l::getStatus(w2l::TrainMeters&, long, double, double, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Logger.cpp:(.text+0x202e): undefined reference to `fl::getWorldSize()'
CMakeFiles/Decoder.dir/src/runtime/Logger.cpp.o: In function `w2l::allreduceSet(fl::TimeMeter&, af::array&)':
Logger.cpp:(.text+0x26cf): undefined reference to `fl::getWorldSize()'
CMakeFiles/Decoder.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<w2l::TrainMeters>(w2l::TrainMeters&)':
Logger.cpp:(.text+0x276c): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2779): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x27f1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2802): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x281d): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x2835): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2850): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28a9): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28c1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x28e6): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Decoder.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::TimeMeter>(fl::TimeMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x61): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Decoder.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::EditDistanceMeter>(fl::EditDistanceMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x52): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Decoder.dir/src/runtime/Distributed.cpp.o: In function `w2l::maybeInitDistributedEnv(bool, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Distributed.cpp:(.text+0xcb4): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
Distributed.cpp:(.text+0xe59): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
//opt/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLaunchKernel'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkComplete'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleGetFunction'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleLoadDataEx'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorString'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkAddData_v2'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkCreate_v2'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorName'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
collect2: error: ld returned 1 exit status
CMakeFiles/Decoder.dir/build.make:1134: recipe for target 'Decoder' failed
make[2]: *** [Decoder] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Decoder.dir/all' failed
make[1]: *** [CMakeFiles/Decoder.dir/all] Error 2
[100%] Linking CXX executable Train
/usr/bin/ld: warning: libcuda.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libGL.so.1, needed by /opt/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by //opt/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
CMakeFiles/Train.dir/Train.cpp.o: In function `main::{lambda(std::shared_ptr<fl::Module>, std::shared_ptr<w2l::SequenceCriterion>, std::shared_ptr<w2l::W2lDataset>, fl::FirstOrderOptimizer&, fl::FirstOrderOptimizer&, bool, int)#6}::operator()(std::shared_ptr<fl::Module>, std::shared_ptr<w2l::SequenceCriterion>, std::shared_ptr<w2l::W2lDataset>, fl::FirstOrderOptimizer&, fl::FirstOrderOptimizer&, bool, int) const::{lambda(long, double, double)#2}::operator()(long, double, double) const':
Train.cpp:(.text+0x2900): undefined reference to `fl::getWorldRank()'
CMakeFiles/Train.dir/Train.cpp.o: In function `main::{lambda(std::shared_ptr<fl::Module>, std::shared_ptr<w2l::SequenceCriterion>, std::shared_ptr<w2l::W2lDataset>, fl::FirstOrderOptimizer&, fl::FirstOrderOptimizer&, bool, int)#6}::operator()(std::shared_ptr<fl::Module>, std::shared_ptr<w2l::SequenceCriterion>, std::shared_ptr<w2l::W2lDataset>, fl::FirstOrderOptimizer&, fl::FirstOrderOptimizer&, bool, int) const [clone .constprop.9838]':
Train.cpp:(.text+0x2cf2): undefined reference to `fl::distributeModuleGrads(std::shared_ptr<fl::Module const>, double)'
Train.cpp:(.text+0x2d36): undefined reference to `fl::distributeModuleGrads(std::shared_ptr<fl::Module const>, double)'
Train.cpp:(.text+0x2d92): undefined reference to `fl::allReduceParameters(std::shared_ptr<fl::Module const>)'
Train.cpp:(.text+0x2dc1): undefined reference to `fl::allReduceParameters(std::shared_ptr<fl::Module const>)'
Train.cpp:(.text+0x2ead): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text+0x2f37): undefined reference to `fl::getWorldRank()'
CMakeFiles/Train.dir/Train.cpp.o: In function `main':
Train.cpp:(.text.startup+0x63b): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text.startup+0x648): undefined reference to `fl::getWorldSize()'
Train.cpp:(.text.startup+0x65c): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text.startup+0x669): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text.startup+0x6c3): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text.startup+0xd49): undefined reference to `fl::getWorldRank()'
Train.cpp:(.text.startup+0x102b): undefined reference to `fl::getWorldRank()'
CMakeFiles/Train.dir/Train.cpp.o:Train.cpp:(.text.startup+0x1196): more undefined references to `fl::getWorldRank()' follow
CMakeFiles/Train.dir/src/runtime/Logger.cpp.o: In function `w2l::getStatus(w2l::TrainMeters&, long, double, double, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Logger.cpp:(.text+0x202e): undefined reference to `fl::getWorldSize()'
CMakeFiles/Train.dir/src/runtime/Logger.cpp.o: In function `w2l::allreduceSet(fl::TimeMeter&, af::array&)':
Logger.cpp:(.text+0x26cf): undefined reference to `fl::getWorldSize()'
CMakeFiles/Train.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<w2l::TrainMeters>(w2l::TrainMeters&)':
Logger.cpp:(.text+0x276c): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2779): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x27f1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2802): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x281d): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x2835): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x2850): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28a9): undefined reference to `fl::allReduce(af::array&)'
Logger.cpp:(.text+0x28c1): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text+0x28e6): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Train.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::TimeMeter>(fl::TimeMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl9TimeMeterEEEvRT_]+0x61): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Train.dir/src/runtime/Logger.cpp.o: In function `void w2l::syncMeter<fl::EditDistanceMeter>(fl::EditDistanceMeter&)':
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x1a): undefined reference to `fl::isDistributedInit()'
Logger.cpp:(.text._ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_[_ZN3w2l9syncMeterIN2fl17EditDistanceMeterEEEvRT_]+0x52): undefined reference to `fl::allReduce(af::array&)'
CMakeFiles/Train.dir/src/runtime/Distributed.cpp.o: In function `w2l::maybeInitDistributedEnv(bool, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Distributed.cpp:(.text+0xcb4): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
Distributed.cpp:(.text+0xe59): undefined reference to `fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)'
//opt/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLaunchKernel'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkComplete'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleGetFunction'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuModuleLoadDataEx'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorString'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkAddData_v2'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkDestroy'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuLinkCreate_v2'
/opt/arrayfire/lib64/libafcuda.so.3.6.2: undefined reference to `cuGetErrorName'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
//opt/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
collect2: error: ld returned 1 exit status
CMakeFiles/Train.dir/build.make:1134: recipe for target 'Train' failed
make[2]: *** [Train] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/Train.dir/all' failed
make[1]: *** [CMakeFiles/Train.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
@auvilink @firun — all of the CUDA-symbol-related errors you're seeing are ArrayFire failing to link to CUDA libraries. This appears to be an edge case where one has unintentionally built and installed ArrayFire's CUDA backend (which has linked to libcuda), and which is being linked to wav2letter++ even though you've built flashlight with the CPU backend. The best way to fix this, if you can, would be to remove ArrayFire CUDA/libafcuda (in /opt/arrayfire/lib64/), or to explicitly disable building ArrayFire with the CUDA backend. This way, wav2letter++ will only find and link the ArrayFire CPU backend.
I should note that there's another edge case where one has built ArrayFire and flashlight with the CUDA backend, but is trying to use the CPU criterion backend with wav2letter++. That particular behavior isn't supported right now, since it involves linking multiple ArrayFire backends to the same library, and we don't yet support ArrayFire's unified backend.
@firun — your linker errors related to symbols like fl::isDistributedInit are because flashlight wasn't properly built/installed in distributed mode. I'd check your flashlight build again (this is currently a requirement for building wav2letter++).
Hope this helps.
@jacobkahn thanks, I've built flashlight without distributed mode, sorry.
cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CPU -DFL_BUILD_DISTRIBUTED=OFF -DFL_BUILD_TESTS=OFF -DFL_BUILD_EXAMPLES=OFF
After deleting libafcuda.so.* from /opt/arrayfire/lib64/ and running cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CPU -DBUILD_TESTS=OFF I get following error:
firun@trunk:~/wav2letter/build$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CPU -DBUILD_TESTS=OFF
CMake Error at /opt/arrayfire/share/ArrayFire/cmake/ArrayFireCUDATargets.cmake:74 (message):
The imported target "ArrayFire::afcuda" references the file
"/opt/arrayfire/lib64/libafcuda.so.3.6.2"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/opt/arrayfire/share/ArrayFire/cmake/ArrayFireCUDATargets.cmake"
but not all the files it references.
Call Stack (most recent call first):
/opt/arrayfire/share/ArrayFire/cmake/ArrayFireConfig.cmake:123 (include)
CMakeLists.txt:24 (find_package)
-- Configuring incomplete, errors occurred!
See also "/opt/home/firun/wav2letter/build/CMakeFiles/CMakeOutput.log".
See also "/opt/home/firun/wav2letter/build/CMakeFiles/CMakeError.log".
@firun "/opt/arrayfire/share/ArrayFire/cmake/ArrayFireCUDATargets.cmake:"
I guess there should not be ArrayFireCUDATargets.cmake there if you built ArrayFire with only CPU backend (specifically disable CUDA and OpenCL backend)
@jacobkahn Hi, I followed your instruction, but wav2letter seems always try to link to array CUDA stuff.
Here are the errors when I try to do cmake:
cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CPU -DArrayFire_DIR=/opt/arrayfire-no-gl/share/ArrayFire/cmake/ -DBUILD_TESTS=OFF
CMake Error at CMakeLists.txt:103 (add_library):
Target "wav2letter++" links to target "ArrayFire::afcuda" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at CMakeLists.txt:103 (add_library):
Target "wav2letter++" links to target "ArrayFire::afcuda" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at CMakeLists.txt:103 (add_library):
Target "wav2letter++" links to target "ArrayFire::afcuda" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at CMakeLists.txt:134 (add_executable):
Target "Train" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:134 (add_executable):
Target "Train" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:134 (add_executable):
Target "Train" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:145 (add_executable):
Target "Test" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:145 (add_executable):
Target "Test" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:145 (add_executable):
Target "Test" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:156 (add_executable):
Target "Decoder" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:156 (add_executable):
Target "Decoder" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at CMakeLists.txt:156 (add_executable):
Target "Decoder" links to target "ArrayFire::afcuda" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
@firun "/opt/arrayfire/share/ArrayFire/cmake/ArrayFireCUDATargets.cmake:"
I guess there should not be ArrayFireCUDATargets.cmake there if you built ArrayFire with only CPU backend (specifically disable CUDA and OpenCL backend)
My bad, I've installed ArrayFire using binaries via https://arrayfire.com/download/. Trying to build it manually now.
@firun @auvilink — if you haven't already tried, I'd make sure you rebuild flashlight as well with the CPU backend. ArrayFireCUDATargets.cmake shouldn't exist if you've only built ArrayFire with the CPU backend, and its existence might mean that ArrayFire may attempt to link to the CUDA backend even if the library isn't present.
I'll send a fix shortly which is more explicit about which ArrayFire backend is being linked, using the imported target instead of ${ArrayFire_LIBRARIES}, which is a legacy library path which may contain some arbitrary backend. Hopefully this will resolve the ambiguity there.
@auvilink @firun — turned out this was part of a much larger bug which was breaking a bunch of things. 8c3ba52d103697a767f16e478e5ddcced14d4115 has the fix; try rebuilding/installing flashlight from master, and building wav2letter++ from master — everything should work. Thanks again for reporting this!
@jacobkahn Thanks a lot for the fix. Now it builds fine.