Beispiel #1
0
    # --- put the object files from compiling the pkgnamepy.c file in a temp
    # --- directory relative to the file. build_temp defaults to an empty string,
    # --- so the .o files are put in the same place as the .c files.
    sys.argv += ['--build-temp', build_temp]

# --- Add prefix to interfacefile since it will only be referenced from
# --- the build directory.
interfacefile = fixpath(os.path.join(upbuilddir, interfacefile))

# --- Get path to fortranfile relative to the build directory.
upfortranfile = os.path.join(upbuilddir, fortranfile)

# --- Pick the fortran compiler
fcompiler = FCompiler(machine=machine,
                      debug=debug,
                      fcompname=fcomp,
                      fcompexec=fcompexec,
                      implicitnone=implicitnone,
                      twounderscores=twounderscores)

# --- Create some locals which are needed for strings below.
f90free = fcompiler.f90free
f90fixed = fcompiler.f90fixed
popt = fcompiler.popt
forthonargs = forthonargs + fcompiler.forthonargs
if fopt is None: fopt = fcompiler.fopt
extra_link_args = fcompiler.extra_link_args
extra_compile_args = fcompiler.extra_compile_args
define_macros = fcompiler.define_macros

# --- Create path to fortran files for the Makefile since they will be
# --- referenced from the build directory.
Beispiel #2
0
    elif o[0] == '-F':
        fcomp = o[1]
    elif o[0] == '--parallel':
        parallel = 1
    elif o[0] == '--petsc':
        petsc = 1

if petsc == 1 and os.getenv('PETSC_DIR') == None:
    raise SystemExit("PETSc requested but PETSC_DIR not set")
if os.getenv('PETSC_DIR') != None:
    petsc = 1
if petsc == 1 and os.getenv('PETSC_ARCH') == None:
    raise SystemExit("PETSc requested but PETSC_ARCH not set")

sys.argv = ['setup2.py'] + args
fcompiler = FCompiler(machine=machine, debug=debug, fcompname=fcomp)


class uedgeBuild(build):
    def run(self):
        # with python2 everything is put into a single uedgeC.so file
        if sys.hexversion < 0x03000000:
            if petsc == 0:
                call(['make', '-f', 'Makefile.Forthon'])
            else:
                call(['make', '-f', 'Makefile.PETSc'])
            build.run(self)
        else:
            if petsc == 0:
                call(['make', '-f', 'Makefile.Forthon3'])
            else:
Beispiel #3
0
    # --- directory relative to the file. build_temp defaults to an empty string,
    # --- so the .o files are put in the same place as the .c files.
    sys.argv += ['--build-temp', build_temp]

# --- Add prefix to interfacefile since it will only be referenced from
# --- the build directory.
interfacefile = fixpath(os.path.join(upbuilddir, interfacefile))

# --- Get path to fortranfile relative to the build directory.
upfortranfile = os.path.join(upbuilddir, fortranfile)

# --- Pick the fortran compiler
fcompiler = FCompiler(machine=machine,
                      debug=debug,
                      fcompname=fcomp,
                      fcompexec=fcompexec,
                      mpifort_compiler=mpifort_compiler,
                      implicitnone=implicitnone,
                      twounderscores=twounderscores,
                      omp=omp)

# --- Create some locals which are needed for strings below.
f90free = fcompiler.f90free
f90fixed = fcompiler.f90fixed
popt = fcompiler.popt
forthonargs = forthonargs + fcompiler.forthonargs
if fopt is None: fopt = fcompiler.fopt
extra_link_args = fcompiler.extra_link_args
extra_compile_args = fcompiler.extra_compile_args
define_macros = fcompiler.define_macros

# --- Create path to fortran files for the Makefile since they will be