Reference:
http://stackoverflow.com/questions/7542808/what-is-needed-to-compile-opencl-on-ubuntu-and-by-extension-opencl-periodFirst of all, CUDA library did not provide the needed cl.hpp or (maybe cl2.hpp) file. So, need to download them from
https://www.khronos.org/registry/cl/I picked the OpenCL 1.2 cl.hpp file
and put them into /garlic/apps/cuda7.0/include/CL and set
C_INCLUDE_PATH
and CPLUS_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=-I/garlic/apps/cuda7.0/include
export C_INCLUDE_PATH=-I/garlic/apps/cuda7.0/include
export CC=gcc-4.9.3
export CXX=g++-4.9.3
export CFLAGS='-I/garlic/apps/cuda7.0/include -L/garlic/apps/cuda7.0/lib64 -lOpenCL -Wl,-rpath -Wl,LIBDIR'
export CXXFLAGS=
'-I/garlic/apps/cuda7.0/include -L/garlic/apps/cuda7.0/lib64 -lOpenCL -Wl,-rpath -Wl,LIBDIR'
./configure --prefix=/garlic/apps/BUDE-1.2.1-CUDA_CL --enable-opencl
make
sudo make install
Ran into errors:
../../../src/bude/ocl/oclPrintError.cpp: In function ‘void oclPrintError(cl_int)’:
../../../src/bude/ocl/oclPrintError.cpp:104:8: error: ‘CL_COMPILE_PROGRAM_FAILURE’ was not declared in this scope
case CL_COMPILE_PROGRAM_FAILURE:
^
../../../src/bude/ocl/oclPrintError.cpp:111:8: error: ‘CL_LINKER_NOT_AVAILABLE’ was not declared in this scope
case CL_LINKER_NOT_AVAILABLE:
^
../../../src/bude/ocl/oclPrintError.cpp:115:8: error: ‘CL_LINK_PROGRAM_FAILURE’ was not declared in this scope
case CL_LINK_PROGRAM_FAILURE:
^
../../../src/bude/ocl/oclPrintError.cpp:120:8: error: ‘CL_DEVICE_PARTITION_FAILED’ was not declared in this scope
case CL_DEVICE_PARTITION_FAILED:
^
../../../src/bude/ocl/oclPrintError.cpp:125:8: error: ‘CL_KERNEL_ARG_INFO_NOT_AVAILABLE’ was not declared in this scope
case CL_KERNEL_ARG_INFO_NOT_AVAILABLE:
^
../../../src/bude/ocl/oclPrintError.cpp:315:8: error: ‘CL_INVALID_IMAGE_DESCRIPTOR’ was not declared in this scope
case CL_INVALID_IMAGE_DESCRIPTOR:
^
../../../src/bude/ocl/oclPrintError.cpp:320:8: error: ‘CL_INVALID_COMPILER_OPTIONS’ was not declared in this scope
case CL_INVALID_COMPILER_OPTIONS:
^
../../../src/bude/ocl/oclPrintError.cpp:325:8: error: ‘CL_INVALID_LINKER_OPTIONS’ was not declared in this scope
case CL_INVALID_LINKER_OPTIONS:
^
../../../src/bude/ocl/oclPrintError.cpp:329:8: error: ‘CL_INVALID_DEVICE_PARTITION_COUNT’ was not declared in this scope
case CL_INVALID_DEVICE_PARTITION_COUNT:
^
make[3]: *** [ocl/oclPrintError.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/garlic/apps/Downloads/BUDE-1.2.1/build_ocl/src/bude'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/garlic/apps/Downloads/BUDE-1.2.1/build_ocl/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/garlic/apps/Downloads/BUDE-1.2.1/build_ocl'
make: *** [all] Error 2
Fatal error with compile_bude
=============================================
I managed to get the source code compiled with CUDA by commenting
out those undeclared cases
in ocl/oclPrintError.cpp that makes reference to those Macros. There were a couple of errors due to a typo
in the header file path in main cpp files in sequence and bild folders
#include "../../lib/constants/errorNumbers.hpp"
should be
#include "../../../lib/constants/errorNumbers.hpp"
=========================================================
Alternatively, install Intel's OpenCL SDK: intel_sdk_for_ocl_applications_xe_2013_r2_sdk_3.1.1.11385_x64.tgz
Inside it has these rpms
opencl-1.2-base-3.1.1.11385-1.x86_64.rpm
opencl-1.2-intel-cpu-3.1.1.11385-1.x86_64.rpm
opencl-1.2-devel-3.1.1.11385-1.x86_64.rpm
opencl-1.2-intel-devel-3.1.1.11385-1.x86_64.rpm
That is all you need to get the Intel OpenCL thing
You will need the Nvidia drivers and the nvidia-compute package but the Intel's package has the latest OpenCL stuff. What it is happening is that those Macros are not define in the Nvidia packages. Nvidia stop supporting OpenCL on version 1.0 or 1.1.
export CPLUS_INCLUDE_PATH=-I/garlic/apps/intel-opencl-1.2-3.1.1.11385/include
export C_INCLUDE_PATH=-I/garlic/apps/intel-opencl-1.2-3.1.1.11385/include
export CC=gcc-4.9.3
export CXX=g++-4.9.3
export CFLAGS='-I/garlic/apps/intel-opencl-1.2-3.1.1.11385/include -L/garlic/apps/intel-opencl-1.2-3.1.1.11385/lib64 -lOpenCL -Wl,-rpath -Wl,LIBDIR'
export CXXFLAGS='-I/garlic/apps/intel-opencl-1.2-3.1.1.11385/include -L/garlic/apps/intel-opencl-1.2-3.1.1.11385/lib64 -lOpenCL -Wl,-rpath -Wl,LIBDIR'
./configure --prefix=/garlic/apps/BUDE-1.2.1-intel_CL --enable-opencl
make
sudo make install