Пример #1
0
    def prepare_step(self, *args, **kwargs):
        """Prepare environment for installing OpenCV."""
        super(EB_OpenCV, self).prepare_step(*args, **kwargs)

        self.pylibdir = det_pylibdir()

        ippicv_tgz = glob.glob(os.path.join(self.builddir, 'ippicv*.tgz'))
        if ippicv_tgz:
            if len(ippicv_tgz) == 1:
                # copy ippicv tarball in the right place
                # expected location is 3rdparty/ippicv/downloads/linux-<md5sum>/
                ippicv_tgz = ippicv_tgz[0]
                ippicv_tgz_md5 = compute_checksum(ippicv_tgz,
                                                  checksum_type='md5')
                target_subdir = os.path.join('3rdparty', 'ippicv', 'downloads',
                                             'linux-%s' % ippicv_tgz_md5)
                copy([ippicv_tgz],
                     os.path.join(self.cfg['start_dir'], target_subdir))

                self.cfg.update('configopts', '-DWITH_IPP=ON')

            else:
                raise EasyBuildError(
                    "Found multiple ippicv*.tgz source tarballs in %s: %s",
                    self.builddir, ippicv_tgz)
    def install_step(self):
        """Install python but only keep the bits we need"""
        super(EB_Tkinter, self).install_step()

        tmpdir = tempfile.mkdtemp(dir=self.builddir)

        self.tkinter_so_basename = self.get_tkinter_so_basename(False)
        if LooseVersion(self.version) >= LooseVersion('3'):
            tkparts = [
                "tkinter",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]
        else:
            tkparts = [
                "lib-tk",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]

        pylibdir = os.path.join(self.installdir, det_pylibdir())
        copy([os.path.join(os.path.dirname(pylibdir), x) for x in tkparts],
             tmpdir)

        remove_dir(self.installdir)

        move_file(os.path.join(tmpdir, tkparts[0]),
                  os.path.join(pylibdir, tkparts[0]))
        move_file(os.path.join(tmpdir, self.tkinter_so_basename),
                  os.path.join(pylibdir, self.tkinter_so_basename))
Пример #3
0
    def install_step(self):
        """Install python but only keep the bits we need"""
        super(EB_Tkinter, self).install_step()

        tmpdir = tempfile.mkdtemp(dir=self.builddir)

        pylibdir = os.path.join(self.installdir, os.path.dirname(det_pylibdir()))
        shlib_ext = get_shared_lib_ext()
        tkinter_so = os.path.join(pylibdir, 'lib-dynload', '_tkinter*.' + shlib_ext)
        tkinter_so_hits = glob.glob(tkinter_so)
        if len(tkinter_so_hits) != 1:
            raise EasyBuildError("Expected to find exactly one _tkinter*.so: %s", tkinter_so_hits)
        self.tkinter_so_basename = os.path.basename(tkinter_so_hits[0])
        if LooseVersion(self.version) >= LooseVersion('3'):
            tkparts = ["tkinter", os.path.join("lib-dynload", self.tkinter_so_basename)]
        else:
            tkparts = ["lib-tk", os.path.join("lib-dynload", self.tkinter_so_basename)]

        copy([os.path.join(pylibdir, x) for x in tkparts], tmpdir)

        rmtree2(self.installdir)

        mkdir(pylibdir, parents=True)
        try:
            shutil.move(os.path.join(tmpdir, tkparts[0]), pylibdir)
            shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])), pylibdir)
        except (IOError, OSError) as err:
            raise EasyBuildError("Failed to move Tkinter back to the install directory: %s", err)
Пример #4
0
    def prepare_step(self, *args, **kwargs):
        """Prepare environment for installing OpenCV."""
        super(EB_OpenCV, self).prepare_step(*args, **kwargs)

        self.pylibdir = det_pylibdir()

        if get_cpu_architecture() == X86_64:
            # IPP are Intel's Integrated Performance Primitives - so only make sense on X86_64
            ippicv_tgz = glob.glob(os.path.join(self.builddir, 'ippicv*.tgz'))
            if ippicv_tgz:
                if len(ippicv_tgz) == 1:
                    # copy ippicv tarball in the right place
                    # expected location is 3rdparty/ippicv/downloads/linux-<md5sum>/
                    ippicv_tgz = ippicv_tgz[0]
                    ippicv_tgz_md5 = compute_checksum(ippicv_tgz,
                                                      checksum_type='md5')
                    target_subdir = os.path.join('3rdparty', 'ippicv',
                                                 'downloads',
                                                 'linux-%s' % ippicv_tgz_md5)
                    copy([ippicv_tgz],
                         os.path.join(self.cfg['start_dir'], target_subdir))

                    self.cfg.update('configopts', '-DWITH_IPP=ON')

                    # for recent OpenCV 3.x versions (and newer), we must also specify the download location
                    # to prevent that the ippicv tarball is re-downloaded
                    if LooseVersion(self.version) >= LooseVersion('3.4.4'):
                        self.cfg.update(
                            'configopts',
                            '-DOPENCV_DOWNLOAD_PATH=%s' % self.builddir)
                else:
                    raise EasyBuildError(
                        "Found multiple ippicv*.tgz source tarballs in %s: %s",
                        self.builddir, ippicv_tgz)
    def install_step(self):
        """
        Custom installation procedure for OpenCV: also copy IPP library into lib subdirectory of installation directory.
        """
        super(EB_OpenCV, self).install_step()

        if 'WITH_IPP=ON' in self.cfg['configopts']:
            ipp_libs = glob.glob(os.path.join('3rdparty', 'ippicv', 'ippicv_lnx', 'lib', 'intel64', 'libippicv.*'))
            copy(ipp_libs, os.path.join(self.installdir, 'lib'))
Пример #6
0
    def install_step(self):
        """Install Boost by copying files to install dir."""

        self.log.info("Copying %s to installation dir %s", self.objdir, self.installdir)
        if self.cfg['only_python_bindings'] and 'Python' in self.cfg['multi_deps'] and self.iter_idx > 0:
            self.log.info("Main installation should already exist, only copying over missing Python libraries.")
            copy(glob.glob(os.path.join(self.objdir, 'lib', 'libboost_python*')), os.path.join(self.installdir, 'lib'))
        else:
            copy(glob.glob(os.path.join(self.objdir, '*')), self.installdir)
    def install_step(self):
        """Custom install step for Scipion."""

        copy(['config', 'pyworkflow', 'scipion', 'software'], self.installdir)
        datadir = os.path.join(self.installdir, 'data', 'tests')
        mkdir(datadir, parents=True)
        mkdir(os.path.join(self.installdir, 'bin'))
        linktarget = os.path.join(self.installdir, 'bin', 'scipion')
        symlink(os.path.join('..', 'scipion'),
                linktarget,
                use_abspath_source=False)
Пример #8
0
    def install_step(self):
        """
        Custom installation procedure for OpenCV: also copy IPP library into lib subdirectory of installation directory.
        """
        super(EB_OpenCV, self).install_step()

        if 'WITH_IPP=ON' in self.cfg['configopts']:
            ipp_libs = glob.glob(
                os.path.join('3rdparty', 'ippicv', 'ippicv_lnx', 'lib',
                             'intel64', 'libippicv.*'))
            copy(ipp_libs, os.path.join(self.installdir, 'lib'))
Пример #9
0
    def install_step(self):
        """
        Custom installation procedure for OpenCV: also copy IPP library into lib subdirectory of installation directory.
        """
        super(EB_OpenCV, self).install_step()

        if 'WITH_IPP=ON' in self.cfg['configopts']:
            common_dir = os.path.join('3rdparty', 'ippicv', 'ippicv_lnx')

            # for some recent OpenCV 3.x versions, libippicv.a is now in a subdirectory named 'icv'
            if LooseVersion(self.version) >= LooseVersion('3.4.4'):
                ipp_libs = glob.glob(os.path.join(common_dir, 'icv', 'lib', 'intel64', 'libippicv.*'))
            else:
                ipp_libs = glob.glob(os.path.join(common_dir, 'lib', 'intel64', 'libippicv.*'))

            copy(ipp_libs, os.path.join(self.installdir, 'lib'))
Пример #10
0
    def install_step(self):
        """Custom install step for netpbm."""
        # Preinstallation to a tmp directory. Can't install directly to installdir because the make command fails if the
        # directory already exists
        cmd = "make package pkgdir=%s/pkg" % self.builddir
        (out, _) = run_cmd(cmd, log_all=True, simple=False)

        # Move things to installdir
        copy(["%s/pkg/%s" % (self.builddir, x) for x in os.listdir("%s/pkg/" % self.builddir)], self.installdir)

        # Need to do manually the last bits of the installation
        configs = [
            ("%s/config_template" % self.installdir, "%s/bin/netpbm-config" % self.installdir),
            ("%s/pkgconfig_template" % self.installdir, "%s/lib/pkgconfig/netpbm.pc" % self.installdir)
        ]

        mkdir("%s/lib/pkgconfig" % self.installdir)
        for template, config_file in configs:
            move_file(template, config_file)
            for line in fileinput.input(config_file, inplace=1, backup='.orig'):
                if re.match(r"^@", line):
                    continue
                else:
                    line = re.sub(r'@VERSION@', 'Netpbm %s' % self.version, line)
                    line = re.sub(r'@DATADIR@', '%s/lib' % self.installdir, line)
                    line = re.sub(r'@LINKDIR@', '%s/lib' % self.installdir, line)
                    line = re.sub(r'@INCLUDEDIR@', '%s/include' % self.installdir, line)
                    line = re.sub(r'@BINDIR@', '%s/bin' % self.installdir, line)

                sys.stdout.write(line)

        adjust_permissions("%s/bin/netpbm-config" % self.installdir, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
        move_file("%s/link/libnetpbm.a" % self.installdir, "%s/lib/libnetpbm.a" % self.installdir)
        symlink("%s/lib/libnetpbm.so.11" % self.installdir, "%s/lib/libnetpbm.so" % self.installdir)
        for f in os.listdir("%s/misc/" % self.installdir):
            move_file("%s/misc/%s" % (self.installdir, f), "%s/lib/%s" % (self.installdir, f))
        rmtree2("%s/misc/" % self.installdir)
        rmtree2("%s/link/" % self.installdir)

        headers = os.listdir("%s/include/netpbm" % self.installdir)
        for header in headers:
            symlink("%s/include/netpbm/%s" % (self.installdir, header), "%s/include/%s" % (self.installdir, header))

        return out
    def prepare_step(self, *args, **kwargs):
        """Prepare environment for installing OpenCV."""
        super(EB_OpenCV, self).prepare_step(*args, **kwargs)

        self.pylibdir = det_pylibdir()

        ippicv_tgz = glob.glob(os.path.join(self.builddir, 'ippicv*.tgz'))
        if ippicv_tgz:
            if len(ippicv_tgz) == 1:
                # copy ippicv tarball in the right place
                # expected location is 3rdparty/ippicv/downloads/linux-<md5sum>/
                ippicv_tgz = ippicv_tgz[0]
                ippicv_tgz_md5 = compute_checksum(ippicv_tgz, checksum_type='md5')
                target_subdir = os.path.join('3rdparty', 'ippicv', 'downloads', 'linux-%s' % ippicv_tgz_md5)
                copy([ippicv_tgz], os.path.join(self.cfg['start_dir'], target_subdir))

                self.cfg.update('configopts', '-DWITH_IPP=ON')

            else:
                raise EasyBuildError("Found multiple ippicv*.tgz source tarballs in %s: %s", self.builddir, ippicv_tgz)
Пример #12
0
    def install_step(self):
        """Install python but only keep the bits we need"""
        super(EB_Tkinter, self).install_step()

        tmpdir = tempfile.mkdtemp(dir=self.builddir)

        pylibdir = os.path.join(self.installdir,
                                os.path.dirname(det_pylibdir()))
        shlib_ext = get_shared_lib_ext()
        tkinter_so = os.path.join(pylibdir, 'lib-dynload',
                                  '_tkinter*.' + shlib_ext)
        tkinter_so_hits = glob.glob(tkinter_so)
        if len(tkinter_so_hits) != 1:
            raise EasyBuildError(
                "Expected to find exactly one _tkinter*.so: %s",
                tkinter_so_hits)
        self.tkinter_so_basename = os.path.basename(tkinter_so_hits[0])
        if LooseVersion(self.version) >= LooseVersion('3'):
            tkparts = [
                "tkinter",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]
        else:
            tkparts = [
                "lib-tk",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]

        copy([os.path.join(pylibdir, x) for x in tkparts], tmpdir)

        rmtree2(self.installdir)

        mkdir(pylibdir, parents=True)
        try:
            shutil.move(os.path.join(tmpdir, tkparts[0]), pylibdir)
            shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])),
                        pylibdir)
        except (IOError, OSError) as err:
            raise EasyBuildError(
                "Failed to move Tkinter back to the install directory: %s",
                err)
Пример #13
0
    def install_step(self):
        "Install NVIDIA libs simply by copying files. We can't user the installer because it requires root privileges."

        # list of libs
        libs = expand_glob_paths([os.path.join(self.libsdir, 'lib*.so*')])
        libs += expand_glob_paths([os.path.join(self.libsdir, '*.la')])
        libs += [os.path.join(self.libsdir, 'nvidia_drv.so')]

        # list of binaries
        binaries = ['nvidia-bug-report.sh',
                    'nvidia-cuda-mps-control',
                    'nvidia-cuda-mps-server',
                    'nvidia-debugdump',
                    'nvidia-settings',
                    'nvidia-smi',
                    'nvidia-xconfig']
        binaries = [os.path.join(self.libsdir, x) for x in binaries]

        # list of manpages
        manpages = ['nvidia-settings.1.gz',
                    'nvidia-cuda-mps-control.1.gz',
                    'nvidia-xconfig.1.gz',
                    'nvidia-smi.1.gz']
        manpages = [os.path.join(self.libsdir, x) for x in manpages]

        copy(libs, os.path.join(self.installdir, 'lib64'))
        copy(binaries, os.path.join(self.installdir, 'bin'))
        copy(manpages, os.path.join(self.installdir, 'man', 'man1'))
    def install_step(self):
        """Custom install procedure for MRtrix."""
        if LooseVersion(self.version) < LooseVersion('0.3'):
            cmd = "python build -verbose install=%s linkto=" % self.installdir
            run_cmd(cmd, log_all=True, simple=True, log_ok=True)

        elif LooseVersion(self.version) >= LooseVersion('3.0'):
            copy(os.path.join(self.builddir, 'bin'), self.installdir)
            copy(os.path.join(self.builddir, 'lib'), self.installdir)

        elif LooseVersion(self.version) >= LooseVersion('0.3.14'):
            copy(glob.glob(os.path.join(self.builddir, 'release', '*')), self.installdir)
            copy(os.path.join(self.builddir, 'scripts'), self.installdir)
            # some scripts expect 'release/bin' to be there, so we put a symlink in place
            symlink(self.installdir, os.path.join(self.installdir, 'release'))
Пример #15
0
    def install_step(self):
        """Custom install procedure for MRtrix."""
        if LooseVersion(self.version) < LooseVersion('0.3'):
            cmd = "python build -verbose install=%s linkto=" % self.installdir
            run_cmd(cmd, log_all=True, simple=True, log_ok=True)

        elif LooseVersion(self.version) >= LooseVersion('3.0'):
            copy(os.path.join(self.builddir, 'bin'), self.installdir)
            copy(os.path.join(self.builddir, 'lib'), self.installdir)

        elif LooseVersion(self.version) >= LooseVersion('0.3.14'):
            copy(glob.glob(os.path.join(self.builddir, 'release', '*')), self.installdir)
            copy(os.path.join(self.builddir, 'scripts'), self.installdir)
            # some scripts expect 'release/bin' to be there, so we put a symlink in place
            symlink(self.installdir, os.path.join(self.installdir, 'release'))
Пример #16
0
    def install_step(self):
        """Install python but only keep the bits we need"""
        super(EB_Tkinter, self).install_step()

        tmpdir = tempfile.mkdtemp(dir=self.builddir)

        pylibdir = os.path.join(self.installdir,
                                os.path.dirname(det_pylibdir()))
        tkparts = ["lib-tk", "lib-dynload/_tkinter.so"]

        copy([os.path.join(pylibdir, x) for x in tkparts], tmpdir)

        rmtree2(self.installdir)

        mkdir(pylibdir, parents=True)
        try:
            shutil.move(os.path.join(tmpdir, tkparts[0]), pylibdir)
            shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])),
                        pylibdir)
        except (IOError, OSError) as err:
            raise EasyBuildError(
                "Failed to move Tkinter back to the install directory: %s",
                err)
Пример #17
0
    def install_step(self):
        """Install python but only keep the bits we need"""
        super(EB_Tkinter, self).install_step()

        tmpdir = tempfile.mkdtemp(dir=self.builddir)

        pylibdir = os.path.join(self.installdir,
                                os.path.dirname(det_pylibdir()))
        shlib_ext = get_shared_lib_ext()
        tkinter_so = os.path.join(pylibdir, 'lib-dynload',
                                  '_tkinter*.' + shlib_ext)
        tkinter_so_hits = glob.glob(tkinter_so)
        if len(tkinter_so_hits) != 1:
            raise EasyBuildError(
                "Expected to find exactly one _tkinter*.so: %s",
                tkinter_so_hits)
        self.tkinter_so_basename = os.path.basename(tkinter_so_hits[0])
        if LooseVersion(self.version) >= LooseVersion('3'):
            tkparts = [
                "tkinter",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]
        else:
            tkparts = [
                "lib-tk",
                os.path.join("lib-dynload", self.tkinter_so_basename)
            ]

        copy([os.path.join(pylibdir, x) for x in tkparts], tmpdir)

        remove_dir(self.installdir)

        move_file(os.path.join(tmpdir, tkparts[0]),
                  os.path.join(pylibdir, tkparts[0]))
        tkinter_so = os.path.basename(tkparts[1])
        move_file(os.path.join(tmpdir, tkinter_so),
                  os.path.join(pylibdir, tkinter_so))
Пример #18
0
    def install_step(self):
        """Install Boost by copying file to install dir."""

        self.log.info("Copying %s to installation dir %s" %
                      (self.objdir, self.installdir))
        copy(glob.glob(os.path.join(self.objdir, '*')), self.installdir)
Пример #19
0
    def install_step(self):
        """Install Boost by copying file to install dir."""

        self.log.info("Copying %s to installation dir %s" % (self.objdir, self.installdir))
        copy(glob.glob(os.path.join(self.objdir, '*')), self.installdir)