Example #1
0
    def build_libraries(self, libraries):
        # build CLASS first
        build_CLASS(self.class_build_dir)

        # update the link objects with CLASS library
        link_objects = ['libclass.a']
        link_objects = list(
            glob(os.path.join(self.class_build_dir, '*', 'libclass.a')))

        self.compiler.set_link_objects(link_objects)
        self.compiler.library_dirs.insert(
            0, os.path.join(self.class_build_dir, 'lib'))

        # then no longer need to build class.

        libraries = [lib for lib in libraries if lib[0] != 'class']

        for (library, build_info) in libraries:

            # check swig version
            if library == "gcl" and swig_needed:
                check_swig_version()

            # update include dirs
            self.include_dirs += build_info.get('include_dirs', [])

        build_clib.build_libraries(self, libraries)
Example #2
0
    def build_libraries(self, libraries):
        # build CLASS first
        build_CLASS(self.class_build_dir)

        # update the link objects with CLASS library
        link_objects = ['libclass.a']
        link_objects = list(glob(os.path.join(self.class_build_dir, '*', 'libclass.a')))

        self.compiler.set_link_objects(link_objects)
        self.compiler.library_dirs.insert(0, os.path.join(self.class_build_dir, 'lib'))

        # then no longer need to build class.

        libraries = [lib for lib in libraries if lib[0] != 'class']

        for (library, build_info) in libraries:

            # check swig version
            if library == "gcl" and swig_needed:
                check_swig_version()

            # update include dirs
            self.include_dirs += build_info.get('include_dirs', [])

        build_clib.build_libraries(self, libraries)
Example #3
0
 def build_libraries(self, libraries):
     if parse_version(numpy.__version__) < parse_version('1.7'):
         fcompiler = self.fcompiler
     else:
         fcompiler = self._f_compiler
     if isinstance(fcompiler,
                   numpy.distutils.fcompiler.gnu.Gnu95FCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         exe = numpy.distutils.exec_command.find_executable(
             'gcc-ar --enable-plugin')
         if exe is None:
             exe = numpy.distutils.exec_command.find_executable('ar')
         numpy.distutils.log.set_verbosity(old_value)
         self.compiler.archiver[0] = exe
         flags = F77_COMPILE_ARGS_GFORTRAN + F77_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F77_COMPILE_DEBUG_GFORTRAN
         if F77_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f77'] += flags
         flags = F90_COMPILE_ARGS_GFORTRAN + F90_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F90_COMPILE_DEBUG_GFORTRAN
         if F90_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f90'] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_GFORTRAN]
     elif isinstance(fcompiler,
                     numpy.distutils.fcompiler.intel.IntelFCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         self.compiler.archiver[
             0] = numpy.distutils.exec_command.find_executable('xiar')
         numpy.distutils.log.set_verbosity(old_value)
         flags = F77_COMPILE_ARGS_IFORT + F77_COMPILE_OPT_IFORT
         if self.debug:
             flags += F77_COMPILE_DEBUG_IFORT
         if F77_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f77'] += flags
         flags = F90_COMPILE_ARGS_IFORT + F90_COMPILE_OPT_IFORT
         if self.debug:
             flags += F90_COMPILE_DEBUG_IFORT
         if F90_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f90'] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_IFORT]
     else:
         raise RuntimeError()
     build_clib.build_libraries(self, libraries)
Example #4
0
 def build_libraries(self, libraries):
     if numpy.__version__ < "1.7":
         fcompiler = self.fcompiler
     else:
         fcompiler = self._f_compiler
     if isinstance(fcompiler,
                   numpy.distutils.fcompiler.gnu.Gnu95FCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         exe = numpy.distutils.exec_command.find_executable('gcc-ar')
         if exe is None:
             exe = numpy.distutils.exec_command.find_executable('ar')
         numpy.distutils.log.set_verbosity(old_value)
         self.compiler.archiver[0] = exe
         flags = F77_COMPILE_ARGS_GFORTRAN + F77_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F77_COMPILE_DEBUG_GFORTRAN
         if F77_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f77'] += flags
         flags = F90_COMPILE_ARGS_GFORTRAN + F90_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F90_COMPILE_DEBUG_GFORTRAN
         if F90_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f90'] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_GFORTRAN]
     elif isinstance(fcompiler,
                     numpy.distutils.fcompiler.intel.IntelFCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         self.compiler.archiver[0] = numpy.distutils.exec_command.find_executable('xiar')
         numpy.distutils.log.set_verbosity(old_value)
         flags = F77_COMPILE_ARGS_IFORT + F77_COMPILE_OPT_IFORT
         if self.debug:
             flags += F77_COMPILE_DEBUG_IFORT
         if F77_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f77'] += flags
         flags = F90_COMPILE_ARGS_IFORT + F90_COMPILE_OPT_IFORT
         if self.debug:
             flags += F90_COMPILE_DEBUG_IFORT
         if F90_OPENMP:
             flags += ['-openmp']
         fcompiler.executables['compiler_f90'] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_IFORT]
     else:
         raise RuntimeError()
     build_clib.build_libraries(self, libraries)
Example #5
0
 def build_libraries(self, libraries):
     if parse_version(numpy.__version__) < parse_version("1.7"):
         fcompiler = self.fcompiler
     else:
         fcompiler = self._f_compiler
     if isinstance(fcompiler, numpy.distutils.fcompiler.gnu.Gnu95FCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         exe = find_executable("gcc-ar")
         if exe is None:
             exe = find_executable("ar")
         numpy.distutils.log.set_verbosity(old_value)
         self.compiler.archiver[0] = exe
         flags = F77_COMPILE_ARGS_GFORTRAN + F77_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F77_COMPILE_DEBUG_GFORTRAN
         if F77_OPENMP:
             flags += ["-openmp"]
         fcompiler.executables["compiler_f77"] += flags
         flags = F90_COMPILE_ARGS_GFORTRAN + F90_COMPILE_OPT_GFORTRAN
         if self.debug:
             flags += F90_COMPILE_DEBUG_GFORTRAN
         if F90_OPENMP:
             flags += ["-openmp"]
         fcompiler.executables["compiler_f90"] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_GFORTRAN]
     elif isinstance(fcompiler, numpy.distutils.fcompiler.intel.IntelFCompiler):
         old_value = numpy.distutils.log.set_verbosity(-2)
         self.compiler.archiver[0] = find_executable("xiar")
         numpy.distutils.log.set_verbosity(old_value)
         flags = F77_COMPILE_ARGS_IFORT + F77_COMPILE_OPT_IFORT
         if self.debug:
             flags += F77_COMPILE_DEBUG_IFORT
         if F77_OPENMP:
             flags += ["-openmp"]
         fcompiler.executables["compiler_f77"] += flags
         flags = F90_COMPILE_ARGS_IFORT + F90_COMPILE_OPT_IFORT
         if self.debug:
             flags += F90_COMPILE_DEBUG_IFORT
         if F90_OPENMP:
             flags += ["-openmp"]
         fcompiler.executables["compiler_f90"] += flags
         fcompiler.libraries += [LIBRARY_OPENMP_IFORT]
     elif fcompiler is not None:
         raise RuntimeError("Unhandled compiler: '{}'.".format(fcompiler))
     build_clib.build_libraries(self, libraries)
Example #6
0
 def build_libraries(self, *args, **kwargs):
     c = self.compiler.compiler_type
     for libtup in self.libraries:
         opts = libtup[1]
         if c in copt:
             if "extra_compiler_args" not in opts:
                 opts["extra_compiler_args"] = []
             opts["extra_compiler_args"].extend(copt[c])
         if "include_dirs" not in opts:
             opts["include_dirs"] = []
         opts["include_dirs"].append(distutils.sysconfig.get_python_inc())
     
     return build_clib.build_libraries(self, *args, **kwargs)
Example #7
0
            def build_libraries(self, *args, **kwargs):
                c = self.compiler.compiler_type
                for libtup in self.libraries:
                    opts = libtup[1]
                    if c in copt:
                        if "extra_compiler_args" not in opts:
                            opts["extra_compiler_args"] = []
                        opts["extra_compiler_args"].extend(copt[c])
                    if "include_dirs" not in opts:
                        opts["include_dirs"] = []
                    opts["include_dirs"].append(
                        distutils.sysconfig.get_python_inc())

                return build_clib.build_libraries(self, *args, **kwargs)