EasyBuild support
Is your feature request related to a problem? Please describe. For larger simulations, you really want to run AMUSE on an HPC machine, and so it needs to be installed there. Ideally, you'd just be able to ask your sysadmin to install it. HPC sysadmins frown on Conda, and instead use EasyBuild, Spack, or nix to build packages.
Of these, EasyBuild is most common in Europe, and in particular on the Sterrewacht machines, so having EasyConfigs available for AMUSE would be really nice.
Describe the solution you'd like EasyConfigs for AMUSE in the online repo, so that everyone using EasyBuild can easily install AMUSE.
For some codes this may be tricky due to large data files or a desire to write into the installed directory. To make sure it will work, we need to do an install into a non-user-writable directory, then run the tests against that and check that they pass.
- [x] Make a base Docker container with EasyBuild installed
- [x] Install the AMUSE dependencies in it
- [x] Create an amuse-framework EasyConfig
- [ ] Add individual codes
- [ ] aarsethzare
- [ ] adaptb
- [ ] athena
- [ ] bhtree
- [ ] bonsai (broken)
- [ ] bonsai2 (broken)
- [ ] brutus
- [ ] bse
- [ ] capreole
- [ ] etics
- [ ] evtwin
- [ ] fastkick
- [ ] fi
- [ ] fractalcluster
- [ ] gadget2
- [ ] galactics
- [ ] galaxia
- [ ] hacs64 (broken)
- [ ] halogen
- [ ] hermite
- [ ] hermite0
- [ ] hermite_grx
- [ ] higpus
- [ ] hop
- [ ] huayno
- [ ] kepler
- [ ] kepler_orbiters
- [ ] krome
- [ ] mameclot
- [ ] mercury
- [ ] mesa_r15140
- [ ] mesa_r2208
- [ ] mi6
- [ ] mikkola
- [ ] mmams
- [ ] mmc (broken)
- [ ] mobse
- [ ] mocassin
- [ ] mosse
- [ ] mpiampvac
- [ ] nbody6xx
- [ ] octgrav (broken)
- [ ] petar
- [ ] ph4
- [ ] phantom
- [ ] phigrape
- [ ] pikachu (broken)
- [ ] rebound
- [ ] sakura
- [ ] seba
- [ ] secularmultiple
- [ ] sei
- [ ] simplex
- [ ] simplex2_5
- [ ] smalln
- [ ] sphray
- [ ] sse
- [ ] symple
- [ ] tupan
- [ ] twobody
- [ ] vader
Progress update: I've got a container with EasyBuild in it, and the dependencies for the framework, and now I have an EasyConfig for amuse-framework itself that makes EasyBuild build a module with the framework in it.
Running the tests is a challenge however, because ./setup doesn't know how to deal with things if there is no venv or conda environment active. But if I manually build the framework tests and run them (with some tweaking of PYTHONPATH and FCFLAGS), then they pass, so it seems the module is nominally working.
I do run into the issue that Fortran libraries aren't found, because there's no environment variable that can be used to pass their location to the compiler, like for C and C++. Lmod does set PKG_CONFIG_PATH however, so it looks like we can use pkg-config to detect e.g. stopcond and forsockets at least in principle.
I need to figure out what needs to be changed in ./setup to make this work; probably a variant of venv mode that works without a venv and some tweaks to the way tests are run.
When building amuse-framework with EasyBuild I'm getting errors because EB sets LIBS in the environment, but the Makefile for the AMUSE libraries also uses LIBS, for an unrelated purpose to what LIBS is usually for. I needed this patch:
diff --git a/lib/Makefile b/lib/Makefile
index f4fe8acbb..76fe2648a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,5 +1,5 @@
.PHONY: Makefile
-LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
+AMUSE_LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
# We build sapporo_light separately and only on demand, because it needs CUDA and we
@@ -10,9 +10,9 @@ LIBS = $(filter-out Makefile sapporo_light, $(wildcard *))
.PHONY: install uninstall clean distclean
-install uninstall clean distclean: $(LIBS)
+install uninstall clean distclean: $(AMUSE_LIBS)
-.PHONY: $(LIBS)
-$(LIBS):
+.PHONY: $(AMUSE_LIBS)
+$(AMUSE_LIBS):
$(MAKE) -C $@ $(MAKECMDGOALS)
The ./setup installer has 8 commands: configure, install, test, develop, package, uninstall, clean, and distclean.
Configure is the default, and is run with just ./setup, it'll analyse the environment and tell the user what the next step is. This is not involved in packaging, so it doesn't need to change.
For install, develop, and uninstall, we need an environment to (un)install into. So this can also remain the same.
For package, we'll want to check that PREFIX is set, and install into the directory it points to. Conda sets PREFIX, and it can be set in EasyBuild too if you can figure out how.
Finally clean and distclean only affect the source tree, so no changes needed there too.
So we need to change the top level in ./setup to run the configure script only for configure, install and develop, and then for package we need to take PREFIX, probably set VIRTUALENV from it if it isn't already set, and run pip.