Exemplo n.º 1
0
    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)
        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.__ospackages = kwargs.get('ospackages', ['file', 'make', 'wget'])
        self.__toolchain = kwargs.get('toolchain', toolchain())
        self.__version = kwargs.get('version', '3.3.7')

        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 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_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')
Exemplo n.º 4
0
    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)
        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.3rc2')

        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_toolchain(self):
        """Toolchain specified"""
        cm = ConfigureMake()
        tc = toolchain(CC='mycc',
                       CXX='mycxx',
                       FC='myfc',
                       F77='myf77',
                       F90='myf90')

        configure = cm.configure_step(toolchain=tc)
        self.assertEqual(
            configure,
            'CC=mycc CXX=mycxx F77=myf77 F90=myf90 FC=myfc ./configure --prefix=/usr/local'
        )
Exemplo n.º 6
0
    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)
        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)
Exemplo n.º 7
0
    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)
        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 = '/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()
Exemplo n.º 8
0
    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',
                       LD_LIBRARY_PATH='/opt/mysw/lib:/opt/yoursw/lib',
                       LDFLAGS='-Wl,--start-group foo.o bar.o -Wl,--endgroup')

        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' LD_LIBRARY_PATH=/opt/mysw/lib:/opt/yoursw/lib LDFLAGS='-Wl,--start-group foo.o bar.o -Wl,--endgroup' ./configure --prefix=/usr/local'''
        )
Exemplo n.º 9
0
    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)
        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()
Exemplo n.º 10
0
    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 -j4')

        # check step
        check = cm.check_step()
        self.assertEqual(check, 'make -j4 check')

        # install step
        install = cm.install_step()
        self.assertEqual(install, 'make -j4 install')
Exemplo n.º 11
0
    def test_prefix(self):
        """Prefix specified"""
        cm = ConfigureMake(prefix='/my/prefix')

        configure = cm.configure_step()
        self.assertEqual(configure, './configure --prefix=/my/prefix')
Exemplo n.º 12
0
    def test_parallel(self):
        """Parallel count specified"""
        cm = ConfigureMake(parallel=7)

        build = cm.build_step()
        self.assertEqual(build, 'make -j7')