kokkos / kokkos-remote-spaces

Kokkos Remote Spaces implements distributed Kokkos Views and related APIs for distributed parallel programming.
Other
42 stars 17 forks source link

Build cannot find KokkosTargets.cmake file #70

Closed davidozog closed 1 year ago

davidozog commented 1 year ago

I'm having trouble building kokkos-remote-spaces due to a missing cmake file in kokkos:

CMake Error at /home/dmozog/Repos/kokkos/build/KokkosConfig.cmake:48 (INCLUDE):
  INCLUDE could not find load file:

    /home/dmozog/Repos/kokkos/build/KokkosTargets.cmake

Call Stack (most recent call first):
  CMakeLists.txt:12 (find_package)

However, I see that KokkosTargets.cmake file is located in a different directory (CMakeFiles/Export/lib64/cmake/Kokkos/KokkosTargets.cmake), so if I create a symlink to the file from the kokkos build directory, things get further. But something still seems wrong with my build because the next error is this:

  The imported target "Kokkos::kokkoscore" references the file
     "/home/dmozog/lib64/libkokkoscore.a"
 but this file does not exist.

Here is the cmake command I'm running (on SUSE Linux Enterprise Server 15 SP3, cmake version 3.17.0, oneAPI C++ 2023.1.0):

export KOKKOS_BUILD_DIR=$HOME/Repos/kokkos/build
export SHMEM_ROOT=$HOME/usr/local/SOS/
cmake .. -DKRS_ENABLE_SHMEMSPACE=ON -DKokkos_DIR=${KOKKOS_BUILD_DIR} -DSHMEM_ROOT=${SHMEM_ROOT} -DKRS_ENABLE_TESTS=ON -DCMAKE_CXX_COMPILER=oshc++

And here is how I've configured Kokkos:

cmake .. -DCMAKE_CXX_COMPILER=icpx -DKokkos_ENABLE_SYCL=ON -DKokkos_ENABLE_HWLOC=ON

Should KOKKOS_BUILD_DIR point to the kokkos install directory? I have different (but similar) errors in that case.

dalg24 commented 1 year ago

Try -DKokkos_ROOT=/path/to/kokkos/install/dir

davidozog commented 1 year ago

Thanks @dalg24.

I thought I had tried that earlier, but I must have made a mistake before, because pointing -DKokkos_ROOT to the install directory is working now.

I think I have a small suggestion for the README that might help others avoid this - I will submit as a pull request if that's ok?

dalg24 commented 1 year ago

Sounds good