opencv: libopencv_core.so.3.2.0: undefined reference to `dpotrf_'

I’m installing opencv 3.2 and when I use 👍 cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON …

and

make -j4 , this error is showing , how can be solved ?

[ 75%] Linking CXX executable …/…/bin/opengl-example-opengl_interop …/…/lib/libopencv_core.so.3.2.0: undefined reference to dpotrf_' ../../lib/libopencv_core.so.3.2.0: undefined reference to dgesv_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to sgels_' ../../lib/libopencv_core.so.3.2.0: undefined reference to sgesv_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to sposv_' ../../lib/libopencv_core.so.3.2.0: undefined reference to dgetrf_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to sgetrf_' ../../lib/libopencv_core.so.3.2.0: undefined reference to dgels_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to dgeqrf_' ../../lib/libopencv_core.so.3.2.0: undefined reference to spotrf_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to sgeqrf_' ../../lib/libopencv_core.so.3.2.0: undefined reference to sgesdd_’ …/…/lib/libopencv_core.so.3.2.0: undefined reference to dgesdd_' ../../lib/libopencv_core.so.3.2.0: undefined reference to dposv_’ collect2: error: ld returned 1 exit status make[2]: *** [bin/opencv_version] Error 1 make[1]: *** [apps/version/CMakeFiles/opencv_version.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs… [ 75%] Built target opencv_annotation [ 75%] Built target opencv_visualisation [ 75%] Built target example_opengl_opengl_interop

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (7 by maintainers)

Most upvoted comments

Encountered the same error running Ubuntu 14.04 x64 with CUDA. Adding the flag -D WITH_LAPACK=OFF to the cmake command as suggested resolved this issue for me.

Thanks , the issue is resolved with WITH_LAPACK=OFF

@yuanxy92 Could you post make VERBOSE=1 log with failed command line? (build log above is successful, but it uses -lopenblas)

@afunTW that does not solve this problem. That is for a different error as shown in the link you provided.

As @FlorianFranzen has suggested, you may want to cherry pick pull request #7999, however if you have downloaded the 3.2.0 release as opposed to cloning the repo (or if you’d just prefer not to mess around with cherry picking), you can apply it via a patch as follows:

cd opencv-3.2.0
wget https://patch-diff.githubusercontent.com/raw/opencv/opencv/pull/7999.patch
patch -p1 <7999.patch

and rebuild. Works for me, I’m on ubuntu 14.04.

The alternative, as some have suggested, is to not build with lapack by adding -DWITH_LAPACK=OFF to your cmake command line. Of course in that case, your opencv build will not be using lapack.

Could someone check fix #7999 please?