@@ -88,35 +88,37 @@ def extract_step(self):
8888 def patch_step (self , * args , ** kwargs ):
8989 """Patch Amber using 'update_amber' tool, prior to applying listed patch files (if any)."""
9090
91- # figure out which Python command to use to run the update_amber script;
92- # by default it uses 'python', but this may not be available (on CentOS 8 for example);
93- # note that the dependencies are not loaded yet at this point, so we're at the mercy of the OS here...
94- python_cmd = None
95- for cand_python_cmd in ['python' , 'python3' , 'python2' ]:
96- if which (cand_python_cmd ):
97- python_cmd = cand_python_cmd
98- break
99-
100- if python_cmd is None :
101- raise EasyBuildError ("No suitable Python command found to run update_amber script!" )
102-
103- if self .cfg ['patchlevels' ] == "latest" :
104- cmd = "%s ./update_amber --update" % python_cmd
105- # Run as many times as specified. It is the responsibility
106- # of the easyconfig author to get this right, especially if
107- # he or she selects "latest". (Note: "latest" is not
108- # recommended for this reason and others.)
109- for _ in range (self .cfg ['patchruns' ]):
110- run_shell_cmd (cmd )
111- else :
112- for (tree , patch_level ) in zip (['AmberTools' , 'Amber' ], self .cfg ['patchlevels' ]):
113- if patch_level == 0 :
114- continue
115- cmd = "%s ./update_amber --update-to %s/%s" % (python_cmd , tree , patch_level )
91+ # Use the update_amber script if patchlevels is defined - if not then the easyconfig should apply the patches
92+ if self .cfg ['patchlevels' ]:
93+ # figure out which Python command to use to run the update_amber script;
94+ # by default it uses 'python', but this may not be available (on CentOS 8 for example);
95+ # note that the dependencies are not loaded yet at this point, so we're at the mercy of the OS here...
96+ python_cmd = None
97+ for cand_python_cmd in ['python' , 'python3' , 'python2' ]:
98+ if which (cand_python_cmd ):
99+ python_cmd = cand_python_cmd
100+ break
101+
102+ if python_cmd is None :
103+ raise EasyBuildError ("No suitable Python command found to run update_amber script!" )
104+
105+ if self .cfg ['patchlevels' ] == "latest" :
106+ cmd = "%s ./update_amber --update" % python_cmd
116107 # Run as many times as specified. It is the responsibility
117- # of the easyconfig author to get this right.
108+ # of the easyconfig author to get this right, especially if
109+ # he or she selects "latest". (Note: "latest" is not
110+ # recommended for this reason and others.)
118111 for _ in range (self .cfg ['patchruns' ]):
119112 run_shell_cmd (cmd )
113+ else :
114+ for (tree , patch_level ) in zip (['AmberTools' , 'Amber' ], self .cfg ['patchlevels' ]):
115+ if patch_level == 0 :
116+ continue
117+ cmd = "%s ./update_amber --update-to %s/%s" % (python_cmd , tree , patch_level )
118+ # Run as many times as specified. It is the responsibility
119+ # of the easyconfig author to get this right.
120+ for _ in range (self .cfg ['patchruns' ]):
121+ run_shell_cmd (cmd )
120122
121123 super ().patch_step (* args , ** kwargs )
122124
@@ -328,10 +330,13 @@ def install_step(self):
328330
329331 super ().install_step ()
330332
331- # Run the tests located in the build directory
333+ # Run the tests
332334 if self .cfg ['runtest' ]:
333335 if LooseVersion (self .version ) >= LooseVersion ('24' ):
334- testdir = os .path .join (self .builddir , 'test' )
336+ if self .name == 'AmberTools' :
337+ testdir = os .path .join (self .builddir , 'AmberTools' , 'test' )
338+ elif self .name == 'Amber' :
339+ testdir = os .path .join (self .builddir , 'test' )
335340 testname_cs = 'test.cuda.serial'
336341 testname_cp = 'test.cuda.parallel'
337342 else :
@@ -341,12 +346,16 @@ def install_step(self):
341346 pretestcommands = 'source %s/amber.sh && cd %s' % (self .installdir , testdir )
342347
343348 # serial tests
344- run_shell_cmd ("%s && make test.serial" % pretestcommands )
349+ if LooseVersion (self .version ) >= LooseVersion ('24' ):
350+ run_shell_cmd ("%s && make test" % pretestcommands )
351+ else :
352+ run_shell_cmd ("%s && make test.serial" % pretestcommands )
345353 if self .with_cuda :
346354 res = run_shell_cmd (f"{ pretestcommands } && make { testname_cs } " )
347355 if res .exit_code > 0 :
348356 self .log .warning ("Check the output of the Amber cuda tests for possible failures" )
349357
358+ # parallel tests
350359 if self .with_mpi :
351360 # Hard-code parallel tests to use 4 threads
352361 env .setvar ("DO_PARALLEL" , self .toolchain .mpi_cmd_for ('' , 4 ))
@@ -373,11 +382,15 @@ def sanity_check_step(self):
373382 binaries .append ('pmemd.cuda.MPI' )
374383 else :
375384 binaries .append ('pmemd.cuda_DPFP.MPI' )
385+ if self .name == 'AmberTools' :
386+ binaries .append ('gem.pmemd' )
376387
377388 if self .with_mpi :
378389 binaries .extend (['sander.MPI' ])
379390 if self .name == 'Amber' :
380391 binaries .append ('pmemd.MPI' )
392+ if self .name == 'AmberTools' :
393+ binaries .append ('gem.pmemd.MPI' )
381394
382395 custom_paths = {
383396 'files' : [os .path .join (self .installdir , 'bin' , binary ) for binary in binaries ],
0 commit comments