Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find -lkokkos #620

Open
JosefRuzicka opened this issue Mar 7, 2023 · 6 comments
Open

Cannot find -lkokkos #620

JosefRuzicka opened this issue Mar 7, 2023 · 6 comments

Comments

@JosefRuzicka
Copy link

Hello, I'm trying to run the Cxx11 kokkos programs, but when I write "make kokkos" I get the following error: "/usr/bin/ld: cannot find -lkokkos", any chance you have experience compiling these programs with the current version of Kokkos so that you could help me?

@jeffhammond
Copy link
Member

Unfortunately, the PRK build system lacks any automation, so you'll have to build Kokkos yourself and set the flags in make.defs appropriately, for example, like the GCC template shows (https://github.com/ParRes/Kernels/blob/default/common/make.defs.gcc#LL141C25-L141C25).

If this doesn't resolve your problem, can you provide more details, so I can give you more precise suggestions.

@JosefRuzicka
Copy link
Author

Thank you for answering!
I installed Kokkos with the script provided:
cmake .. -DKokkos_ENABLE_CUDA=True \ -DCMAKE_CXX_COMPILER=$HOME/KOKKOS/git/bin/nvcc_wrapper \ -DCMAKE_INSTALL_PREFIX=$HOME/KOKKOS/install-cuda \ -DKokkos_ARCH_POWER9=ON \ -DKokkos_ARCH_VOLTA70=ON \ -DKokkos_ENABLE_CUDA_LAMBDA=ON \ && make -j install
which creates in my bin directory a kokkos folder with the include folder and the lib64 folder (which has a libkokkoscore and a libkokkoscontainers).

I created a make.defs.kokkos in the common folder by copying the make.defs.cuda and updating the KOKKOSDIR to my kokkos installation path.

I'm not sure if there is a flag I could add to my make.defs.kokkos file so that it helps me find -lkokkos during make kokkos. I'm just trying to compile the already existing kokkos programs: stencil-kokkos.cc, transpose-kokkos...

If I just remove the -lkokkos flag from the compilation line, I get an error indicating that there are undefined references to every kokkos related function like Kokkos::initialize() and Kokkos::Finalize()

@jeffhammond
Copy link
Member

Are you using a Power9 machine?

@jeffhammond
Copy link
Member

Add -L$path_to_kokkos to KOKKOSFLAG

@jeffhammond
Copy link
Member

The build system needs common/make.defs so copy whatever template you use to that filename, and no other.

@JosefRuzicka
Copy link
Author

JosefRuzicka commented Mar 8, 2023

Im using an amd x86_64 machine, but I have tried different installations. with the one for power 9, it cant find -lkokkos, using:
cmake /home/jruzicka/Kokkos/kokkos \ -DCMAKE_CXX_COMPILER=/opt/compilers/gcc-11.1.0/bin/gcc \ -DCMAKE_INSTALL_PREFIX=/home/jruzicka/bin/kokkos\ -DKokkos_ENABLE_OPENMP=On \ -DKokkos_ARCH_HSW=On
I get this error:
In file included from prk_kokkos.h:36, from pic-kokkos.cc:67: /home/jruzicka/bin/kokkos_x86_64/include/Kokkos_Concepts.hpp:19:15: error: static assertion failed: Including non-public Kokkos header files is not allowed. 19 | static_assert(false, | ^~~~~ In file included from prk_kokkos.h:37, from pic-kokkos.cc:67: /home/jruzicka/bin/kokkos_x86_64/include/Kokkos_MemoryTraits.hpp:19:15: error: static assertion failed: Including non-public Kokkos header files is not allowed. 19 | static_assert(false,

and with the other installation:
cmake /home/jruzicka/Kokkos/kokkos \ -DCMAKE_CXX_COMPILER=/opt/compilers/gcc-11.1.0/bin/gcc \ -DCMAKE_INSTALL_PREFIX=/home/jruzicka/bin/kokkos_x86_64 \ -DKokkos_ENABLE_OPENMP=On \ -DKokkos_ARCH_NATIVE=On
I get that same second error again about static assertions.

I have had no trouble compiling and running the kokkos tutorials and some programs of my own but compiling kokkos everytime with a Makefile, yeah I moved the common/make.defs.kokkos I made into a common/make.defs

My make.defs kokkos part looks like this:
KOKKOSDIR=/home/jruzicka/bin/kokkos_x86_64 120 KOKKOSFLAG=-I${KOKKOSDIR}/include -L${KOKKOSDIR}/lib64 -lkokkos ${OPENMPFLAG}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants