amber20 + ambertools21: fix build issues (#29809)

* Amber: fix must be declared before the namelist is declared

[1]: http://archive.ambermd.org/202105/0098.html
This commit is contained in:
marcost2 2022-04-04 04:47:09 -03:00 committed by GitHub
parent dc7fbafdb2
commit 21cb859b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 91 additions and 0 deletions

View File

@ -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 @@ def install(self, spec, prefix):
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',

View File

@ -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