def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(fftw, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', ['--enable-shared', '--enable-openmp', '--enable-threads', '--enable-sse2']) self.prefix = kwargs.get('prefix', '/usr/local/fftw') self.__baseurl = kwargs.get('baseurl', 'ftp://ftp.fftw.org/pub/fftw') self.__check = kwargs.get('check', False) self.__directory = kwargs.get('directory', '') self.__mpi = kwargs.get('mpi', False) self.__ospackages = kwargs.get('ospackages', ['file', 'make', 'wget']) self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '3.3.8') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib'))} self.__wd = '/var/tmp' # working directory # Construct series of steps to execute self.__setup()
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(cgns, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) tar.__init__(self, **kwargs) rm.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get( 'configure_opts', ['--with-hdf5=/usr/local/hdf5', '--with-zlib']) self.prefix = kwargs.get('prefix', '/usr/local/cgns') self.__baseurl = kwargs.get('baseurl', 'https://github.com/CGNS/CGNS/archive') self.__check = kwargs.get('check', False) self.__ospackages = kwargs.get('ospackages', []) self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '3.3.1') self.__commands = [] # Filled in by __setup() self.__wd = '/var/tmp' # working directory # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(pnetcdf, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) ldconfig.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', ['--enable-shared']) self.prefix = kwargs.get('prefix', '/usr/local/pnetcdf') self.__baseurl = kwargs.get('baseurl', 'http://cucis.ece.northwestern.edu/projects/PnetCDF/Release') self.__check = kwargs.get('check', False) self.__ospackages = kwargs.get('ospackages', ['m4', 'make', 'tar', 'wget']) self.__toolchain = kwargs.get('toolchain', toolchain(CC='mpicc', CXX='mpicxx', F77='mpif77', F90='mpif90', FC='mpifort')) self.__version = kwargs.get('version', '1.10.0') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin'))} self.__wd = '/var/tmp' # working directory # Construct the series of steps to execute self.__setup()
def test_configure_opts(self): """Configure options specified""" cm = ConfigureMake(opts=['--with-foo', '--without-bar']) configure = cm.configure_step() self.assertEqual( configure, './configure --prefix=/usr/local --with-foo --without-bar')
def test_directory(self): """Source directory specified""" cm = ConfigureMake() configure = cm.configure_step(directory='/tmp/foo') # Note extra whitespace self.assertEqual(configure, 'cd /tmp/foo && ./configure --prefix=/usr/local')
def test_build_directory(self): """Build directory specified""" cm = ConfigureMake() configure = cm.configure_step(build_directory='/tmp/build', directory='/tmp/src') # Note extra whitespace self.assertEqual( configure, 'mkdir -p /tmp/build && cd /tmp/build && /tmp/src/configure --prefix=/usr/local' )
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(mvapich2, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) ldconfig.__init__(self, **kwargs) rm.__init__(self, **kwargs) sed.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.__baseurl = kwargs.get( 'baseurl', 'http://mvapich.cse.ohio-state.edu/download/mvapich/mv2') self.__check = kwargs.get('check', False) self.configure_opts = kwargs.get('configure_opts', ['--disable-mcast']) self.cuda = kwargs.get('cuda', True) self.directory = kwargs.get('directory', '') self.__gpu_arch = kwargs.get('gpu_arch', None) self.__ospackages = kwargs.get('ospackages', []) self.prefix = kwargs.get('prefix', '/usr/local/mvapich2') self.__runtime_ospackages = [] # Filled in by __distro() # MVAPICH2 does not accept F90 self.toolchain_control = { 'CC': True, 'CXX': True, 'F77': True, 'F90': False, 'FC': True } self.version = kwargs.get('version', '2.3') self.__commands = [] # Filled in by __setup() self.__environment_variables = {} # Filled in by __setup() # Input toolchain, i.e., what to use when building self.__toolchain = kwargs.get('toolchain', toolchain()) self.__wd = '/var/tmp' # working directory # Output toolchain self.toolchain = toolchain(CC='mpicc', CXX='mpicxx', F77='mpif77', F90='mpif90', FC='mpifort') # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def test_parallel(self): """Parallel count specified""" cm = ConfigureMake(parallel=7) # Function arguments override constructor build = cm.build_step(parallel=11) self.assertEqual(build, 'make -j11') # Use constructor arguments build = cm.build_step() self.assertEqual(build, 'make -j7')
def test_kwargs(self): """kwargs""" cm = ConfigureMake(disable_long_option=True, enable_foo=True, with_foo=True, with_foo2='/usr', without_bar=True, prefix=None) configure = cm.configure_step() self.assertEqual( configure, './configure --disable-long-option --enable-foo --with-foo --with-foo2=/usr --without-bar' )
def test_toolchain(self): """Toolchain specified""" cm = ConfigureMake() tc = toolchain(CC='mycc', CXX='mycxx', FC='myfc', F77='myf77', F90='myf90', CFLAGS='-g -O3', CPPFLAGS='-DFOO -DBAR', CXXFLAGS='-g -O3', FCFLAGS='-g -O3', FFLAGS='-g -O3', FLIBS='-ldl', LD_LIBRARY_PATH='/opt/mysw/lib:/opt/yoursw/lib', LDFLAGS='-Wl,--start-group foo.o bar.o -Wl,--endgroup', LIBS='-ldl -lpthread') configure = cm.configure_step(toolchain=tc) self.assertEqual(configure, '''CC=mycc CFLAGS='-g -O3' CPPFLAGS='-DFOO -DBAR' CXX=mycxx CXXFLAGS='-g -O3' F77=myf77 F90=myf90 FC=myfc FCFLAGS='-g -O3' FFLAGS='-g -O3' FLIBS=-ldl LD_LIBRARY_PATH=/opt/mysw/lib:/opt/yoursw/lib LDFLAGS='-Wl,--start-group foo.o bar.o -Wl,--endgroup' LIBS='-ldl -lpthread' ./configure --prefix=/usr/local''')
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(netcdf, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', []) self.__baseurl = 'https://www.unidata.ucar.edu/downloads/netcdf/ftp' self.__check = kwargs.get('check', False) self.__cxx = kwargs.get('cxx', True) self.__fortran = kwargs.get('fortran', True) self.__hdf5_dir = kwargs.get('hdf5_dir', '/usr/local/hdf5') self.__ospackages = kwargs.get('ospackages', []) self.prefix = kwargs.get('prefix', '/usr/local/netcdf') self.__runtime_ospackages = [] # Filled in by __distro() self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '4.6.1') self.__version_cxx = kwargs.get('version_cxx', '4.3.0') self.__version_fortran = kwargs.get('version_fortran', '4.4.4') self.__wd = '/var/tmp' self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')) } # Set the Linux distribution specific parameters self.__distro() # C interface (required) self.__setup() # C++ interface (optional) if self.__cxx: self.__setup_optional(pkg='netcdf-cxx4', version=self.__version_cxx) # Fotran interface (optional) if self.__fortran: self.__setup_optional(pkg='netcdf-fortran', version=self.__version_fortran)
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(openmpi, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.baseurl = kwargs.get('baseurl', 'https://www.open-mpi.org/software/ompi') self.__check = kwargs.get('check', False) self.configure_opts = kwargs.get( 'configure_opts', ['--disable-getpwuid', '--enable-orterun-prefix-by-default']) self.cuda = kwargs.get('cuda', True) self.directory = kwargs.get('directory', '') self.infiniband = kwargs.get('infiniband', True) self.__ospackages = kwargs.get('ospackages', []) self.prefix = kwargs.get('prefix', '/usr/local/openmpi') self.__runtime_ospackages = [] # Filled in by __distro() # Input toolchain, i.e., what to use when building self.__toolchain = kwargs.get('toolchain', toolchain()) self.version = kwargs.get('version', '3.0.0') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')) } self.__wd = '/var/tmp' # working directory # Output toolchain self.toolchain = toolchain(CC='mpicc', CXX='mpicxx', F77='mpif77', F90='mpif90', FC='mpifort') # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def test_configure_opts(self): """Configure options specified""" cm = ConfigureMake(opts=['--with-foo', '--without-bar']) # Function arguments override constructor configure = cm.configure_step(opts=['--without-foo', '--with-bar']) self.assertEqual( configure, './configure --prefix=/usr/local --with-bar --without-foo') # Use constructor arguments configure = cm.configure_step() self.assertEqual( configure, './configure --prefix=/usr/local --with-foo --without-bar')
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. # super(python, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.__commands = [] # Filled in by __setup() self.__wd = '/var/tmp' # working directory self.prefix = '/opt/apps' self.version = kwargs.get('version', '7.8.6')
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(ucx, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) tar.__init__(self, **kwargs) rm.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', [ '--enable-optimizations', '--disable-logging', '--disable-debug', '--disable-assertions', '--disable-params-check', '--disable-doxygen-doc' ]) self.prefix = kwargs.get('prefix', '/usr/local/ucx') self.__baseurl = kwargs.get( 'baseurl', 'https://github.com/openucx/ucx/releases/download') self.__cuda = kwargs.get('cuda', True) self.__gdrcopy = kwargs.get('gdrcopy', '') self.__knem = kwargs.get('knem', '') self.__ospackages = kwargs.get('ospackages', []) self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '1.4.0') self.__xpmem = kwargs.get('xpmem', '') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')), 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin')) } self.__wd = '/var/tmp' # working directory # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(mpich, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) ldconfig.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.__baseurl = kwargs.get('baseurl', 'https://www.mpich.org/static/downloads') self.__check = kwargs.get('check', False) self.configure_opts = kwargs.get('configure_opts', []) self.__ospackages = kwargs.get('ospackages', []) self.prefix = kwargs.get('prefix', '/usr/local/mpich') self.__runtime_ospackages = [] # Filled in by __distro() # Input toolchain, i.e., what to use when building self.__toolchain = kwargs.get('toolchain', toolchain()) # MPICH does not accept F90 self.toolchain_control = {'CC': True, 'CXX': True, 'F77': True, 'F90': False, 'FC': True} self.version = kwargs.get('version', '3.3') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin'))} self.__wd = '/var/tmp' # working directory # Output toolchain self.toolchain = toolchain(CC='mpicc', CXX='mpicxx', F77='mpif77', F90='mpif90', FC='mpifort') # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(hdf5, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', ['--enable-cxx', '--enable-fortran']) self.prefix = kwargs.get('prefix', '/usr/local/hdf5') self.__baseurl = kwargs.get( 'baseurl', 'http://www.hdfgroup.org/ftp/HDF5/releases') self.__check = kwargs.get('check', False) self.__directory = kwargs.get('directory', '') self.__ospackages = kwargs.get('ospackages', []) self.__runtime_ospackages = [] # Filled in by __distro() self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '1.10.1') self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'HDF5_DIR': self.prefix, 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')) } self.__wd = '/var/tmp' # working directory # Set the Linux distribution specific parameters self.__distro() # Construct the series of steps to execute self.__setup()
def __init__(self, **kwargs): """Initialize building block""" # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(xpmem, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) git.__init__(self, **kwargs) tar.__init__(self, **kwargs) rm.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', ['--disable-kernel-module']) self.prefix = kwargs.get('prefix', '/usr/local/xpmem') self.__branch = kwargs.get('branch', 'master') self.__ospackages = kwargs.get('ospackages', [ 'autoconf', 'automake', 'ca-certificates', 'file', 'git', 'libtool', 'make' ]) self.__repository = kwargs.get('repository', 'https://gitlab.com/hjelmn/xpmem.git') self.__toolchain = kwargs.get('toolchain', toolchain()) self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'CPATH': '{}:$CPATH'.format(os.path.join(self.prefix, 'include')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')), 'LIBRARY_PATH': '{}:$LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')) } self.__wd = '/var/tmp' # working directory # Construct the series of steps to execute self.__setup()
def test_defaults(self): """Default values""" cm = ConfigureMake() # configure step configure = cm.configure_step() self.assertEqual(configure, './configure --prefix=/usr/local') # build step build = cm.build_step() self.assertEqual(build, 'make -j$(nproc)') # check step check = cm.check_step() self.assertEqual(check, 'make -j$(nproc) check') # install step install = cm.install_step() self.assertEqual(install, 'make -j$(nproc) install')
def test_parallel(self): """Parallel count specified""" cm = ConfigureMake(parallel=7) build = cm.build_step() self.assertEqual(build, 'make -j7')
def __init__(self, **kwargs): """The `netcdf` building block downloads, configures, builds, and installs the [NetCDF](https://www.unidata.ucar.edu/software/netcdf/) component. The [HDF5](#hdf5) building block should be installed prior to this building block. As a side effect, this building block modifies `PATH`, `LD_LIBRARY_PATH` to include the NetCDF build. # Parameters check: Boolean flag to specify whether the `make check` step should be performed. The default is False. configure_opts: List of options to pass to `configure`. The default value is an empty list. cxx: Boolean flag to specify whether the NetCDF C++ library should be installed. The default is True. fortran: Boolean flag to specify whether the NetCDF Fortran library should be installed. The default is True. hdf5_dir: Path to the location where HDF5 is installed in the container image. The default value is `/usr/local/hdf5`. ospackages: List of OS packages to install prior to configuring and building. For Ubuntu, the default values are `ca-certificates`, `file`, `libcurl4-openssl-dev`, `m4`, `make`, `wget`, and `zlib1g-dev`. For RHEL-based Linux distributions the default values are `ca-certificates`, `file`, `libcurl-devel` `m4`, `make`, `wget`, and `zlib-devel`. prefix: The top level install location. The default location is `/usr/local/netcdf`. toolchain: The toolchain object. This should be used if non-default compilers or other toolchain options are needed. The default is empty. version: The version of NetCDF to download. The default value is `4.6.1`. version_cxx: The version of NetCDF C++ to download. The default value is `4.3.0`. version_fortran: The version of NetCDF Fortran to download. The default value is `4.4.4`. # Examples ```python netcdf(prefix='/opt/netcdf/4.6.1', version='4.6.1') ``` ```python p = pgi(eula=True) netcdf(toolchain=p.toolchain) ``` """ # Trouble getting MRO with kwargs working correctly, so just call # the parent class constructors manually for now. #super(netcdf, self).__init__(**kwargs) ConfigureMake.__init__(self, **kwargs) rm.__init__(self, **kwargs) tar.__init__(self, **kwargs) wget.__init__(self, **kwargs) self.configure_opts = kwargs.get('configure_opts', []) self.__baseurl = 'https://www.unidata.ucar.edu/downloads/netcdf/ftp' self.__check = kwargs.get('check', False) self.__cxx = kwargs.get('cxx', True) self.__fortran = kwargs.get('fortran', True) self.__hdf5_dir = kwargs.get('hdf5_dir', '/usr/local/hdf5') self.__ospackages = kwargs.get('ospackages', []) self.prefix = kwargs.get('prefix', '/usr/local/netcdf') self.__runtime_ospackages = [] # Filled in by __distro() self.__toolchain = kwargs.get('toolchain', toolchain()) self.__version = kwargs.get('version', '4.6.1') self.__version_cxx = kwargs.get('version_cxx', '4.3.0') self.__version_fortran = kwargs.get('version_fortran', '4.4.4') self.__wd = '/var/tmp' self.__commands = [] # Filled in by __setup() self.__environment_variables = { 'PATH': '{}:$PATH'.format(os.path.join(self.prefix, 'bin')), 'LD_LIBRARY_PATH': '{}:$LD_LIBRARY_PATH'.format(os.path.join(self.prefix, 'lib')) } # Set the Linux distribution specific parameters self.__distro() # C interface (required) self.__setup() # C++ interface (optional) if self.__cxx: self.__setup_optional(pkg='netcdf-cxx4', version=self.__version_cxx) # Fotran interface (optional) if self.__fortran: self.__setup_optional(pkg='netcdf-fortran', version=self.__version_fortran)
def test_prefix(self): """Prefix specified""" cm = ConfigureMake(prefix='/my/prefix') configure = cm.configure_step() self.assertEqual(configure, './configure --prefix=/my/prefix')