New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile "hal_internal.cpp" #11277

Open
Albert65 opened this Issue Apr 9, 2018 · 2 comments

Comments

2 participants
@Albert65
Copy link

Albert65 commented Apr 9, 2018

System information (version)
  • OpenCV => 3.4.1
  • Operating System / Platform => CentOs & Redhat 7.4 64 Bit
  • Compiler => g++ 5.5
  • Compilation by Linuxbrew with all default settings
Detailed description

Compilation fails when reaches "hal_internal.cpp".
Note, two "complex" header files are included in "hal_internal.cpp":
"complex.h" and "complex"

/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp: In instantiation of 'int lapack_gemm_c(const fptype*, size_t, const fptype*, size_t, fptype, const fptype*, size_t, fptype, fptype*, size_t, int, int, int, int) [with fptype = float; size_t = long unsigned int]':
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:592:119:   required from here
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:440:9: warning: unused variable 'ldsrc3' [-Wunused-variable]
     int ldsrc3 = (int)(src3_step / sizeof(std::complex<fptype>));
         ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:435:98: warning: unused parameter 'alpha' [-Wunused-parameter]
 lapack_gemm_c(const fptype *src1, size_t src1_step, const fptype *src2, size_t src2_step, fptype alpha,
                                                                                                  ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp: In instantiation of 'int lapack_gemm_c(const fptype*, size_t, const fptype*, size_t, fptype, const fptype*, size_t, fptype, fptype*, size_t, int, int, int, int) [with fptype = double; size_t = long unsigned int]':
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:599:119:   required from here
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:440:9: warning: unused variable 'ldsrc3' [-Wunused-variable]
     int ldsrc3 = (int)(src3_step / sizeof(std::complex<fptype>));
         ^
             copy_matrix((std::complex<fptype>*)src3, ldsrc3, (std::complex<fptype>*)dst, lddst, c_m, c_n);
                               ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:497:31: **error**: expected ')' before '_Complex'
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:502:25: **error**: expected unqualified-id before '_Complex'
         set_value((std::complex<fptype>*)dst, lddst, std::complex<fptype>(0.0, 0.0), d_m, d_n);
                         ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:502:25: **error**: expected ')' before '_Complex'
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:505:106: **error**: 'cAlpha' was not declared in this scope
         cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
                                                                                                          ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:505:198: **error**: 'cBeta' was not declared in this scope
         cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
                                                                                                                                                                                                      ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:507:107: **error**: 'cAlpha' was not declared in this scope
         cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
                                                                                                           ^
/tmp/opencv-20180409-18036-14evg85/opencv-3.4.1/modules/core/src/hal_internal.cpp:507:202: **error**: 'cBeta' was not declared in this scope
         cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
                                                                                                                                                                                                          ^
[ 38%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/kmeans.cpp.o
@alalek

This comment has been minimized.

Copy link
Contributor

alalek commented Apr 11, 2018

Try to disable LAPACK via CMake flags.

Related #10668 #10677

@Albert65

This comment has been minimized.

Copy link

Albert65 commented Dec 13, 2018

The same issue once again, on the same machine. Month ago I was able to install OpenCV. With new update I got this (no Lapack at all):

brew install opencv
==> Downloading https://github.com/opencv/opencv/archive/3.4.3.tar.gz
Already downloaded: /home/user/.cache/Homebrew/downloads/26fc339c928a905894eeb52b69bdce8cddcacddcaec2e08fb595f22cb78893db--opencv-3.4.3.tar.gz
==> Downloading https://github.com/opencv/opencv_contrib/archive/3.4.3.tar.gz
Already downloaded: /home/user/.cache/Homebrew/downloads/4365e7f92f151ea9c1c35380fb34c3fb6fc08930f2352f5545fb7b6dde56eb9e--opencv_contrib-3.4.3.tar.gz
==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/linuxbrew/.linuxbrew/Cellar/opencv/3.4.3_1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DC
==> make
Last 15 lines from /home/user/.cache/Homebrew/Logs/opencv/02.make:
/tmp/opencv-20181213-11246-1bhisiz/opencv-3.4.3/modules/core/src/hal_internal.cpp:505:198: error: 'cBeta' was not declared in this scope
cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
^
/tmp/opencv-20181213-11246-1bhisiz/opencv-3.4.3/modules/core/src/hal_internal.cpp:507:107: error: 'cAlpha' was not declared in this scope
cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
^
/tmp/opencv-20181213-11246-1bhisiz/opencv-3.4.3/modules/core/src/hal_internal.cpp:507:202: error: 'cBeta' was not declared in this scope
cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
^
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/hal_internal.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory /tmp/opencv-20181213-11246-1bhisiz/opencv-3.4.3/build' make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make[1]: Leaving directory /tmp/opencv-20181213-11246-1bhisiz/opencv-3.4.3/build'
make: *** [all] Error 2

READ THIS: https://github.com/Linuxbrew/brew/wiki/troubleshooting
Please do not report this issue to Homebrew/brew or Homebrew/core,
which support macOS only."

These open issues may also help:
opencv@2: Build a bottle for Linuxbrew Linuxbrew/homebrew-core#10625
opencv: Build a bottle for Linuxbrew Linuxbrew/homebrew-core#10624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment