Fixes for Intel and container build fixes
[gromacs.git] / admin / containers / utility.py
blobc79de2a6085508d41d08b218cf057dce232af513
2 # This file is part of the GROMACS molecular simulation package.
4 # Copyright (c) 2020, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
35 """A `utility` module helps manage the matrix of configurations for CI testing and build containers.
37 Provides importable argument parser.
39 Authors:
40 * Paul Bauer <paul.bauer.q@gmail.com>
41 * Eric Irrgang <ericirrgang@gmail.com>
42 * Joe Jordan <e.jjordan12@gmail.com>
43 * Mark Abraham <mark.j.abraham@gmail.com>
45 """
47 import argparse
50 parser = argparse.ArgumentParser(description='GROMACS CI image slug options.', add_help=False)
51 """A parent parser for tools referencing image parameters.
53 This argparse parser is defined for convenience and may be used to partially initialize
54 parsers for tools.
56 .. warning:: Do not modify this parser.
58 Instead, inherit from it with the *parents* argument to :py:class:`argparse.ArgumentParser`
59 """
61 # TODO: Try using distutils.version.StrictVersion.
62 parser.add_argument('--cmake', type=str, default='3.9.6',
63 choices=['3.9.6', '3.11.4', '3.15.7'],
64 help='Selection of CMake version to provide to base image')
65 compiler_group = parser.add_mutually_exclusive_group()
66 compiler_group.add_argument('--gcc', type=int, nargs='?', const=7, default=7,
67 choices=[5, 6, 7, 8, 9],
68 help='Select GNU compiler tool chain. (Default) '
69 'Some checking is implemented to avoid incompatible combinations')
70 compiler_group.add_argument('--llvm', type=str, nargs='?', const='7', default=None,
71 choices=['3.6', '6', '7', '8'],
72 help='Select LLVM compiler tool chain. '
73 'Some checking is implemented to avoid incompatible combinations')
74 compiler_group.add_argument('--icc', type=int, nargs='?', const=19, default=None,
75 choices=[19],
76 help='Select Intel compiler tool chain. '
77 'Some checking is implemented to avoid incompatible combinations')
79 linux_group = parser.add_mutually_exclusive_group()
80 linux_group.add_argument('--ubuntu', type=str, nargs='?', const='18.04', default='18.04',
81 choices=['16.04', '18.04'],
82 help='Select Ubuntu Linux base image. (default: ubuntu 18.04)')
83 linux_group.add_argument('--centos', type=str, nargs='?', const='7', default=None,
84 choices=['6', '7'],
85 help='Select Centos Linux base image.')
87 parser.add_argument('--cuda', type=str, nargs='?', const='10.2', default=None,
88 choices=['9.0', '10.0', '10.1', '10.2'],
89 help='Select a CUDA version for a base Linux image from NVIDIA.')
91 parser.add_argument('--mpi', type=str, nargs='?', const='openmpi', default=None,
92 choices=['openmpi', 'impi'],
93 help='Enable MPI (default disabled) and optionally select distribution (default: openmpi)')
95 parser.add_argument('--tsan', type=str, nargs='?', const='llvm', default=None,
96 choices=['llvm'],
97 help='Build special compiler versions with TSAN OpenMP support')
99 parser.add_argument('--opencl', type=str, nargs='?', const='nvidia', default=None,
100 choices=['nvidia', 'intel', 'amd'],
101 help='Provide environment for OpenCL builds')
103 parser.add_argument('--clfft', type=str, nargs='?', const='master', default=None,
104 choices=['master', 'develop'],
105 help='Add external clFFT libraries to the build image')
107 parser.add_argument('--doxygen', type=str, nargs='?', const='1.8.5', default=None,
108 choices=['1.8.5', '1.8.11'],
109 help='Add doxygen environment for documentation builds. Also adds other requirements needed for final docs images.')