def post_install_step(self):
        """Custom post install step for FFTW.MPI"""

        # remove everything except include files that are already in non-MPI FFTW dependency.
        remove(
            glob.glob(os.path.join(self.installdir, 'lib', 'libfftw.*')) +
            glob.glob(os.path.join(self.installdir, 'lib', 'libfftw[lf].*')) +
            [
                os.path.join(self.installdir, p)
                for p in ['bin', 'lib/pkgconfig', 'lib/cmake', 'share']
            ])
        super(EB_FFTW_period_MPI, self).post_install_step()
예제 #2
0
    def test_step(self):
        """Run DOLFIN demos by means of test."""

        if self.cfg['runtest']:

            # set cache/error dirs for Instant
            tmpdir = tempfile.mkdtemp()
            instant_cache_dir = os.path.join(tmpdir, '.instant', 'cache')
            instant_error_dir = os.path.join(tmpdir, '.instant', 'error')
            try:
                os.makedirs(instant_cache_dir)
                os.makedirs(instant_error_dir)
            except OSError as err:
                raise EasyBuildError(
                    "Failed to create Instant cache/error dirs: %s", err)

            env_vars = [
                ('INSTANT_CACHE_DIR', instant_cache_dir),
                ('INSTANT_ERROR_DIR', instant_error_dir),
            ]
            env_var_cmds = ' && '.join(
                ['export %s="%s"' % (var, val) for (var, val) in env_vars])

            # test command templates
            cmd_template_python = " && ".join([
                env_var_cmds,
                "cd %(dir)s",
                "python demo_%(name)s.py",
                "cd -",
            ])

            cpp_cmds = [
                env_var_cmds,
                "cd %(dir)s",
            ]
            if LooseVersion(self.version) < LooseVersion('1.1'):
                cpp_cmds.append("cmake . %s" % self.saved_configopts)

            cpp_cmds.extend([
                "make VERBOSE=1",
                "./demo_%(name)s",
                "cd -",
            ])
            cmd_template_cpp = " && ".join(cpp_cmds)

            # list based on demos available for DOLFIN v1.0.0
            pde_demos = [
                'biharmonic', 'cahn-hilliard', 'hyperelasticity',
                'mixed-poisson', 'navier-stokes', 'poisson', 'stokes-iterative'
            ]

            if LooseVersion(self.version) < LooseVersion('1.1'):
                demos = [os.path.join('demo', 'la', 'eigenvalue')] + [
                    os.path.join('demo', 'pde', x) for x in pde_demos
                ]
            else:
                # verified with v1.6.0
                demos = [
                    os.path.join('demo', 'documented', x) for x in pde_demos
                ]

            # construct commands
            cmds = [
                tmpl % {
                    'dir': os.path.join(d, subdir),
                    'name': os.path.basename(d)
                } for d in demos
                for (tmpl, subdir) in [(cmd_template_cpp, 'cpp')]
            ]

            # exclude Python tests for now, because they 'hang' sometimes (unclear why)
            # they can be reinstated once run_cmd (or its equivalent) has support for timeouts
            # see https://github.com/easybuilders/easybuild-framework/issues/581
            #for (tmpl, subdir) in [(cmd_template_python, 'python'), (cmd_template_cpp, 'cpp')]]

            # subdomains-poisson has no C++ get_version, only Python
            # Python tests excluded, see above
            #name = 'subdomains-poisson'
            #path = os.path.join('demo', 'pde', name, 'python')
            #cmds += [cmd_template_python % {'dir': path, 'name': name}]

            # supply empty argument to each command
            for cmd in cmds:
                run_cmd(cmd, log_all=True)

            # clean up temporary dir
            remove(tmpdir)
    def test_step(self):
        """Run DOLFIN demos by means of test."""

        if self.cfg['runtest']:

            # set cache/error dirs for Instant
            tmpdir = tempfile.mkdtemp()
            instant_cache_dir = os.path.join(tmpdir, '.instant', 'cache')
            instant_error_dir = os.path.join(tmpdir, '.instant', 'error')
            try:
                os.makedirs(instant_cache_dir)
                os.makedirs(instant_error_dir)
            except OSError, err:
                raise EasyBuildError("Failed to create Instant cache/error dirs: %s", err)

            env_vars = [
                ('INSTANT_CACHE_DIR', instant_cache_dir),
                ('INSTANT_ERROR_DIR', instant_error_dir),
            ]
            env_var_cmds = ' && '.join(['export %s="%s"' % (var, val) for (var, val) in env_vars])

            # test command templates
            cmd_template_python = " && ".join([
                env_var_cmds,
                "cd %(dir)s",
                "python demo_%(name)s.py",
                "cd -",
            ])

            cpp_cmds = [
                env_var_cmds,
                "cd %(dir)s",
            ]
            if LooseVersion(self.version) < LooseVersion('1.1'):
                cpp_cmds.append("cmake . %s" % self.saved_configopts)

            cpp_cmds.extend([
                "make VERBOSE=1",
                "./demo_%(name)s",
                "cd -",
            ])
            cmd_template_cpp = " && ".join(cpp_cmds)

            # list based on demos available for DOLFIN v1.0.0
            pde_demos = ['biharmonic', 'cahn-hilliard', 'hyperelasticity', 'mixed-poisson',
                         'navier-stokes', 'poisson', 'stokes-iterative']

            if LooseVersion(self.version) < LooseVersion('1.1'):
                demos = [os.path.join('demo', 'la', 'eigenvalue')] + [os.path.join('demo', 'pde', x) for x in pde_demos]
            else:
                # verified with v1.6.0
                demos = [os.path.join('demo', 'documented', x) for x in pde_demos]

            # construct commands
            cmds = [tmpl % {'dir': os.path.join(d, subdir), 'name': os.path.basename(d)}
                    for d in demos for (tmpl, subdir) in [(cmd_template_cpp, 'cpp')]]

            # exclude Python tests for now, because they 'hang' sometimes (unclear why)
            # they can be reinstated once run_cmd (or its equivalent) has support for timeouts
            # see https://github.com/easybuilders/easybuild-framework/issues/581
            #for (tmpl, subdir) in [(cmd_template_python, 'python'), (cmd_template_cpp, 'cpp')]]

            # subdomains-poisson has no C++ get_version, only Python
            # Python tests excluded, see above
            #name = 'subdomains-poisson'
            #path = os.path.join('demo', 'pde', name, 'python')
            #cmds += [cmd_template_python % {'dir': path, 'name': name}]

            # supply empty argument to each command
            for cmd in cmds:
                run_cmd(cmd, log_all=True)

            # clean up temporary dir
            remove(tmpdir)