Qengineering / Face-Recognition-Jetson-Nano

Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
108 stars 31 forks source link

Build error : glslang #5

Closed rsingh2083 closed 2 years ago

rsingh2083 commented 3 years ago
------------- Build: Release in FaceRecognition (compiler: GNU GCC Compiler)---------------

g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/main.cpp -o obj/Release/src/main.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TArcface.cpp -o obj/Release/src/TArcface.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TBlur.cpp -o obj/Release/src/TBlur.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TLive.cpp -o obj/Release/src/TLive.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TMtCNN.cpp -o obj/Release/src/TMtCNN.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TRetina.cpp -o obj/Release/src/TRetina.o
g++ -O3 -Wall -fexceptions -Wno-unknown-pragmas -O2 -I/usr/include/opencv4 -I/usr/local/include/ncnn -Iinclude -c /home/nsoc/Face-Recognition-Jetson-Nano/src/TWarp.cpp -o obj/Release/src/TWarp.o
g++ -L/usr/local/lib/ -L/usr/lib/ -o bin/Release/FaceRecognition obj/Release/src/main.o obj/Release/src/TArcface.o obj/Release/src/TBlur.o obj/Release/src/TLive.o obj/Release/src/TMtCNN.o obj/Release/src/TRetina.o obj/Release/src/TWarp.o  -fopenmp -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_alphamat -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cudabgsegm -lopencv_cudafeatures2d -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_sfm -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_cudacodec -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_cudaoptflow -lopencv_optflow -lopencv_cudalegacy -lopencv_videoio -lopencv_cudawarping -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev -ldl -lpthread -s  /usr/local/lib/ncnn/libncnn.a /usr/lib/aarch64-linux-gnu/libvulkan.so /usr/local/lib/ncnn/libglslang.a /usr/local/lib/ncnn/libOGLCompiler.a /usr/local/lib/ncnn/libOSDependent.a /usr/local/lib/ncnn/libSPIRV.a
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::destroy_gpu_instance()':
gpu.cpp:(.text+0x1008): undefined reference to `glslang::FinalizeProcess()'
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::create_gpu_instance()':
gpu.cpp:(.text+0x4128): undefined reference to `glslang::InitializeProcess()'
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::compile_spirv_module(char const*, int, ncnn::Option const&, std::vector<unsigned int, std::allocator<unsigned int> >&)':
gpu.cpp:(.text+0x7638): undefined reference to `glslang::TShader::TShader(EShLanguage)'
gpu.cpp:(.text+0x7650): undefined reference to `glslang::TShader::setStringsWithLengths(char const* const*, int const*, int)'
gpu.cpp:(.text+0x7668): undefined reference to `glslang::TShader::addProcesses(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
gpu.cpp:(.text+0x7674): undefined reference to `glslang::TShader::setEntryPoint(char const*)'
gpu.cpp:(.text+0x7680): undefined reference to `glslang::TShader::setSourceEntryPoint(char const*)'
gpu.cpp:(.text+0x7814): undefined reference to `glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)'
gpu.cpp:(.text+0x7858): undefined reference to `glslang::TShader::getInfoLog()'
Qengineering commented 3 years ago

Your build is missing some libraries (glslang). Please existent/check/modify the location of the libraries below

/usr/lib/aarch64-linux-gnu/libvulkan.so /usr/local/lib/ncnn/libglslang.a /usr/local/lib/ncnn/libOGLCompiler.a /usr/local/lib/ncnn/libOSDependent.a /usr/local/lib/ncnn/libSPIRV.a

rsingh2083 commented 3 years ago

I'll check and get back

rsingh2083 commented 3 years ago

Your build is missing some libraries (glslang). Please existent/check/modify the location of the libraries below

/usr/lib/aarch64-linux-gnu/libvulkan.so /usr/local/lib/ncnn/libglslang.a /usr/local/lib/ncnn/libOGLCompiler.a /usr/local/lib/ncnn/libOSDependent.a /usr/local/lib/ncnn/libSPIRV.a

Ive got all these 5 libraries at their exact location as mentioned by you. Still same error

rsingh2083 commented 3 years ago

Sir its still not working. Can you share you build command, ill try that also. Or let me know if thers anything else I should try

Qengineering commented 3 years ago

I'm sorry to hear it's still not working. I've just downloaded the example and load it in Code::Blocks. It works right away. Below a screen dump of the build

build

rsingh2083 commented 3 years ago

Sir pasting my entire build log. This application ran fine on JP4.2 , but on this another jetson Ive installed JP4.5 and overclocked it succesfully with opencv4, ncnn and caffe installed from your references. I even built and installed https://github.com/KhronosGroup/glslang (which I did not do for the previous Jetson nano).

Heres the entire build log :-


nsoc@nsoc-desktop:~/Face-Recognition-Jetson-Nano$ g++ -L/usr/local/lib/ -L/usr/lib/ -o bin/Release/FaceRecognition obj/Release/src/main.o obj/Release/src/TArcface.o obj/Release/src/TBlur.o obj/Release/src/TLive.o obj/Release/src/TMtCNN.o obj/Release/src/TRetina.o obj/Release/src/TWarp.o  -fopenmp -I/usr/local/include/glslang/glslang -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cudabgsegm -lopencv_cudafeatures2d -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_sfm -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_cudacodec -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_videostab -lopencv_cudaoptflow -lopencv_optflow -lopencv_cudalegacy -lopencv_video -lopencv_videoio -lopencv_cudawarping -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev -ldl -lpthread -s /usr/local/lib/ncnn/libglslang.a  /usr/local/lib/ncnn/libncnn.a /usr/lib/aarch64-linux-gnu/libvulkan.so /usr/local/lib/ncnn/libglslang.a /usr/local/lib/ncnn/libOGLCompiler.a /usr/local/lib/ncnn/libOSDependent.a /usr/local/lib/ncnn/libSPIRV.a /usr/local/lib/glslang/libglslang.a
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::destroy_gpu_instance()':
gpu.cpp:(.text+0x1008): undefined reference to `glslang::FinalizeProcess()'
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::create_gpu_instance()':
gpu.cpp:(.text+0x4128): undefined reference to `glslang::InitializeProcess()'
/usr/local/lib/ncnn/libncnn.a(gpu.cpp.o): In function `ncnn::compile_spirv_module(char const*, int, ncnn::Option const&, std::vector<unsigned int, std::allocator<unsigned int> >&)':
gpu.cpp:(.text+0x7638): undefined reference to `glslang::TShader::TShader(EShLanguage)'
gpu.cpp:(.text+0x7650): undefined reference to `glslang::TShader::setStringsWithLengths(char const* const*, int const*, int)'
gpu.cpp:(.text+0x7668): undefined reference to `glslang::TShader::addProcesses(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'
gpu.cpp:(.text+0x7674): undefined reference to `glslang::TShader::setEntryPoint(char const*)'
gpu.cpp:(.text+0x7680): undefined reference to `glslang::TShader::setSourceEntryPoint(char const*)'
gpu.cpp:(.text+0x7814): undefined reference to `glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&)'
gpu.cpp:(.text+0x7858): undefined reference to `glslang::TShader::getInfoLog()'
gpu.cpp:(.text+0x7878): undefined reference to `glslang::TShader::getInfoDebugLog()'
gpu.cpp:(.text+0x7894): undefined reference to `glslang::TShader::~TShader()'
gpu.cpp:(.text+0x8220): undefined reference to `glslang::TShader::~TShader()'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::convertGlslangStructToSpvType(glslang::TType const&, glslang::TVector<glslang::TTypeLoc> const*, glslang::TLayoutPacking, glslang::TQualifier const&)':
GlslangToSpv.cpp:(.text+0x92b4): undefined reference to `glslang::TIntermediate::computeTypeLocationSize(glslang::TType const&, EShLanguage)'
GlslangToSpv.cpp:(.text+0x97dc): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
GlslangToSpv.cpp:(.text+0x9818): undefined reference to `glslang::TIntermediate::improperStraddle(glslang::TType const&, int, int)'
GlslangToSpv.cpp:(.text+0x9a88): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::convertGlslangToSpvType(glslang::TType const&, glslang::TLayoutPacking, glslang::TQualifier const&, bool, bool)':
GlslangToSpv.cpp:(.text+0xad40): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
GlslangToSpv.cpp:(.text+0xb200): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::visitBinary(glslang::TVisit, glslang::TIntermBinary*)':
GlslangToSpv.cpp:(.text+0xbb68): undefined reference to `glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)'
GlslangToSpv.cpp:(.text+0xc328): undefined reference to `glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)'
GlslangToSpv.cpp:(.text+0xcda4): undefined reference to `glslang::TIntermediate::getBaseAlignmentScalar(glslang::TType const&, int&)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::convertGlslangToSpvType(glslang::TType const&, glslang::TLayoutPacking, glslang::TQualifier const&, bool, bool) [clone .constprop.1111]':
GlslangToSpv.cpp:(.text+0xec90): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
GlslangToSpv.cpp:(.text+0xf138): undefined reference to `glslang::TIntermediate::getMemberAlignment(glslang::TType const&, int&, int&, glslang::TLayoutPacking, bool)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::getSymbolId(glslang::TIntermSymbol const*)':
GlslangToSpv.cpp:(.text+0x16c88): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text+0x17f98): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `(anonymous namespace)::TGlslangToSpvTraverser::visitAggregate(glslang::TVisit, glslang::TIntermAggregate*)':
GlslangToSpv.cpp:(.text+0x1ce24): undefined reference to `glslang::TIntermediate::findLinkerObjects() const'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `glslang::GlslangToSpv(glslang::TIntermediate const&, std::vector<unsigned int, std::allocator<unsigned int> >&, spv::SpvBuildLogger*, glslang::SpvOptions*)':
GlslangToSpv.cpp:(.text+0x1e504): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text+0x1e508): undefined reference to `glslang::TPoolAllocator::push()'
GlslangToSpv.cpp:(.text+0x1e540): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text+0x1e568): undefined reference to `glslang::GetKhronosToolId()'
GlslangToSpv.cpp:(.text+0x1ec38): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text+0x1ec3c): undefined reference to `glslang::TPoolAllocator::pop()'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `glslang::TType::setFieldName(std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char> > const&)':
GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE]+0x1c): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE]+0x24): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE]+0x2c): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text._ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE[_ZN7glslang5TType12setFieldNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcENS_14pool_allocatorIcEEEE]+0xa4): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `void std::vector<glslang::TArraySize, glslang::pool_allocator<glslang::TArraySize> >::_M_range_insert<__gnu_cxx::__normal_iterator<glslang::TArraySize*, std::vector<glslang::TArraySize, glslang::pool_allocator<glslang::TArraySize> > > >(__gnu_cxx::__normal_iterator<glslang::TArraySize*, std::vector<glslang::TArraySize, glslang::pool_allocator<glslang::TArraySize> > >, __gnu_cxx::__normal_iterator<glslang::TArraySize*, std::vector<glslang::TArraySize, glslang::pool_allocator<glslang::TArraySize> > >, __gnu_cxx::__normal_iterator<glslang::TArraySize*, std::vector<glslang::TArraySize, glslang::pool_allocator<glslang::TArraySize> > >, std::forward_iterator_tag)':
GlslangToSpv.cpp:(.text._ZNSt6vectorIN7glslang10TArraySizeENS0_14pool_allocatorIS1_EEE15_M_range_insertIN9__gnu_cxx17__normal_iteratorIPS1_S4_EEEEvS9_T_SA_St20forward_iterator_tag[_ZNSt6vectorIN7glslang10TArraySizeENS0_14pool_allocatorIS1_EEE15_M_range_insertIN9__gnu_cxx17__normal_iteratorIPS1_S4_EEEEvS9_T_SA_St20forward_iterator_tag]+0xf4): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
/usr/local/lib/ncnn/libSPIRV.a(GlslangToSpv.cpp.o): In function `glslang::TType::TType(glslang::TType const&, int, bool)':
GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC5ERKS0_ib]+0x2e4): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC5ERKS0_ib]+0x2ec): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC5ERKS0_ib]+0x334): undefined reference to `glslang::GetThreadPoolAllocator()'
GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC5ERKS0_ib]+0x33c): undefined reference to `glslang::TPoolAllocator::allocate(unsigned long)'
GlslangToSpv.cpp:(.text._ZN7glslang5TTypeC2ERKS0_ib[_ZN7glslang5TTypeC5ERKS0_ib]+0x344): undefined reference to `glslang::GetThreadPoolAllocator()'
collect2: error: ld returned 1 exit status
huanghsuanfu commented 3 years ago

I got the same problem. Have you solved it ? Thanks.

Qengineering commented 3 years ago

@huanghsuanfu

Which setting are you using? JetPack, nccn, virtual environment(?), OpenCV, other things you might think off. My problem here is that I can't reproduce the error. The app is running just fine. Recently I've flashed a new SD with JP 4.5 and installed everything fresh from scratch, and no problem at all.

huanghsuanfu commented 3 years ago

I think the problem is NCNN's version. I use the version with tag is 20201218 and it could work now.

Qengineering commented 3 years ago

Oh, great news! @rsingh2083 Did you read @huanghsuanfu lost post?

Qengineering commented 2 years ago

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.