3 # Build and test the sample_restraint package distributed with GROMACS 2021.
5 # This script is intended to support automated GROMACS testing infrastructure,
6 # and may be removed without notice.
8 # WARNING: This script assumes OpenMPI mpiexec. Syntax for launch wrappers from
9 # other implementations will need different syntax, and we should get a
10 # MPIRUNNER from the environment, or something.
12 # Make sure the script errors if any commands error.
15 # Create "sdist" source distribution archive.
16 pushd python_packaging/src
17 # TODO: Remove extraneous environment variable with resolution of #3273
18 # Ref: https://redmine.gromacs.org/issues/3273
19 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
21 # TODO: Identify SDIST
23 # Build and install from sdist.
24 # Note that tool chain may be provided differently in GROMACS 2020 and 2021.
25 # TODO: How should we distinguish the target branch?
26 # if [ "2020" -eq "$GROMACS_VERSION" ]; then
28 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
29 python -m pip install \
33 --no-build-isolation \
35 # TODO: Build and install from $SDIST instead of wildcard.
36 # TODO: How should we distinguish the target branch?
37 # elif [ "2021" -eq "$GROMACS_VERSION" ]; then
38 # GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
39 # python -m pip install \
43 # --no-build-isolation \
45 # TODO: Build and install from $SDIST instead of wildcard.
47 echo "Logic error in GROMACS version handling."
52 . $INSTALL_DIR/bin/GMXRC
53 pushd python_packaging/sample_restraint
56 # TODO: Update with respect to https://redmine.gromacs.org/issues/3133
58 -DDOWNLOAD_GOOGLETEST=ON \
59 -DGMXAPI_EXTENSION_DOWNLOAD_PYBIND=ON
63 #TODO: Can we get ctest JUnitXML output here?
68 python -m pytest $PWD/tests --junitxml=$PLUGIN_TEST_XML --threads=2
70 # Note: Multiple pytest processes getting --junitxml output file argument
71 # may cause problems, so we set the option on only one of the launched processes.
72 # See also Multiple Instruction Multiple Data Model for OpenMPI mpirun:
73 # https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php
74 PROGRAM=(`which python` -m mpi4py -m pytest \
78 # shellcheck disable=SC2068
79 if [ -x `which mpiexec` ]; then
80 PYTHONDONTWRITEBYTECODE=1 \
81 mpiexec --allow-run-as-root \
82 -x OMP_NUM_THREADS=1 \
83 --mca opal_warn_on_missing_libcuda 0 \
84 --mca orte_base_help_aggregate 0 \
85 -n 1 ${PROGRAM[@]} --junitxml=$PLUGIN_MPI_TEST_XML : \