Ejemplo n.º 1
0
    def configure_step(self):
        """Configure build: set config options and configure"""

        shlib_ext = get_shared_lib_ext()

        if LooseVersion(self.version) < LooseVersion("4.3"):
            self.cfg.update('configopts', "--enable-shared")

            if self.toolchain.options['pic']:
                self.cfg.update('configopts', '--with-pic')

            tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
            self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)

            # add -DgFortran to CPPFLAGS when building with GCC
            if self.toolchain.comp_family() == toolchain.GCC:  #@UndefinedVariable
                self.cfg.update('configopts', 'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))

            ConfigureMake.configure_step(self)

        else:
            for (dep, libname) in [('cURL', 'curl'), ('HDF5', 'hdf5'), ('Szip', 'sz'), ('zlib', 'z'),
                                   ('PnetCDF', 'pnetcdf')]:
                dep_root = get_software_root(dep)
                dep_libdir = get_software_libdir(dep)

                if dep_root:
                    incdir = os.path.join(dep_root, 'include')
                    self.cfg.update('configopts', '-D%s_INCLUDE_DIR=%s ' % (dep.upper(), incdir))

                    if dep == 'HDF5':
                        env.setvar('HDF5_ROOT', dep_root)
                        self.cfg.update('configopts', '-DUSE_HDF5=ON')

                        hdf5cmvars = {
                            # library name: (cmake option suffix in netcdf<4.4, cmake option suffix in netcfd>=4.4)
                            'hdf5': ('LIB', 'C_LIBRARY'),
                            'hdf5_hl': ('HL_LIB', 'HL_LIBRARY'),
                        }

                        for libname in hdf5cmvars:
                            if LooseVersion(self.version) < LooseVersion("4.4"):
                                cmvar = hdf5cmvars[libname][0]
                            else:
                                cmvar = hdf5cmvars[libname][1]
                            libhdf5 = os.path.join(dep_root, dep_libdir, 'lib%s.%s' % (libname, shlib_ext))
                            self.cfg.update('configopts', '-DHDF5_%s=%s ' % (cmvar, libhdf5))
                            # 4.4 forgot to set HDF5_<lang>_LIBRARIES
                            if LooseVersion(self.version) == LooseVersion("4.4.0"):
                                lang = 'HL' if cmvar[0] == 'H' else 'C'
                                self.cfg.update('configopts', '-DHDF5_%s_LIBRARIES=%s ' % (lang, libhdf5))

                    elif dep == 'PnetCDF':
                        self.cfg.update('configopts', '-DENABLE_PNETCDF=ON')

                    else:
                        libso = os.path.join(dep_root, dep_libdir, 'lib%s.%s' % (libname, shlib_ext))
                        self.cfg.update('configopts', '-D%s_LIBRARY=%s ' % (dep.upper(), libso))

            CMakeMake.configure_step(self)
Ejemplo n.º 2
0
    def configure_step(self):
        """Configure build: set config options and configure"""

        if LooseVersion(self.version) < LooseVersion("4.3"):
            self.cfg.update('configopts', "--enable-shared")

            if self.toolchain.options['pic']:
                self.cfg.update('configopts', '--with-pic')

#            tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
            tup = (os.getenv('FFLAGS'), os.getenv('CC'), os.getenv('F90'))
            self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)

            # add -DgFortran to CPPFLAGS when building with GCC
            if self.toolchain.comp_family() == toolchain.GCC:  #@UndefinedVariable
                self.cfg.update('configopts', 'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))

            ConfigureMake.configure_step(self)

        else:
            hdf5 = get_software_root('HDF5')
            if hdf5:
                env.setvar('HDF5_ROOT', hdf5)

            CMakeMake.configure_step(self)
Ejemplo n.º 3
0
    def configure_step(self):
        """Configure build: set config options and configure"""

        if LooseVersion(self.version) < LooseVersion("4.3"):
            self.cfg.update('configopts', "--enable-shared")

            if self.toolchain.options['pic']:
                self.cfg.update('configopts', '--with-pic')

            tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
            self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)

            # add -DgFortran to CPPFLAGS when building with GCC
            if self.toolchain.comp_family(
            ) == toolchain.GCC:  #@UndefinedVariable
                self.cfg.update(
                    'configopts',
                    'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))

            ConfigureMake.configure_step(self)

        else:
            hdf5 = get_software_root('HDF5')
            if hdf5:
                env.setvar('HDF5_ROOT', hdf5)

            CMakeMake.configure_step(self)
Ejemplo n.º 4
0
 def configure_step(self):
     """Custom configuration procedure for Eigen."""
     # start using CMake for Eigen 3.3.4 and newer versions
     # not done for older versions, since this implies using (a dummy-built) CMake as a build dependency,
     # which is a bit strange for a header-only library like Eigen...
     if LooseVersion(self.version) >= LooseVersion('3.3.4'):
         self.cfg['separate_build_dir'] = True
         # avoid that include files are installed into include/eigen3/Eigen, should be include/Eigen
         self.cfg.update('configopts', "-DINCLUDE_INSTALL_DIR=%s" % os.path.join(self.installdir, 'include'))
         CMakeMake.configure_step(self)
Ejemplo n.º 5
0
 def configure_step(self):
     """Custom configuration procedure for Eigen."""
     # start using CMake for Eigen 3.3.4 and newer versions
     # not done for older versions, since this implies using (a dummy-built) CMake as a build dependency,
     # which is a bit strange for a header-only library like Eigen...
     if LooseVersion(self.version) >= LooseVersion('3.3.4'):
         self.cfg['separate_build_dir'] = True
         # avoid that include files are installed into include/eigen3/Eigen, should be include/Eigen
         self.cfg.update('configopts', "-DINCLUDE_INSTALL_DIR=%s" % os.path.join(self.installdir, 'include'))
         CMakeMake.configure_step(self)
Ejemplo n.º 6
0
    def configure_step(self):
        """Configure build: set config options and configure"""

        shlib_ext = get_shared_lib_ext()

        if LooseVersion(self.version) < LooseVersion("4.3"):
            self.cfg.update('configopts', "--enable-shared")

            if self.toolchain.options['pic']:
                self.cfg.update('configopts', '--with-pic')

            tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
            self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)

            # add -DgFortran to CPPFLAGS when building with GCC
            if self.toolchain.comp_family(
            ) == toolchain.GCC:  #@UndefinedVariable
                self.cfg.update(
                    'configopts',
                    'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))

            ConfigureMake.configure_step(self)

        else:
            self.cfg.update(
                'configopts',
                '-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG " '
            )
            for (dep, libname) in [('cURL', 'curl'), ('HDF5', 'hdf5'),
                                   ('Szip', 'sz'), ('zlib', 'z')]:
                dep_root = get_software_root(dep)
                dep_libdir = get_software_libdir(dep)
                if dep_root:
                    incdir = os.path.join(dep_root, 'include')
                    self.cfg.update(
                        'configopts',
                        '-D%s_INCLUDE_DIR=%s ' % (dep.upper(), incdir))
                    if dep == 'HDF5':
                        env.setvar('HDF5_ROOT', dep_root)
                        libhdf5 = os.path.join(dep_root, dep_libdir,
                                               'libhdf5.%s' % shlib_ext)
                        self.cfg.update('configopts',
                                        '-DHDF5_LIB=%s ' % libhdf5)
                        libhdf5_hl = os.path.join(dep_root, dep_libdir,
                                                  'libhdf5_hl.%s' % shlib_ext)
                        self.cfg.update('configopts',
                                        '-DHDF5_HL_LIB=%s ' % libhdf5_hl)
                    else:
                        libso = os.path.join(dep_root, dep_libdir,
                                             'lib%s.%s' % (libname, shlib_ext))
                        self.cfg.update(
                            'configopts',
                            '-D%s_LIBRARY=%s ' % (dep.upper(), libso))

            CMakeMake.configure_step(self)
Ejemplo n.º 7
0
    def configure_step(self):
        """Configure BamTools build."""
        # BamTools requires an out of source build.
        builddir = os.path.join(self.cfg['start_dir'], 'build')
        try:
            mkdir(builddir)
            os.chdir(builddir)
        except OSError as err:
            raise EasyBuildError("Failed to move to %s: %s", builddir, err)

        CMakeMake.configure_step(self, srcdir='..')
Ejemplo n.º 8
0
    def configure_step(self):
        """Custom configuration for ROOT, add configure options."""

        # using ./configure is deprecated/broken in recent versions, need to use CMake instead
        if LooseVersion(self.version.lstrip('v')) >= LooseVersion('6.10'):
            if self.cfg['arch']:
                raise EasyBuildError("Specified value '%s' for 'arch' is not used, should not be set", self.cfg['arch'])

            cfitsio_root = get_software_root('CFITSIO')
            if cfitsio_root:
                self.cfg.update('configopts', '-DCFITSIO=%s' % cfitsio_root)

            fftw_root = get_software_root('FFTW')
            if fftw_root:
                self.cfg.update('configopts', '-Dbuiltin_fftw3=OFF -DFFTW_DIR=%s' % fftw_root)

            gsl_root = get_software_root('GSL')
            if gsl_root:
                self.cfg.update('configopts', '-DGSL_DIR=%s' % gsl_root)

            mesa_root = get_software_root('Mesa')
            if mesa_root:
                self.cfg.update('configopts', '-DDOPENGL_INCLUDE_DIR=%s' % os.path.join(mesa_root, 'include'))
                self.cfg.update('configopts', '-DOPENGL_gl_LIBRARY=%s' % os.path.join(mesa_root, 'lib', 'libGL.so'))

            python_root = get_software_root('Python')
            if python_root:
                pyshortver = '.'.join(get_software_version('Python').split('.')[:2])
                self.cfg.update('configopts', '-DPYTHON_EXECUTABLE=%s' % os.path.join(python_root, 'bin', 'python'))
                python_inc_dir = os.path.join(python_root, 'include', 'python%s' % pyshortver)
                self.cfg.update('configopts', '-DPYTHON_INCLUDE_DIR=%s' % python_inc_dir)
                python_lib = os.path.join(python_root, 'lib', 'libpython%s.so' % pyshortver)
                self.cfg.update('configopts', '-DPYTHON_LIBRARY=%s' % python_lib)

            if get_software_root('X11'):
                self.cfg.update('configopts', '-Dx11=ON')

            self.cfg['separate_build_dir'] = True
            CMakeMake.configure_step(self)
        else:
            if self.cfg['arch'] is None:
                raise EasyBuildError("No architecture specified to pass to configure script")

            self.cfg.update('configopts', "--etcdir=%s/etc/root " % self.installdir)

            cmd = "%s ./configure %s --prefix=%s %s" % (self.cfg['preconfigopts'],
                                                        self.cfg['arch'],
                                                        self.installdir,
                                                        self.cfg['configopts'])

            run_cmd(cmd, log_all=True, log_ok=True, simple=True)
Ejemplo n.º 9
0
 def configure_step(self):
     """Custom configuration procedure for Eigen."""
     # start using CMake for Eigen 3.3.4 and newer versions
     # not done for older versions, since this implies using CMake as a build dependency
     if LooseVersion(self.version) >= LooseVersion('3.3.4'):
         # Install headers as include/Eigen/*.h instead of the default include/eigen3/Eigen/*.h to make it easier
         # for dependencies to find the headers without setting anything in addition
         # Note: Path must be relative to the install prefix!
         self.cfg.update('configopts',
                         "-DINCLUDE_INSTALL_DIR=%s" % 'include')
         # Patch to make the relative path actually work.
         regex_subs = [
             ('CACHE PATH ("The directory relative to CMAKE.*PREFIX)',
              r'CACHE STRING \1')
         ]
         apply_regex_substitutions(
             os.path.join(self.cfg['start_dir'], 'CMakeLists.txt'),
             regex_subs)
         CMakeMake.configure_step(self)
Ejemplo n.º 10
0
    def configure_step(self):
        """Configure build: set config options and configure"""

        shlib_ext = get_shared_lib_ext()

        if LooseVersion(self.version) < LooseVersion("4.3"):
            self.cfg.update('configopts', "--enable-shared")

            if self.toolchain.options['pic']:
                self.cfg.update('configopts', '--with-pic')

            tup = (os.getenv('FFLAGS'), os.getenv('MPICC'), os.getenv('F90'))
            self.cfg.update('configopts', 'FCFLAGS="%s" CC="%s" FC="%s"' % tup)

            # add -DgFortran to CPPFLAGS when building with GCC
            if self.toolchain.comp_family() == toolchain.GCC:  #@UndefinedVariable
                self.cfg.update('configopts', 'CPPFLAGS="%s -DgFortran"' % os.getenv('CPPFLAGS'))

            ConfigureMake.configure_step(self)

        else:
            self.cfg.update('configopts', '-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG " ')
            for (dep, libname) in [('cURL', 'curl'), ('HDF5', 'hdf5'), ('Szip', 'sz'), ('zlib', 'z')]:
                dep_root = get_software_root(dep)
                dep_libdir = get_software_libdir(dep)
                if dep_root:
                    incdir = os.path.join(dep_root, 'include')
                    self.cfg.update('configopts', '-D%s_INCLUDE_DIR=%s ' % (dep.upper(), incdir))
                    if dep == 'HDF5':
                        env.setvar('HDF5_ROOT', dep_root)
                        libhdf5 = os.path.join(dep_root, dep_libdir, 'libhdf5.%s' % shlib_ext)
                        self.cfg.update('configopts', '-DHDF5_LIB=%s ' % libhdf5)
                        libhdf5_hl = os.path.join(dep_root, dep_libdir, 'libhdf5_hl.%s' % shlib_ext)
                        self.cfg.update('configopts', '-DHDF5_HL_LIB=%s ' % libhdf5_hl)
                    else:
                        libso = os.path.join(dep_root, dep_libdir, 'lib%s.%s' % (libname, shlib_ext))
                        self.cfg.update('configopts', '-D%s_LIBRARY=%s ' % (dep.upper(), libso))

            CMakeMake.configure_step(self)
Ejemplo n.º 11
0
class EB_BamTools(MakeCp, CMakeMake):
    """Support for building and installing BamTools."""
    def configure_step(self):
        """Configure BamTools build."""
        # BamTools requires an out of source build.
        builddir = os.path.join(self.cfg['start_dir'], 'build')
        try:
            mkdir(builddir)
            os.chdir(builddir)
        except OSError, err:
            raise EasyBuildError("Failed to move to %s: %s", builddir, err)

        CMakeMake.configure_step(self, srcdir='..')
Ejemplo n.º 12
0
class EB_BamTools(MakeCp, CMakeMake):
    """Support for building and installing BamTools."""

    def configure_step(self):
        """Configure BamTools build."""
        # BamTools requires an out of source build.
        try:
            builddir = os.path.join(self.cfg['start_dir'], 'build')
            mkdir(builddir)
            os.chdir(builddir)
        except OSError, err:
            self.log.error("")

        CMakeMake.configure_step(self, srcdir='..')
Ejemplo n.º 13
0
class EB_BamTools(MakeCp, CMakeMake):
    """Support for building and installing BamTools."""
    @staticmethod
    def extra_options(extra_vars=None):
        """Extra easyconfig parameters for BamTools."""
        extra = MakeCp.extra_options()
        # files_to_copy is not mandatory here, since we overwrite it in install_step
        extra['files_to_copy'][2] = CUSTOM
        return extra

    def configure_step(self):
        """Configure BamTools build."""
        # BamTools requires an out of source build.
        builddir = os.path.join(self.cfg['start_dir'], 'build')
        try:
            mkdir(builddir)
            os.chdir(builddir)
        except OSError, err:
            raise EasyBuildError("Failed to move to %s: %s", builddir, err)

        CMakeMake.configure_step(self, srcdir='..')
Ejemplo n.º 14
0
    def configure_step(self):
        """
        Configure build outside of source directory.
        """
        try:
            objdir = os.path.join(self.builddir, 'obj')
            os.makedirs(objdir)
            os.chdir(objdir)
        except OSError as err:
            raise EasyBuildError("Failed to prepare for configuration of PSI build: %s", err)

        env.setvar('F77FLAGS', os.getenv('F90FLAGS'))

        # In order to create new plugins with PSI, it needs to know the location of the source
        # and the obj dir after install. These env vars give that information to the configure script.
        self.psi_srcdir = os.path.basename(self.cfg['start_dir'].rstrip(os.sep))
        self.install_psi_objdir = os.path.join(self.installdir, 'obj')
        self.install_psi_srcdir = os.path.join(self.installdir, self.psi_srcdir)
        env.setvar('PSI_OBJ_INSTALL_DIR', self.install_psi_objdir)
        env.setvar('PSI_SRC_INSTALL_DIR', self.install_psi_srcdir)

        # explicitely specify Python binary to use
        pythonroot = get_software_root('Python')
        if not pythonroot:
            raise EasyBuildError("Python module not loaded.")

        # pre 4.0b5, they were using autotools, on newer it's CMake
        if LooseVersion(self.version) <= LooseVersion("4.0b5") and self.name == "PSI":
            # Use EB Boost
            boostroot = get_software_root('Boost')
            if not boostroot:
                raise EasyBuildError("Boost module not loaded.")

            self.log.info("Using configure based build")
            env.setvar('PYTHON', os.path.join(pythonroot, 'bin', 'python'))
            env.setvar('USE_SYSTEM_BOOST', 'TRUE')

            if self.toolchain.options.get('usempi', None):
                # PSI doesn't require a Fortran compiler itself, but may require it to link to BLAS/LAPACK correctly
                # we should always specify the sequential Fortran compiler,
                # to avoid problems with -lmpi vs -lmpi_mt during linking
                fcompvar = 'F77_SEQ'
            else:
                fcompvar = 'F77'

            # update configure options
            # using multi-threaded BLAS/LAPACK is important for performance,
            # cfr. http://sirius.chem.vt.edu/psi4manual/latest/installfile.html#sec-install-iii
            opt_vars = [
                ('cc', 'CC'),
                ('cxx', 'CXX'),
                ('fc', fcompvar),
                ('libdirs', 'LDFLAGS'),
                ('blas', 'LIBBLAS_MT'),
                ('lapack', 'LIBLAPACK_MT'),
            ]
            for (opt, var) in opt_vars:
                self.cfg.update('configopts', "--with-%s='%s'" % (opt, os.getenv(var)))

            # -DMPICH_IGNORE_CXX_SEEK dances around problem with order of stdio.h and mpi.h headers
            # both define SEEK_SET, this makes the one for MPI be ignored
            self.cfg.update('configopts', "--with-opt='%s -DMPICH_IGNORE_CXX_SEEK'" % os.getenv('CFLAGS'))

            # specify location of Boost
            self.cfg.update('configopts', "--with-boost=%s" % boostroot)

            # enable support for plugins
            self.cfg.update('configopts', "--with-plugins")

            ConfigureMake.configure_step(self, cmd_prefix=self.cfg['start_dir'])
        else:
            self.log.info("Using CMake based build")
            self.cfg.update('configopts', ' -DPYTHON_INTERPRETER=%s' % os.path.join(pythonroot, 'bin', 'python'))
            if self.name == 'PSI4' and LooseVersion(self.version) >= LooseVersion("1.2"):
                self.log.info("Remove the CMAKE_BUILD_TYPE test in PSI4 source and the downloaded dependencies!")
                self.log.info("Use PATCH_COMMAND in the corresponding CMakeLists.txt")
                self.cfg.update('configopts', ' -DCMAKE_BUILD_TYPE=EasyBuildRelease')
            else:
                self.cfg.update('configopts', ' -DCMAKE_BUILD_TYPE=Release')

            if self.toolchain.options.get('usempi', None):
                self.cfg.update('configopts', " -DENABLE_MPI=ON")

            if get_software_root('imkl'):
                self.cfg.update('configopts', " -DENABLE_CSR=ON -DBLAS_TYPE=MKL")

            if self.name == 'PSI4':
                pcmsolverroot = get_software_root('PCMSolver')
                if pcmsolverroot:
                    self.cfg.update('configopts', " -DENABLE_PCMSOLVER=ON")
                    if LooseVersion(self.version) < LooseVersion("1.2"):
                        self.cfg.update('configopts', " -DPCMSOLVER_ROOT=%s" % pcmsolverroot)
                    else:
                        self.cfg.update('configopts', " -DCMAKE_INSIST_FIND_PACKAGE_PCMSolver=ON "
                                        "-DPCMSolver_DIR=%s/share/cmake/PCMSolver" % pcmsolverroot)

                chempsroot = get_software_root('CheMPS2')
                if chempsroot:
                    self.cfg.update('configopts', " -DENABLE_CHEMPS2=ON")
                    if LooseVersion(self.version) < LooseVersion("1.2"):
                        self.cfg.update('configopts', " -DCHEMPS2_ROOT=%s" % chempsroot)
                    else:
                        self.cfg.update('configopts', " -DCMAKE_INSIST_FIND_PACKAGE_CheMPS2=ON "
                                        "-DCheMPS2_DIR=%s/share/cmake/CheMPS2" % chempsroot)

                #  Be aware, PSI4 wants exact versions of the following deps! built with CMake!!
                #  If you want to use non-CMake build versions, the you have to provide the
                #  corresponding Find<library-name>.cmake scripts
                #  In PSI4 version 1.2.1, you can check the corresponding CMakeLists.txt file
                #  in external/upstream/<library-name>/
                if LooseVersion(self.version) >= LooseVersion("1.2"):
                    for dep in ['libxc', 'Libint', 'pybind11', 'gau2grid']:
                        deproot = get_software_root(dep)
                        if deproot:
                            self.cfg.update('configopts', " -DCMAKE_INSIST_FIND_PACKAGE_%s=ON" % dep)
                            dep_dir = os.path.join(deproot, 'share', 'cmake', dep)
                            self.cfg.update('configopts', " -D%s_DIR=%s " % (dep, dep_dir))

            CMakeMake.configure_step(self, srcdir=self.cfg['start_dir'])
Ejemplo n.º 15
0
    def configure_step(self):
        """Custom configuration for ROOT, add configure options."""

        # ROOT includes an (old) copy of LLVM;
        # if LLVM is loaded as an indirect dep, we need to make sure
        # the location to its header files is not included in $CPATH
        llvm_root = get_software_root('LLVM')
        if llvm_root:
            llvm_inc = os.path.join(llvm_root, 'include')
            cpath = os.getenv('CPATH')
            if cpath:
                new_cpath = [
                    p for p in cpath.split(os.pathsep) if p != llvm_inc
                ]
                self.log.info(
                    "Filtered %s from $CPATH to avoid using LLVM loaded as indirect dependency",
                    llvm_inc)
                setvar('CPATH', os.pathsep.join(new_cpath))

        # using ./configure is deprecated/broken in recent versions, need to use CMake instead
        if LooseVersion(self.version.lstrip('v')) >= LooseVersion('6.10'):
            if self.cfg['arch']:
                raise EasyBuildError(
                    "Specified value '%s' for 'arch' is not used, should not be set",
                    self.cfg['arch'])

            cfitsio_root = get_software_root('CFITSIO')
            if cfitsio_root:
                self.cfg.update('configopts', '-DCFITSIO=%s' % cfitsio_root)

            fftw_root = get_software_root('FFTW')
            if fftw_root:
                self.cfg.update(
                    'configopts',
                    '-Dbuiltin_fftw3=OFF -DFFTW_DIR=%s' % fftw_root)

            gsl_root = get_software_root('GSL')
            if gsl_root:
                self.cfg.update('configopts', '-DGSL_DIR=%s' % gsl_root)

            mesa_root = get_software_root('Mesa')
            if mesa_root:
                self.cfg.update(
                    'configopts', '-DDOPENGL_INCLUDE_DIR=%s' %
                    os.path.join(mesa_root, 'include'))
                self.cfg.update(
                    'configopts', '-DOPENGL_gl_LIBRARY=%s' %
                    os.path.join(mesa_root, 'lib', 'libGL.so'))

            python_root = get_software_root('Python')
            if python_root:
                pyshortver = '.'.join(
                    get_software_version('Python').split('.')[:2])
                self.cfg.update(
                    'configopts', '-DPYTHON_EXECUTABLE=%s' %
                    os.path.join(python_root, 'bin', 'python'))
                python_inc_dir = find_glob_pattern(
                    os.path.join(python_root, 'include',
                                 'python%s*' % pyshortver))
                self.cfg.update('configopts',
                                '-DPYTHON_INCLUDE_DIR=%s' % python_inc_dir)
                python_lib = find_glob_pattern(
                    os.path.join(python_root, 'lib',
                                 'libpython%s*.so' % pyshortver))
                self.cfg.update('configopts',
                                '-DPYTHON_LIBRARY=%s' % python_lib)

            if get_software_root('X11'):
                self.cfg.update('configopts', '-Dx11=ON')

            CMakeMake.configure_step(self)
        else:
            if self.cfg['arch'] is None:
                raise EasyBuildError(
                    "No architecture specified to pass to configure script")

            self.cfg.update('configopts',
                            "--etcdir=%s/etc/root " % self.installdir)

            cmd = "%s ./configure %s --prefix=%s %s" % (
                self.cfg['preconfigopts'], self.cfg['arch'], self.installdir,
                self.cfg['configopts'])

            run_cmd(cmd, log_all=True, log_ok=True, simple=True)
    def configure_step(self, *args, **kwargs):
        """Main configuration using cmake"""

        PythonPackage.configure_step(self, *args, **kwargs)

        return CMakeMake.configure_step(self, *args, **kwargs)
Ejemplo n.º 17
0
 def configure_step(self, srcdir=None, builddir=None):
     """Configure build using CMake"""
     return CMakeMake.configure_step(self, srcdir=srcdir, builddir=builddir)
Ejemplo n.º 18
0
 def configure_step(self, *args, **kwargs):
     CMakeMake.configure_step(self, *args, **kwargs)
    def configure_step(self, *args, **kwargs):
        """Main configuration using cmake"""

        PythonPackage.configure_step(self, *args, **kwargs)

        return CMakeMake.configure_step(self, *args, **kwargs)
Ejemplo n.º 20
0
 def configure_step(self, srcdir=None, builddir=None):
     CMakeMake.configure_step(self, srcdir=srcdir, builddir=builddir)
Ejemplo n.º 21
0
 def configure_step(self, *args, **kwargs):
     """Configure using CMake."""
     CMakeMake.configure_step(self, *args, **kwargs)
Ejemplo n.º 22
0
    def configure_step(self):
        """
        Configure build outside of source directory.
        """
        try:
            objdir = os.path.join(self.builddir, 'obj')
            os.makedirs(objdir)
            os.chdir(objdir)
        except OSError as err:
            raise EasyBuildError(
                "Failed to prepare for configuration of PSI build: %s", err)

        env.setvar('F77FLAGS', os.getenv('F90FLAGS'))

        # In order to create new plugins with PSI, it needs to know the location of the source
        # and the obj dir after install. These env vars give that information to the configure script.
        self.psi_srcdir = os.path.basename(self.cfg['start_dir'].rstrip(
            os.sep))
        self.install_psi_objdir = os.path.join(self.installdir, 'obj')
        self.install_psi_srcdir = os.path.join(self.installdir,
                                               self.psi_srcdir)
        env.setvar('PSI_OBJ_INSTALL_DIR', self.install_psi_objdir)
        env.setvar('PSI_SRC_INSTALL_DIR', self.install_psi_srcdir)

        # explicitely specify Python binary to use
        pythonroot = get_software_root('Python')
        if not pythonroot:
            raise EasyBuildError("Python module not loaded.")

        # pre 4.0b5, they were using autotools, on newer it's CMake
        if LooseVersion(
                self.version) <= LooseVersion("4.0b5") and self.name == "PSI":
            # Use EB Boost
            boostroot = get_software_root('Boost')
            if not boostroot:
                raise EasyBuildError("Boost module not loaded.")

            self.log.info("Using configure based build")
            env.setvar('PYTHON', os.path.join(pythonroot, 'bin', 'python'))
            env.setvar('USE_SYSTEM_BOOST', 'TRUE')

            if self.toolchain.options.get('usempi', None):
                # PSI doesn't require a Fortran compiler itself, but may require it to link to BLAS/LAPACK correctly
                # we should always specify the sequential Fortran compiler,
                # to avoid problems with -lmpi vs -lmpi_mt during linking
                fcompvar = 'F77_SEQ'
            else:
                fcompvar = 'F77'

            # update configure options
            # using multi-threaded BLAS/LAPACK is important for performance,
            # cfr. http://sirius.chem.vt.edu/psi4manual/latest/installfile.html#sec-install-iii
            opt_vars = [
                ('cc', 'CC'),
                ('cxx', 'CXX'),
                ('fc', fcompvar),
                ('libdirs', 'LDFLAGS'),
                ('blas', 'LIBBLAS_MT'),
                ('lapack', 'LIBLAPACK_MT'),
            ]
            for (opt, var) in opt_vars:
                self.cfg.update('configopts',
                                "--with-%s='%s'" % (opt, os.getenv(var)))

            # -DMPICH_IGNORE_CXX_SEEK dances around problem with order of stdio.h and mpi.h headers
            # both define SEEK_SET, this makes the one for MPI be ignored
            self.cfg.update(
                'configopts', "--with-opt='%s -DMPICH_IGNORE_CXX_SEEK'" %
                os.getenv('CFLAGS'))

            # specify location of Boost
            self.cfg.update('configopts', "--with-boost=%s" % boostroot)

            # enable support for plugins
            self.cfg.update('configopts', "--with-plugins")

            ConfigureMake.configure_step(self,
                                         cmd_prefix=self.cfg['start_dir'])
        else:
            self.log.info("Using CMake based build")
            self.cfg.update(
                'configopts', ' -DPYTHON_INTERPRETER=%s' %
                os.path.join(pythonroot, 'bin', 'python'))
            if self.name == 'PSI4' and LooseVersion(
                    self.version) >= LooseVersion("1.2"):
                self.log.info(
                    "Remove the CMAKE_BUILD_TYPE test in PSI4 source and the downloaded dependencies!"
                )
                self.log.info(
                    "Use PATCH_COMMAND in the corresponding CMakeLists.txt")
                self.cfg.update('configopts',
                                ' -DCMAKE_BUILD_TYPE=EasyBuildRelease')
            else:
                self.cfg.update('configopts', ' -DCMAKE_BUILD_TYPE=Release')

            if self.toolchain.options.get('usempi', None):
                self.cfg.update('configopts', " -DENABLE_MPI=ON")

            if get_software_root('imkl'):
                self.cfg.update('configopts',
                                " -DENABLE_CSR=ON -DBLAS_TYPE=MKL")

            if self.name == 'PSI4':
                pcmsolverroot = get_software_root('PCMSolver')
                if pcmsolverroot:
                    self.cfg.update('configopts', " -DENABLE_PCMSOLVER=ON")
                    if LooseVersion(self.version) < LooseVersion("1.2"):
                        self.cfg.update('configopts',
                                        " -DPCMSOLVER_ROOT=%s" % pcmsolverroot)
                    else:
                        self.cfg.update(
                            'configopts',
                            " -DCMAKE_INSIST_FIND_PACKAGE_PCMSolver=ON "
                            "-DPCMSolver_DIR=%s/share/cmake/PCMSolver" %
                            pcmsolverroot)

                chempsroot = get_software_root('CheMPS2')
                if chempsroot:
                    self.cfg.update('configopts', " -DENABLE_CHEMPS2=ON")
                    if LooseVersion(self.version) < LooseVersion("1.2"):
                        self.cfg.update('configopts',
                                        " -DCHEMPS2_ROOT=%s" % chempsroot)
                    else:
                        self.cfg.update(
                            'configopts',
                            " -DCMAKE_INSIST_FIND_PACKAGE_CheMPS2=ON "
                            "-DCheMPS2_DIR=%s/share/cmake/CheMPS2" %
                            chempsroot)

                #  Be aware, PSI4 wants exact versions of the following deps! built with CMake!!
                #  If you want to use non-CMake build versions, the you have to provide the
                #  corresponding Find<library-name>.cmake scripts
                #  In PSI4 version 1.2.1, you can check the corresponding CMakeLists.txt file
                #  in external/upstream/<library-name>/
                if LooseVersion(self.version) >= LooseVersion("1.2"):
                    for dep in ['libxc', 'Libint', 'pybind11', 'gau2grid']:
                        deproot = get_software_root(dep)
                        if deproot:
                            self.cfg.update(
                                'configopts',
                                " -DCMAKE_INSIST_FIND_PACKAGE_%s=ON" % dep)
                            dep_dir = os.path.join(deproot, 'share', 'cmake',
                                                   dep)
                            self.cfg.update('configopts',
                                            " -D%s_DIR=%s " % (dep, dep_dir))

            CMakeMake.configure_step(self, srcdir=self.cfg['start_dir'])
Ejemplo n.º 23
0
 def configure_step(self):
     PythonPackage.configure_step(self)
     return CMakeMake.configure_step(self)
Ejemplo n.º 24
0
class EB_PSI(CMakeMake):
    """
    Support for building and installing PSI
    """

    def __init__(self, *args, **kwargs):
        """Initialize class variables custom to PSI."""
        super(EB_PSI, self).__init__(*args, **kwargs)

        self.psi_srcdir = None
        self.install_psi_objdir = None
        self.install_psi_srcdir = None

    @staticmethod
    def extra_options():
        """Extra easyconfig parameters specific to PSI."""

        extra_vars = {
            # always include running PSI unit tests (takes about 2h or less)
            'runtest': ["tests TESTFLAGS='-u -q'", "Run tests included with PSI, without interruption.", BUILD],
        }
        return CMakeMake.extra_options(extra_vars)

    def configure_step(self):
        """
        Configure build outside of source directory.
        """
        try:
            objdir = os.path.join(self.builddir, 'obj')
            os.makedirs(objdir)
            os.chdir(objdir)
        except OSError, err:
            raise EasyBuildError("Failed to prepare for configuration of PSI build: %s", err)

        env.setvar('F77FLAGS', os.getenv('F90FLAGS'))

        # In order to create new plugins with PSI, it needs to know the location of the source
        # and the obj dir after install. These env vars give that information to the configure script.
        self.psi_srcdir = os.path.basename(self.cfg['start_dir'].rstrip(os.sep))
        self.install_psi_objdir = os.path.join(self.installdir, 'obj')
        self.install_psi_srcdir = os.path.join(self.installdir, self.psi_srcdir)
        env.setvar('PSI_OBJ_INSTALL_DIR', self.install_psi_objdir)
        env.setvar('PSI_SRC_INSTALL_DIR', self.install_psi_srcdir)

        # explicitely specify Python binary to use
        pythonroot = get_software_root('Python')
        if not pythonroot:
            raise EasyBuildError("Python module not loaded.")

        # Use EB Boost
        boostroot = get_software_root('Boost')
        if not boostroot:
            raise EasyBuildError("Boost module not loaded.")

        # pre 4.0b5, they were using autotools, on newer it's CMake
        if LooseVersion(self.version) <= LooseVersion("4.0b5"):
            env.setvar('PYTHON', os.path.join(pythonroot, 'bin', 'python'))
            env.setvar('USE_SYSTEM_BOOST', 'TRUE')

            if self.toolchain.options.get('usempi', None):
                # PSI doesn't require a Fortran compiler itself, but may require it to link to BLAS/LAPACK correctly
                # we should always specify the sequential Fortran compiler,
                # to avoid problems with -lmpi vs -lmpi_mt during linking
                fcompvar = 'F77_SEQ'
            else:
                fcompvar = 'F77'

            # update configure options
            # using multi-threaded BLAS/LAPACK is important for performance,
            # cfr. http://sirius.chem.vt.edu/psi4manual/latest/installfile.html#sec-install-iii
            opt_vars = [
                ('cc', 'CC'),
                ('cxx', 'CXX'),
                ('fc', fcompvar),
                ('libdirs', 'LDFLAGS'),
                ('blas', 'LIBBLAS_MT'),
                ('lapack', 'LIBLAPACK_MT'),
            ]
            for (opt, var) in opt_vars:
                self.cfg.update('configopts', "--with-%s='%s'" % (opt, os.getenv(var)))

            # -DMPICH_IGNORE_CXX_SEEK dances around problem with order of stdio.h and mpi.h headers
            # both define SEEK_SET, this makes the one for MPI be ignored
            self.cfg.update('configopts', "--with-opt='%s -DMPICH_IGNORE_CXX_SEEK'" % os.getenv('CFLAGS'))

            # specify location of Boost
            self.cfg.update('configopts', "--with-boost=%s" % boostroot)

            # enable support for plugins
            self.cfg.update('configopts', "--with-plugins")

            ConfigureMake.configure_step(self, cmd_prefix=self.cfg['start_dir'])
        else:
            self.cfg['configopts'] += "-DPYTHON_INTERPRETER=%s " % os.path.join(pythonroot, 'bin', 'python')
            self.cfg['configopts'] += "-DCMAKE_BUILD_TYPE=Release "

            if self.toolchain.options.get('usempi', None):
                self.cfg['configopts'] += "-DENABLE_MPI=ON "

            if get_software_root('impi'):
                self.cfg['configopts'] += "-DENABLE_CSR=ON -DBLAS_TYPE=MKL "

            CMakeMake.configure_step(self, srcdir=self.cfg['start_dir'])
 def configure_step(self):
     """Configure BamTools build."""
     CMakeMake.configure_step(self)
Ejemplo n.º 26
0
    def configure_step(self):
        """Custom configuration procedure for NEURON."""
        if LooseVersion(self.version) < LooseVersion('7.8.1'):

            # make sure we're using the correct configure command
            # (required because custom easyconfig parameters from CMakeMake are picked up)
            self.cfg['configure_cmd'] = "./configure"

            # enable support for distributed simulations if desired
            if self.cfg['paranrn']:
                self.cfg.update('configopts', '--with-paranrn')

            # specify path to InterViews if it is available as a dependency
            interviews_root = get_software_root('InterViews')
            if interviews_root:
                self.cfg.update('configopts', "--with-iv=%s" % interviews_root)
            else:
                self.cfg.update('configopts', "--without-iv")

            # optionally enable support for Python as alternative interpreter
            python_root = get_software_root('Python')
            if python_root:
                self.with_python = True
                self.cfg.update('configopts', "--with-nrnpython=%s/bin/python" % python_root)

            # determine host CPU type
            cmd = "./config.guess"
            (out, ec) = run_cmd(cmd, simple=False)

            self.hostcpu = out.split('\n')[0].split('-')[0]
            self.log.debug("Determined host CPU type as %s" % self.hostcpu)

            # determine Python lib dir
            self.pylibdir = det_pylibdir()

            # complete configuration with configure_method of parent
            ConfigureMake.configure_step(self)
        else:
            # enable support for distributed simulations if desired
            if self.cfg['paranrn']:
                self.cfg.update('configopts', '-DNRN_ENABLE_MPI=ON')
            else:
                self.cfg.update('configopts', '-DNRN_ENABLE_MPI=OFF')

            # specify path to InterViews if it is available as a dependency
            interviews_root = get_software_root('InterViews')
            if interviews_root:
                self.cfg.update('configopts', "-DIV_DIR=%s -DNRN_ENABLE_INTERVIEWS=ON" % interviews_root)
            else:
                self.cfg.update('configopts', "-DNRN_ENABLE_INTERVIEWS=OFF")

            # no longer used it seems
            self.hostcpu = ''

            # optionally enable support for Python as alternative interpreter
            python_root = get_software_root('Python')
            if python_root:
                self.with_python = True
                self.cfg.update('configopts', "-DNRN_ENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=%s/bin/python" % python_root)
                self.cfg.update('configopts', "-DNRN_ENABLE_MODULE_INSTALL=ON "
                                "-DNRN_MODULE_INSTALL_OPTIONS='--prefix=%s'" % self.installdir)
            else:
                self.cfg.update('configopts', "-DNRN_ENABLE_PYTHON=OFF")

            # determine Python lib dir
            self.pylibdir = det_pylibdir()

            # complete configuration with configure_method of parent
            CMakeMake.configure_step(self)