mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
Search for Torch cmake config files
This commit is contained in:
parent
83fa4600d8
commit
d0a89ff766
3 changed files with 8 additions and 4 deletions
|
|
@ -767,8 +767,11 @@ if(CP2K_USE_LIBXC)
|
|||
endif()
|
||||
|
||||
if(CP2K_USE_LIBTORCH)
|
||||
message(" - LIBTORCH\n" # let below line separate
|
||||
" - libraries: ${CP2K_LIBTORCH_LIBRARIES}\n\n")
|
||||
message(
|
||||
" - LIBTORCH\n"
|
||||
" - extra CXX flags: ${TORCH_CXX_FLAGS} ${TORCH_VERSION}\n"
|
||||
" - include directories: ${TORCH_INCLUDE_DIRS}\n"
|
||||
" - libraries: ${TORCH_LIBRARY}\n")
|
||||
endif()
|
||||
|
||||
if(CP2K_USE_HDF5)
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ RUN ln -sf cp2k.psmp cp2k && \
|
|||
ln -sf cp2k.psmp cp2k_shell
|
||||
|
||||
# Update library search path
|
||||
RUN echo "/opt/cp2k/lib\n/opt/spack/lib\n/opt/spack/lib/python3.12/site-packages/torch/lib" >/etc/ld.so.conf.d/cp2k.conf && ldconfig
|
||||
RUN echo "/opt/cp2k/lib\n/opt/spack/lib\n$(dirname $(find /opt/spack/lib -name libtorch.so))" >/etc/ld.so.conf.d/cp2k.conf && ldconfig
|
||||
|
||||
# Create entrypoint script file
|
||||
RUN printf "#!/bin/bash\n\
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ if [[ "${PROFILE}" == "spack" ]] && [[ "${VERSION}" == "psmp" ]]; then
|
|||
CMAKE_EXIT_CODE=$?
|
||||
|
||||
elif [[ "${PROFILE}" == "spack_all" ]] && [[ "${VERSION}" == "psmp" ]]; then
|
||||
export Torch_DIR="/opt/spack/lib/python3.12/site-packages/torch/share/cmake/Torch"
|
||||
Torch_DIR="$(dirname "$(find /opt/spack/lib -name TorchConfig.cmake)")"
|
||||
export Torch_DIR
|
||||
cmake \
|
||||
-GNinja \
|
||||
-DCMAKE_BUILD_TYPE="Release" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue