summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authormarcost2 <52476474+marcost2@users.noreply.github.com>2022-04-04 04:47:09 -0300
committerGitHub <noreply@github.com>2022-04-04 09:47:09 +0200
commit21cb859b4fedd548fe9c15e8a82cf8b4b189b9e1 (patch)
tree9559bc12827a90726a74f58559ba948d492f6f2d /var
parentdc7fbafdb2556e0cda423a3f4fc26138cb1d5478 (diff)
downloadspack-21cb859b4fedd548fe9c15e8a82cf8b4b189b9e1.tar.gz
spack-21cb859b4fedd548fe9c15e8a82cf8b4b189b9e1.tar.bz2
spack-21cb859b4fedd548fe9c15e8a82cf8b4b189b9e1.tar.xz
spack-21cb859b4fedd548fe9c15e8a82cf8b4b189b9e1.zip
amber20 + ambertools21: fix build issues (#29809)
* Amber: fix must be declared before the namelist is declared [1]: http://archive.ambermd.org/202105/0098.html
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/amber/package.py13
-rw-r--r--var/spack/repos/builtin/packages/amber/sebomd_fix.patch78
2 files changed, 91 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/amber/package.py b/var/spack/repos/builtin/packages/amber/package.py
index 9447060525..26ceba87dc 100644
--- a/var/spack/repos/builtin/packages/amber/package.py
+++ b/var/spack/repos/builtin/packages/amber/package.py
@@ -104,6 +104,10 @@ class Amber(Package, CudaPackage):
patch(patch_url_str.format(ver, num),
sha256=checksum, level=0, when='@{0}'.format(ver))
+ # Patch to move the namelist sebomd after the variable declarations
+ # Taken from http://archive.ambermd.org/202105/0098.html
+ patch('sebomd_fix.patch', when='@20')
+
# Patch to add ppc64le in config.guess
patch('ppc64le.patch', when='@18: target=ppc64le:')
@@ -132,6 +136,7 @@ class Amber(Package, CudaPackage):
depends_on('bison', type='build')
depends_on('netcdf-fortran')
depends_on('parallel-netcdf', when='@20:') # when='AmberTools@21:'
+ depends_on('tcsh', type=('build'), when='@20') # when='AmberTools@21:'
# Potential issues with openmpi 4
# (http://archive.ambermd.org/201908/0105.html)
depends_on('mpi', when='+mpi')
@@ -152,6 +157,10 @@ class Amber(Package, CudaPackage):
conflicts('+openmp', when='%pgi',
msg='OpenMP not available for the pgi compiler')
+ def url_for_version(self, version):
+ url = "file://{0}/Amber{1}.tar.bz2".format(os.getcwd(), version)
+ return url
+
def setup_build_environment(self, env):
amber_src = self.stage.source_path
env.set('AMBERHOME', amber_src)
@@ -189,6 +198,10 @@ class Amber(Package, CudaPackage):
else:
raise InstallError('Unknown compiler, exiting!!!')
+ # Alternative way to make csh/tcsh detection work with modules
+ filter_file(r'-x /bin/csh', 'command -v csh &> /dev/null/',
+ 'AmberTools/src/configure2', string=True)
+
# Base configuration
conf = Executable('./configure')
base_args = ['--skip-python',
diff --git a/var/spack/repos/builtin/packages/amber/sebomd_fix.patch b/var/spack/repos/builtin/packages/amber/sebomd_fix.patch
new file mode 100644
index 0000000000..c2ee04a0b0
--- /dev/null
+++ b/var/spack/repos/builtin/packages/amber/sebomd_fix.patch
@@ -0,0 +1,78 @@
+--- a/ambertools_tmpdir/AmberTools/src/sander/sebomd_module.F90 2019-08-01 09:29:43.000000000 -0300
++++ b/ambertools_tmpdir/AmberTools/src/sander/sebomd_module.F90 2022-03-30 09:07:07.635303955 -0300
+@@ -121,37 +121,6 @@
+ implicit none
+ integer :: stat
+
+- namelist /sebomd/ hamiltonian, &
+- modif, &
+- ncore, &
+- dbuff1, &
+- dbuff2, &
+- charge_out, &
+- bond_order_out, &
+- lambda, &
+- peptk, &
+- method, &
+- charge, &
+- longrange, &
+- fullscf, &
+- ntwc, &
+- ntwb, &
+- chtype, &
+- chewald, &
+- screen, &
+- guess, &
+- pdump, &
+- ipolyn, &
+- nresidue, &
+- ntwh, &
+- iprec, &
+- peptcorr, &
+- debugmsg, &
+- debugforces, &
+- diag_routine, &
+- dpmax, &
+- bocut
+-
+ character(10) :: hamiltonian
+ character(10) :: modif
+ integer :: method
+@@ -183,6 +152,37 @@
+ integer :: debugforces
+ integer :: diag_routine
+
++ namelist /sebomd/ hamiltonian, &
++ modif, &
++ ncore, &
++ dbuff1, &
++ dbuff2, &
++ charge_out, &
++ bond_order_out, &
++ lambda, &
++ peptk, &
++ method, &
++ charge, &
++ longrange, &
++ fullscf, &
++ ntwc, &
++ ntwb, &
++ chtype, &
++ chewald, &
++ screen, &
++ guess, &
++ pdump, &
++ ipolyn, &
++ nresidue, &
++ ntwh, &
++ iprec, &
++ peptcorr, &
++ debugmsg, &
++ debugforces, &
++ diag_routine, &
++ dpmax, &
++ bocut
++
+ hamiltonian = sebomd_obj%hamiltonian
+ modif = sebomd_obj%modif
+ method = sebomd_obj%method