Skip to content

Commit

Permalink
update namd config patch to make namd3 work
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpku committed Sep 2, 2023
1 parent 39c1a4f commit 7987232
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions namd/config.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/config b/config
index 2bbb3e9a..d8d5e806 100755
index 2bbb3e9a..d53d6d53 100755
--- a/config
+++ b/config
@@ -56,6 +56,8 @@ function error_syntax {
Expand All @@ -11,20 +11,20 @@ index 2bbb3e9a..d8d5e806 100755
echo ''
if [ -n "${PRINT_ARCH_LIST+set}" ]; then
ARCH_PAT=''
@@ -156,6 +158,7 @@ function error_exists {
@@ -151,6 +153,7 @@ function error_exists {
use_mkl=0
use_cuda=0
use_hip=0
+ use_colvars_torch=0
use_cuda_prof=0
use_rocm_prof=0
use_memopt=0
use_mic=0
use_spec=0
+ use_colvar_torch=0

if (( $# < 1 )); then
PRINT_ARCH_LIST=1
@@ -254,6 +257,19 @@ function error_exists {
ARCH_SUFFIX_ARG=$ARCH_SUFFIX_ARG-$1
;;

+ --with-colvars-torch)
+ use_colvar_torch=1
+ use_colvars_torch=1
+ ;;
+
+ --torch-prefix)
Expand All @@ -44,7 +44,7 @@ index 2bbb3e9a..d8d5e806 100755
echo "COPTS = $CC_OPTS" >> Make.config
fi
-
+ if (( "$use_colvar_torch" )); then
+ if (( "$use_colvars_torch" )); then
+ echo "TORCHDIR = $TORCH_PREFIX" >> Make.config
+ echo 'TORCHINCFLAGS = $(COPTI)$(TORCHDIR)/include $(COPTI)$(TORCHDIR)/include/torch/csrc/api/include' >> Make.config
+ echo 'EXTRACOLVARSFLAGS = -std=c++17 -DTORCH $(TORCHINCFLAGS)' >> Make.config
Expand Down
2 changes: 1 addition & 1 deletion update-colvars-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ then
fi

# For torchann
patch -p1 -N -d ${target} < namd/config.patch
patch -F 12 -p1 -N -d ${target} < namd/config.patch
sed -i '/^COLVARSCXXFLAGS =*/s/$/ $(EXTRACOLVARSFLAGS)/' ${target}/Makefile

# Copy library files to the "colvars" folder
Expand Down

0 comments on commit 7987232

Please sign in to comment.