Beispiel #1
0
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
    compiler_so = self.compiler_so
    if sys.platform == 'darwin':
        compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + \
                extra_postargs)
    if ext == ".f90":
        if sys.platform == 'darwin' or sys.platform == 'linux2':
            compiler_so = ["gfortran"]
            cc_args = ["-O", "-fPIC", "-c", "-ffree-form"]
    try:
        self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
    except DistutilsExecError, msg:
        raise CompileError(msg)
Beispiel #2
0
 def _compile(self, obj, src, *args, **kwargs):  # @UnusedVariable
         self.compiler_so = ["gfortran"]
         cc_args = ['-c', '-fno-underscoring']
         if sys.platform == 'darwin':
             self.compiler_so = _darwin_compiler_fixup(self.compiler_so,
                                                       cc_args)
         else:
             cc_args.append('-fPIC')
         try:
             self.spawn(self.compiler_so + [src, '-o', obj] + cc_args)
         except DistutilsExecError:
             _, msg, _ = sys.exc_info()
             raise CompileError(msg)
Beispiel #3
0
 def _compile(self, obj, src, *args, **kwargs):  # @UnusedVariable
     # we check if 'taup' is in sources
     IS_FORTRAN = False
     if 'taup' in src:
         IS_FORTRAN = True
     if not IS_FORTRAN:
         # otherwise we just use the original compile method
         UnixCCompiler.linker_so = None
         return self._original_compile(obj, src, *args, **kwargs)
     UnixCCompiler.linker_so = ["gfortran"]
     self.compiler_so = ["gfortran"]
     cc_args = ['-c', '-fno-underscoring']
     if sys.platform == 'darwin':
         self.compiler_so = _darwin_compiler_fixup(self.compiler_so,
                                                   cc_args)
     else:
         cc_args.append('-fPIC')
     try:
         self.spawn(self.compiler_so + [src, '-o', obj] + cc_args)
     except DistutilsExecError:
         _, msg, _ = sys.exc_info()
         raise CompileError(msg)