Closed jrmadsen closed 2 years ago
Hi,
I tried to checkout that branch and my cmake shows the following trace:
-- pybind11 v2.9.1
-- pykokkos-base version 0.0.7
-- Found Git: /opt/software/occigen/tools/git/2.10.2/intel/17.0/nompi/bin/git (found version "2.10.2")
Submodule 'pybind11' (https://github.com/pybind/pybind11.git) registered for path 'external/pybind11'
Cloning into '/work/CT4/oca7233/aminiussi/fargo/pybind11/external/pykokkos-base/external/pybind11'...
Submodule path 'external/pybind11': checked out 'e25b1505dbca042289c4076141092cff49b0b96b'
[...]
That is, pykokkos-base seems to clone its own pybind11 although it's already there as a submodule.
Is that expected ?
Thanks
[...]
add_subdirectory(external/kokkos)
[...]
add_subdirectory(external/pybind11)
add_subdirectory(external/pykokkos-base)
Set it to off
Added checks for pybind11::pybind11
So eventually, this should work ?
add_subdirectory(external/kokkos)
set(ENABLE_INTERNAL_PYBIND11 OFF)
set(ENABLE_INTERNAL_KOKKOS OFF)
add_subdirectory(external/pybind11)
add_subdirectory(external/pykokkos-base)
It fails with:
-- pybind11 v2.9.1
-- pykokkos-base version 0.0.7
CMake Error at external/pykokkos-base/cmake/Modules/KokkosPythonKokkos.cmake:27 (FIND_PACKAGE):
By not providing "FindKokkos.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Kokkos", but
CMake did not find one.
Could not find a package configuration file provided by "Kokkos" with any
of the following names:
KokkosConfig.cmake
kokkos-config.cmake
Add the installation prefix of "Kokkos" to CMAKE_PREFIX_PATH or set
"Kokkos_DIR" to a directory containing one of the above files. If "Kokkos"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
external/pykokkos-base/CMakeLists.txt:23 (INCLUDE)
-- Configuring incomplete, errors occurred!
If I change that to:
add_subdirectory(external/kokkos)
set(ENABLE_INTERNAL_PYBIND11 OFF)
set(ENABLE_INTERNAL_KOKKOS OFF)
#that's where Kokkos will be installed
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/external/kokkos ${CMAKE_PREFIX_PATH})
add_subdirectory(external/pybind11)
add_subdirectory(external/pykokkos-base)
I get:
CMake Error at rel/external/kokkos/KokkosConfig.cmake:48 (INCLUDE):
INCLUDE could not find load file:
/work/aminiussi/fargo/pybind11/rel/external/kokkos/KokkosTargets.cmake
And then:
CMake Error at rel/external/kokkos/KokkosConfigCommon.cmake:210 (MESSAGE):
Kokkos could not find 'kokkos_launch_compiler'. Please set
'-DKokkos_COMPILE_LAUNCHER=/path/to/launcher'
What are the CMake command I need to enter ?
Thanks
If you are using an external kokkos installation, I set the environment variable $Kokkos_DIR
and it will find the cmake config files it needs
I am not really using an external installation. I am importing kokkos as a submodule:
add_subdirectory(external/kokkos)
So it will be built in ${CMAKE_BINARY_DIR}/external/kokkos
but not before I run the build. When cmake sees:
add_subdirectory(external/pykokkos-base)
where is no $Kokkos_DIR with kokkos compiled. ${CMAKE_BINARY_DIR}/external/kokkos
only contains the files cmake produced from processing ${CMAKE_SOURCE_DIR}/external/kokkos
.
Thanks
And at that point, the CMakeCache does contains:
Kokkos_DIR:PATH=/work/aminiussi/fargo/pybind11/rel/external/kokkos
If you look at this test, it literally does exactly what is described in the PR:
and it works fine. Try deleting your build folder and starting from scratch.
Example: