codeplaysoftware / portBLAS

An implementation of BLAS using the SYCL open standard.
Apache License 2.0
250 stars 48 forks source link

Autotuner Build fails #498

Closed chsasank closed 4 months ago

chsasank commented 6 months ago

Hi,

I have been trying to build autotuner but CMake fails with following error.

Command I used:

cmake -GNinja .. -DSYCL_COMPILER=dpcpp -DDPCPP_SYCL_TARGET=spir64 -DTUNING_TARGET=INTEL_GPU -DCMAKE_BUILD_TYPE=Release

Error:

CMake Error in tools/auto_tuner/CMakeLists.txt:                                                                                                                                                                    
  Imported target "DPCPP::DPCPP" includes non-existent path                                                                                                                                                        

    "/opt/intel/oneapi/2024.0/bin/compiler/../include/sycl"                                                                                                                                                        

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

CMake Error in tools/auto_tuner/CMakeLists.txt:
  Imported target "DPCPP::DPCPP" includes non-existent path

    "/opt/intel/oneapi/2024.0/bin/compiler/../include/sycl"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

sycl headers are at /opt/intel/oneapi/2024.0/include/sycl/ in my system.

I got response on discourse (https://support.codeplay.com/t/how-to-build-portblas-for-intel-gpus/667/7) that this is an issue with portBLAS cmake with oneapi changes b/w 2023.x and 2024.x

muhammad-tanvir-1211 commented 6 months ago

Hi @chsasank Thank you for your interest in using portBLAS. Could you please try and see if the following changes work for you or not? Thanks.

diff --git a/cmake/Modules/FindDPCPP.cmake b/cmake/Modules/FindDPCPP.cmake
index f8eec16..78175ad 100644
--- a/cmake/Modules/FindDPCPP.cmake
+++ b/cmake/Modules/FindDPCPP.cmake
@@ -58,12 +58,14 @@ if(UNIX)
     INTERFACE_COMPILE_OPTIONS "${DPCPP_FLAGS}"
     INTERFACE_LINK_OPTIONS "${DPCPP_FLAGS}"
     INTERFACE_LINK_LIBRARIES ${DPCPP_LIB_DIR}
-    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../include/sycl")
+    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../include/sycl"
+    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../../include/sycl")
 else()
   set_target_properties(DPCPP::DPCPP PROPERTIES
     INTERFACE_COMPILE_OPTIONS "${DPCPP_FLAGS}"
     INTERFACE_LINK_LIBRARIES ${DPCPP_LIB_DIR}
-    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../include/sycl")
+    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../include/sycl"
+    INTERFACE_INCLUDE_DIRECTORIES "${DPCPP_BIN_DIR}/../../include/sycl")
 endif()

 if (${DPCPP_SYCL_TARGET} STREQUAL "nvptx64-nvidia-cuda")

Side note: clang++ is going to get deprecated soon in the future oneAPI toolkit releases, for more information you can check the README file inside /opt/intel/oneapi/2024.0/bin/compiler/README.txt on your system.

chsasank commented 6 months ago

It works with your patch!

Side note: clang++ is going to get deprecated soon in the future oneAPI toolkit releases, for more information you can check the README file inside /opt/intel/oneapi/2024.0/bin/compiler/README.txt on your system.

I just followed your readme. Happy to make a PR with change to icpx if that's the recommended way to build.

muhammad-tanvir-1211 commented 6 months ago

We would rather not update the readme, for now, to change the preferred compiler to icpx instead of clang++. icpx is a closed source release compiler shipped with the oneAPI toolkit, whereas clang++ is available with the nightly releases and when compiling llvm from source. So the preference would still be clang++ as it is opensource.

s-Nick commented 4 months ago

Hi @chsasank, it looks like we solved this issue. Is it ok to you if I close it? Thank you.

chsasank commented 4 months ago

Sure thanks