usnistgov / NFIQ2

Optical live-scan and ink fingerprint image quality assessment tool
https://www.nist.gov/services-resources/software/development-nfiq-20
Other
130 stars 57 forks source link

Failing to build on LINUX. #376

Closed indianscorpion closed 12 months ago

indianscorpion commented 12 months ago

When following the steps below: git clone --recursive https://github.com/usnistgov/NFIQ2.git cd NFIQ2 mkdir build cd build cmake .. -DBUILD_NFIQ2_CLI=OFF cmake --build .

It gave error of below: /usr/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status gmake[2]: [fingerjetfxose/FingerJetFXOSE/libFRFXLL/src/libFRFXLL.so] Error 1 gmake[1]: [fingerjetfxose/FingerJetFXOSE/libFRFXLL/src/CMakeFiles/FRFXLL.dir/all] Error 2 gmake: *** [all] Error 2

The LINUX does have stdc++!

indianscorpion commented 12 months ago

when doing cmake .. -DBUILD_NFIQ2_CLI=OFF It gave warning of the below: CMake Warning at cmake/compiler.cmake:43 (message): You are missing one or more static system libraries that will be linked by -static-libgcc -static-libstdc++ Call Stack (most recent call first): CMakeLists.txt:49 (include)

gfiumara commented 12 months ago

apt install libstdc++-9-dev

indianscorpion commented 12 months ago

the system already had libstdc++ installed. strings /lib64/libstdc++.so.6 | grep LIBCXX GLIBCXX_3.4.19

gfiumara commented 12 months ago

Due to the flags the error message depicts, you need the static library, not the shared library. NFIQ 2 is linked entirely static.

indianscorpion commented 12 months ago

do u mean it should be a .a file? and only dev install contains .a file?

indianscorpion commented 12 months ago

I installed rpm -i devtoolset-9-runtime-9.0-3.el7.x86_64.rpm and rpm -i devtoolset-9-libstdc++-devel-9.3.1-2.2.el7.x86_64.rpm run cmake .. -DBUILD_NFIQ2_CLI=OFF, it complained the same. the static libraries were installed as:

/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++.a /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++_nonshared.a /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++fs.a

indianscorpion commented 12 months ago

make FRFXLL_static succeeded

[100%] Linking CXX static library libFRFXLL_static.a [100%] Built target FRFXLL_static but #make FRFXLL failed, looked like that it was not related to static library. [ 9%] Linking CXX shared library libFRFXLL.so /usr/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status make[3]: [fingerjetfxose/FingerJetFXOSE/libFRFXLL/src/libFRFXLL.so] Error 1 make[2]: [fingerjetfxose/FingerJetFXOSE/libFRFXLL/src/CMakeFiles/FRFXLL.dir/all] Error 2 make[1]: [fingerjetfxose/FingerJetFXOSE/libFRFXLL/src/CMakeFiles/FRFXLL.dir/rule] Error 2 make: [FRFXLL] Error 2

indianscorpion commented 12 months ago

it successfully built on GNU 11.4.0 at wsl latest ubuntu. It just failed on my old build machine with g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)