krrishnarraj / clpeak

A tool which profiles OpenCL devices to find their peak capacities
Apache License 2.0
386 stars 109 forks source link

Clpeak build failure observed : Could not find a package configuration file provided by "OpenCLHeaders" #86

Closed aditikau closed 2 years ago

aditikau commented 2 years ago

Steps followed :

git clone https://github.com/krrishnarraj/clpeak
  cd clpeak
  git submodule update --init --recursive --remote
  mkdir build;cd build
  cmake ..
  cmake --build .

Cmake Error Trace :

cmake ..
-- Setting build type to Release
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

  project(ProjectName)
  near the top of the file, but after cmake_minimum_required().
  CMake is pretending there is a "project(Project)" command on the first
  line.

This warning is for project developers.  Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xx/clpeak/build/clhpp/build
[ 12%] Performing update step for 'hpp_headers'
Current branch master is up to date.
[ 25%] Performing configure step for 'hpp_headers'
CMake Error at CMakeLists.txt:43 (find_package):

  By not providing "FindOpenCLHeaders.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "OpenCLHeaders", but CMake did not find one.
  Could not find a package configuration file provided by "OpenCLHeaders"
  with any of the following names:

    OpenCLHeadersConfig.cmake
    openclheaders-config.cmake

  Add the installation prefix of "OpenCLHeaders" to CMAKE_PREFIX_PATH or set
  "OpenCLHeaders_DIR" to a directory containing one of the above files.  If
  "OpenCLHeaders" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!
See also "/home/xx/clpeak/build/clhpp/build/hpp/src/hpp_headers-build/CMakeFiles/CMakeOutput.log".
make[2]: *** [CMakeFiles/hpp_headers.dir/build.make:107: hpp/src/hpp_headers-stamp/hpp_headers-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/hpp_headers.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
-- Selected OpenCL includes from /usr/include;/home/xx/clpeak/build/clhpp_install/include
-- Selected OpenCL lib /usr/lib/x86_64-linux-gnu/libOpenCL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xx/clpeak/build
aditikau commented 2 years ago

In the /usr/include dir CL/cl.hpp is present instead of CL/opencl.hpp

Recent commit in hpp_header build https://github.com/krrishnarraj/clpeak (clpeak/cmake/BuildCLHpp.cmake) is cl.hpp is changed to opencl.hpp.

If reverted that commit(db42d30028bace27cda3c7d95f122a5c14743246) from clpeak dir and it worked.

git clone https://github.com/krrishnarraj/clpeak
cd clpeak
git submodule update --init --recursive --remote
git revert db42d30028bace27cda3c7d95f122a5c14743246 #this commit is related to cl.hpp to opencl.hpp change
rm -rf build; mkdir build; cd build
cmake ..
cmake --build .
krrishnarraj commented 2 years ago

There is a potential fix based on comments in https://github.com/KhronosGroup/OpenCL-CLHPP/issues/173 Check if the current dev branch is working for you. It will be merged to master after further testing

dilippuri commented 2 years ago

Thanks! @krrishnarraj, dev branch is working fine.