Ask Your Question

Revision history [back]

can't find libpthread_nonshared.a

I am trying to build opencv from source and I inserted cmake instructions, then when I enter make command, it reaches 11% and then shows the following error

/usr/bin/ld: cannot find /usr/lib/libpthread_nonshared.a collect2: error: ld returned 1 exit status make[2]: * [modules/core/CMakeFiles/opencv_core.dir/build.make:1435: lib/libopencv_core.so.3.4.4] Error 1 make[1]: [CMakeFiles/Makefile2:2342: modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: ** [Makefile:163: all] Error 2 (base) [hassanalsamahi@D-Link build]$

please any help how to solve this problem?

can't find libpthread_nonshared.a

I am trying to build opencv from source and I inserted cmake instructions, then when I enter make command, it reaches 11% and then shows the following error

/usr/bin/ld: cannot find /usr/lib/libpthread_nonshared.a collect2: error: ld returned 1 exit status make[2]: * [modules/core/CMakeFiles/opencv_core.dir/build.make:1435: lib/libopencv_core.so.3.4.4] Error 1 make[1]: [CMakeFiles/Makefile2:2342: modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: ** [Makefile:163: all] Error 2 (base) [hassanalsamahi@D-Link build]$

Cmake instructions:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_TESTS=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D BUILD_EXAMPLES=ON ..

cmake output:

-- Looking for ccache - not found -- Found ZLIB: /lib64/libz.so (found suitable version "1.2.11", minimum required is "1.2.3") -- Found ZLIB: /lib64/libz.so (found version "1.2.11") -- Found OpenEXR: /lib64/libIlmImf.so -- Looking for linux/videodev.h -- Looking for linux/videodev.h - found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- Package 'libavresample', required by 'virtual:world', not found -- found Intel IPP (ICV version): 2019.0.0 [2019.0.0 Gold] -- at: /home/hassanalsamahi/opencv/build/3rdparty/ippicv/ippicv_lnx/icv -- found Intel IPP Integration Wrappers sources: 2019.0.0 -- at: /home/hassanalsamahi/opencv/build/3rdparty/ippicv/ippicv_lnx/iw -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off -- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR Atlas_BLAS_LIBRARY) -- Could NOT find BLAS (missing: BLAS_LIBRARIES) -- LAPACK requires BLAS -- A library with LAPACK API not found. Please specify library location. -- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- Could NOT find Flake8 (missing: FLAKE8_EXECUTABLE) -- Found VTK 8.2.0 (/usr/lib/cmake/vtk-8.2/UseVTK.cmake) -- OpenCV Python: during development append to PYTHONPATH: /home/hassanalsamahi/opencv/build/python_loader -- Caffe: NO -- Protobuf: NO -- Glog: NO -- freetype2: YES -- harfbuzz: YES -- HDF5: Using hdf5 compiler wrapper to determine C configuration -- Module opencv_ovis disabled because OGRE3D was not found -- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. -- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake. -- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components. -- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h -- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h -- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags -- HDF5: Using hdf5 compiler wrapper to determine C configuration -- freetype2: YES -- harfbuzz: YES -- Tesseract: YES -- OpenCL samples are skipped: OpenCL SDK is required -- Pylint: registered 162 targets. Build 'check_pylint' target to run checks ("cmake --build . --target

check_pylint" or "make check_pylint")

-- General configuration for OpenCV 3.4.4 =====================================

-- Version control: unknown

-- Extra modules: -- Location (extra): /home/hassanalsamahi/opencv_contrib/modules

-- Version control (extra): unknown

-- Platform: -- Timestamp: 2019-08-08T11:08:24Z -- Host: Linux 5.2.6-arch1-1-ARCH x86_64 -- CMake: 3.15.1 -- CMake generator: Unix Makefiles -- CMake build tool: /usr/bin/make

-- Configuration: RELEASE

-- CPU/HW features: -- Baseline: SSE SSE2 SSE3 -- requested: SSE3 -- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX -- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX -- SSE4_1 (4 files): + SSSE3 SSE4_1 -- SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 -- FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX -- AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX -- AVX2 (10 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 -- AVX512_SKX (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3

AVX AVX2 AVX_512F AVX512_SKX

-- C/C++: -- Built as dynamic libs?: YES -- C++11: YES -- C++ Compiler: /usr/bin/c++ (ver 9.1.0) -- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG -- C Compiler: /home/hassanalsamahi/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -- C flags (Release): -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG -- C flags (Debug): -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG -- Linker flags (Release): -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections
-- Linker flags (Debug): -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections
-- ccache: NO -- Precompiled headers: YES -- Extra dependencies: dl m pthread rt

-- 3rdparty dependencies:

-- OpenCV modules: -- To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot python_bindings_generator reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto -- Disabled: world -- Disabled by dependency: - -- Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv java js matlab ovis python2 python3 sfm -- Applications: perf_tests examples apps -- Documentation: NO

-- Non-free algorithms: NO

-- GUI: -- GTK+: YES (ver 3.24.10) -- GThread : YES (ver 2.60.6) -- GtkGlExt: NO

-- VTK support: YES (ver 8.2.0)

-- Media I/O: -- ZLib: /lib64/libz.so (ver 1.2.11) -- JPEG: /lib64/libjpeg.so (ver 80) -- WEBP: /lib64/libwebp.so (ver encoder: 0x020e) -- PNG: /lib64/libpng.so (ver 1.6.37) -- TIFF: /lib64/libtiff.so (ver 42 / 4.0.10) -- JPEG 2000: /lib64/libjasper.so (ver 2.0.16) -- OpenEXR: /lib64/libImath.so /lib64/libIlmImf.so /lib64/libIex.so /lib64/libHalf.so /lib64/libIlmThread.so (ver 2.3.0) -- HDR: YES -- SUNRASTER: YES

-- PXM: YES

-- Video I/O: -- DC1394: YES (ver 2.2.6) -- FFMPEG: YES -- avcodec: YES (ver 58.54.100) -- avformat: YES (ver 58.29.100) -- avutil: YES (ver 56.31.100) -- swscale: YES (ver 5.5.100) -- avresample: NO -- GStreamer:
-- base: YES (ver 1.16.0) -- video: YES (ver 1.16.0) -- app: YES (ver 1.16.0) -- riff: YES (ver 1.16.0) -- pbutils: YES (ver 1.16.0) -- libv4l/libv4l2: NO

-- v4l/v4l2: linux/videodev.h linux/videodev2.h

-- Parallel framework: pthreads

-- Trace: YES (with Intel ITT)

-- Other third-party libraries: -- Intel IPP: 2019.0.0 Gold [2019.0.0] -- at: /home/hassanalsamahi/opencv/build/3rdparty/ippicv/ippicv_lnx/icv -- Intel IPP IW: sources (2019.0.0) -- at: /home/hassanalsamahi/opencv/build/3rdparty/ippicv/ippicv_lnx/iw -- Lapack: NO -- Eigen: NO -- Custom HAL: NO

-- Protobuf: build (3.5.1)

-- OpenCL: YES (no extra features) -- Include path: /home/hassanalsamahi/opencv/3rdparty/include/opencl/1.2

-- Link libraries: Dynamic load

-- Python (for build): /usr/bin/python2.7 -- Pylint: /home/hassanalsamahi/anaconda3/bin/pylint

(ver: 3.7.3, checks: 162)

-- Java:
-- ant: NO -- JNI: NO -- Java wrappers: NO

-- Java tests: NO

-- Install to: /usr/local

-- -----------------------------------------------------------------

-- Configuring done CMake Warning at /home/hassanalsamahi/opencv/cmake/OpenCVUtils.cmake:1336 (add_library): Cannot generate a safe linker search path for target opencv_hdf because files in some directories may conflict with libraries in implicit directories:

link library [librt.so] in /lib64 may be hidden by files in:
  /home/hassanalsamahi/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib
link library [libpthread.so] in /lib64 may be hidden by files in:
  /home/hassanalsamahi/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib
link library [libdl.so] in /lib64 may be hidden by files in:
  /home/hassanalsamahi/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib
link library [libm.so] in /lib64 may be hidden by files in:
  /home/hassanalsamahi/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib

Some of these libraries may not be found correctly. Call Stack (most recent call first):
/home/hassanalsamahi/opencv/cmake/OpenCVModule.cmake:924 (ocv_add_library)
/home/hassanalsamahi/opencv/cmake/OpenCVModule.cmake:849 (_ocv_create_module)
/home/hassanalsamahi/opencv/cmake/OpenCVModule.cmake:1060 (ocv_create_module)
/home/hassanalsamahi/opencv_contrib/modules/hdf/CMakeLists.txt:33 (ocv_define_module)

-- Generating done -- Build files have been written to: /home/hassanalsamahi/opencv/build

please any help how to solve this problem?