OPENCLAMDBLAS and OPENCLAMDFFT with AMD OpenCL on Linux and g++ (Bug #2751)


Added by Franck Charpentier about 12 years ago. Updated almost 12 years ago.


Status:Cancelled Start date:2013-02-02
Priority:Normal Due date:
Assignee:yao wang % Done:

0%

Category:build/install
Target version:-
Affected version:branch '2.4' Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hello,

the compilation with this cmake option:

cmake -D WITH_OPENCL:bool=ON -D WITH_QT:bool=ON -D WITH_OPENGL:bool=ON -D WITH_OPENCLAMDFFT:bool=ON -D WITH_OPENCLAMDBLAS:bool=ON -D WITH_TBB:bool=ON [...]

fall into error.
Including:

matrix_operations.hpp: In member function ‘void cv::ocl::oclMat::assignTo(cv::ocl::oclMat&, int) const’:
OpenCV-2.4.3/modules/ocl/include/opencv2/ocl/matrix_operations.hpp:299:61: attention : declaration of ‘type’ shadows a member of 'this' [-Wshadow]
OpenCV-2.4.3/modules/ocl/include/opencv2/ocl/matrix_operations.hpp: In member function ‘cv::ocl::oclMat cv::ocl::oclMat::operator()(cv::Range, cv::Range) const’:
OpenCV-2.4.3/modules/ocl/include/opencv2/ocl/matrix_operations.hpp:373:76: attention : declaration of ‘colRange’ shadows a member of 'this' [-Wshadow]
OpenCV-2.4.3/modules/ocl/include/opencv2/ocl/matrix_operations.hpp:373:76: attention : declaration of ‘rowRange’ shadows a member of 'this' [-Wshadow]
OpenCV-2.4.3/modules/ocl/src/fft.cpp: At global scope:
/home/franck/DataCenter/projets/OpenCV/OpenCV-2.4.3/modules/ocl/src/fft.cpp:104:25: erreur: ‘void cv::ocl::fft_setup()’ should have been declared inside ‘cv::ocl’
OpenCV-2.4.3/modules/ocl/src/fft.cpp:114:28: erreur: ‘void cv::ocl::fft_teardown()’ should have been declared inside ‘cv::ocl’
OpenCV-2.4.3/modules/ocl/src/fft.cpp: In function ‘void cv::ocl::fft_teardown()’:
OpenCV-2.4.3/modules/ocl/src/fft.cpp:121:48: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]
OpenCV-2.4.3/modules/ocl/src/fft.cpp: In constructor ‘cv::ocl::FftPlan::FftPlan(cv::Size, int, int, int, cv::ocl::FftType)’:
OpenCV-2.4.3/modules/ocl/src/fft.cpp:153:12: attention : unused variable ‘clLengthsOut’ [-Wunused-variable]
OpenCV-2.4.3/modules/ocl/src/fft.cpp: In destructor ‘cv::ocl::FftPlan::~FftPlan()’:
OpenCV-2.4.3/modules/ocl/src/fft.cpp:205:39: attention : comparaison entre des expressions entières signée et non signée [-Wsign-compare]

An another example of error:
in precomp.hpp line 49:

if _MSC_VER >= 1200
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif

On g++ for linux, _MSC_VER is not defined and a there are warning, lot of warning...
OPENCLAMDBLAS and OPENCLAMDFFT seems to have been implementer for Visual C + + and windows but not for linux.


Associated revisions

Revision a049c16c
Added by Alexander Alekhin almost 11 years ago

Merge pull request #2751 from akarsakov:ocl_thresh_opt

History

Updated by Andrey Kamaev about 12 years ago

  • Target version deleted (2.4.4)
  • Assignee changed from Andrey Kamaev to yao wang

Updated by Kirill Kornyakov about 12 years ago

  • Description changed from Hello, the compilation with this cmake option: cmake -D WITH_OPENCL:bool... to Hello, the compilation with this cmake option: <pre> cmake -D WIT... More

Updated by Franck Charpentier about 12 years ago

with the new version 2.4.4a there is no more error or warning on compiling but now is on the linking:

[ 75%] Building CXX object modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_arithm.cpp.o
[ 75%] Building CXX object modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/precomp.cpp.o
[ 75%] Building CXX object modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_haar.cpp.o
[ 75%] Building CXX object modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_pyrdown.cpp.o
[ 75%] Building CXX object modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_columnsum.cpp.o
Linking CXX executable ../../bin/opencv_perf_ocl
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasSgemmEx »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetResultLocation »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetPlanInStride »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasZgemmEx »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasDgemmEx »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftEnqueueTransform »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftBakePlan »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftCreateDefaultPlan »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetPlanScale »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetPlanBatchSize »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftGetTmpBufSize »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasCgemmEx »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftTeardown »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasTeardown »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetPlanOutStride »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdBlasSetup »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetPlanDistance »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftDestroyPlan »
../../lib/libopencv_ocl.so.2.4.4: référence indéfinie vers « clAmdFftSetLayout »
collect2: erreur: ld a retourné 1 code d'état d'exécution
make[2]: *** [bin/opencv_perf_ocl] Erreur 1

there is no linking with the libs clAmdBlas or clAmdFft.<br>
in opencv-2.4.4/Release/modules/ocl/CMakeFiles/opencv_perf_ocl.dir/link.txt
-o ../../bin/opencv_perf_ocl -rdynamic ../../lib/libopencv_core.so.2.4.4 ../../lib/libopencv_imgproc.so.2.4.4 ../../lib/libopencv_flann.so.2.4.4 ../../lib/libopencv_highgui.so.2.4.4 ../../lib/libopencv_features2d.so.2.4.4 ../../lib/libopencv_objdetect.so.2.4.4 ../../lib/libopencv_video.so.2.4.4 ../../lib/libopencv_ocl.so.2.4.4 ../../lib/libopencv_ts.so.2.4.4 ../../lib/libopencv_highgui.so.2.4.4 ../../lib/libopencv_core.so.2.4.4 ../../lib/libopencv_imgproc.so.2.4.4 ../../lib/libopencv_flann.so.2.4.4 ../../lib/libopencv_highgui.so.2.4.4 ../../lib/libopencv_features2d.so.2.4.4 -ldl -lm -
lpthread -lrt ../../lib/libopencv_objdetect.so.2.4.4 ../../lib/libopencv_video.so.2.4.4 /opt/AMDAPP/lib/x86_64/libOpenCL.so ../../lib/libopencv_flann.so.2.4.4 ../../lib/libopencv_highgui.so.2.4.4 ../../lib/libopencv_imgproc.so.2.4.4 ../../lib/libopencv_core.so.2.4.4 -lz -ldl -lm -lpthread -lrt -Wl,-rpath,/home/franck/DataCenter/projets/OpenCV/opencv-2.4.4/Release/lib:/opt/AMDAPP/lib/x86_64 

there is libs for OpenCL (/opt/AMDAPP/lib/x86_64) but not clAmdBlas or clAmdFft.<br>
in opencv-2.4.4/modules/ocl/CMakeLists.txt :
if (HAVE_OPENCL)
  set(ocl_link_libs ${OPENCL_LIBRARIES})
  if(OPENCL_INCLUDE_DIR)
    ocv_include_directories(${OPENCL_INCLUDE_DIR})
  endif()
  if (HAVE_CLAMDFFT)
    set(ocl_link_libs ${ocl_link_libs} ${CLAMDFFT_LIBRARIES})
    ocv_include_directories(${CLAMDFFT_INCLUDE_DIR})
  endif()
  if (HAVE_CLAMDBLAS)
    set(ocl_link_libs ${ocl_link_libs} ${CLAMDBLAS_LIBRARIES})
    ocv_include_directories(${CLAMDBLAS_INCLUDE_DIR})
  endif()
endif()

ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)

I do not understand where does the problem. I checked and rechecked my variables did many tests, but it's still the same problem.
I tested with notably:
 cmake -D  BUILD_EXAMPLES:bool=ON -D WITH_OPENCL:bool=ON -D WITH_OPENCLAMDFFT:bool=ON -D WITH_OPENCLAMDBLAS:bool=ON -D WITH_QT:bool=ON -D WITH_OPENGL:bool=ON -D CLAMDBLAS_INCLUDE_DIR:filepath=/opt/clAmdBlas-1.8.291/include -D CLAMDBLAS_LIBRARIES:filepath=/opt/clAmdBlas-1.8.291/lib64/libclAmdBlas.so -D CLAMDFFT_INCLUDE_DIR:filepath=/opt/clAmdFft-1.8.291/include -D CLAMDFFT_LIBRARIES:filepath=/opt/clAmdFft-1.8.291/lib64/libclAmdFft.Runtime.so  -D CMAKE_BUILD_TYPE:STRING=RELEASE ..

and the files /opt/clAmdBlas-1.8.291/lib64/libclAmdBlas.so and /opt/clAmdFft-1.8.291/lib64/libclAmdFft.Runtime.so exist.

Thank you all for your work: It's not easy.

Updated by Franck Charpentier almost 12 years ago

this is no longer. Corrected or removed in the latest version ( 2.4.5 )

Updated by Anna Kogan almost 12 years ago

  • Status changed from Open to Cancelled

Also available in: Atom PDF