I am trying to add the GPU package to a LAMMPS binary build for Julia. In essence, BinaryBuilder.jl pulls the latest version of LAMMPS and then compiles it for several specified machines. Most of this has been done already by others, but I would like to add the GPU package.
However, when the build runs, the compiler (I guess linker in this case) fails to find the CUDA toolkit. I have defined the CUDA_PATH
environment variable to where the toolkit is located, but this has no effect. I didn’t see anything in the documentation, but is it possible that I need to set LIBRARY_PATH
instead of CUDA_PATH
? Of course, the difficulty could come from the Julia side of things as well, but I’m hoping that it’s a pretty easy fix here.
For reference, here is the pull request I am working with and the build instructions (sans some predefined environment variables)
export CUDA_PATH="$prefix/cuda"
cd $WORKSPACE/srcdir/lammps/
mkdir build && cd build/
cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake ../cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN%.*}_gcc.cmake \
-DCMAKE_BUILD_TYPE=Release \
"${INSTALL_RPATH[@]}" \
-DBUILD_SHARED_LIBS=ON \
-DLAMMPS_EXCEPTIONS=ON \
-DBUILD_MPI=${MPI_OPTION} \
-DPKG_EXTRA-FIX=ON \
-DPKG_ML-SNAP=ON \
-DPKG_ML-PACE=ON \
-DPKG_ML-POD=ON \
-DPKG_DPD-BASIC=ON \
-DPKG_DPD-MESO=ON \
-DPKG_DPD-REACT=ON \
-DPKG_DPD-SMOOTH=ON \
-DPKG_USER-MESODPD=ON \
-DPKG_USER-DPD=ON \
-DPKG_USER-SDPD=ON \
-DPKG_MANYBODY=ON \
-DPKG_MOLECULE=ON \
-DPKG_REPLICA=ON \
-DPKG_SHOCK=ON \
-DLEPTON_ENABLE_JIT=no \
-DPKG_GPU=${GPU_OPTION} \
-DGPU_API=cuda
make -j${nproc}
make install