-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from geco-bern/patch-interface
Patch for system specific compilation flags
- Loading branch information
Showing
4 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
## a.out.dSYM may get created on OS X. | ||
rm -rf src/Makevars a.out.dSYM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# System dependent config script to deal with | ||
# CLANG / LLVM issues through custom compiler flags | ||
|
||
# taken from Writing R Extensions, 1.2. Configure and cleanup | ||
: ${R_HOME=`R RHOME`} | ||
if test -z "${R_HOME}"; then | ||
echo "could not determine R_HOME" | ||
exit 1 | ||
fi | ||
|
||
# determine the Fortran 9x compiler | ||
FC="`"${R_HOME}/bin/R" CMD config FC`" | ||
|
||
# grab system specific flags already set | ||
SFLAGS="`"${R_HOME}/bin/R" CMD config FCFLAGS`" | ||
|
||
# Use --version output to determine the compiler | ||
# A different compiler will either accept --version and print something | ||
# else or fail due to "unknown argument". In both cases the branch will | ||
# | ||
# use this routine to create the header / start of the Makevars file | ||
if "$FC" --version 2>/dev/null | grep -q 'flang'; then | ||
echo "PKG_FCFLAGS = $SFLAGS -fc-prototypes-external" > src/Makevars | ||
fi | ||
|
||
# Complete the Makevars file with known system agnostic settings | ||
cat src/Makevars.in >> src/Makevars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# PKG_FFLAGS = -ffree-line-length-0 -fbacktrace -ffpe-trap=invalid,zero,overflow -O1 -Wall -Wextra -pedantic -fbacktrace -fPIC -fmax-errors=1 -ggdb -fcheck=all | ||
|
||
# C objects | ||
C_OBJS = wrappersc.o | ||
|
||
# Fortran objects: refer to file names <name.o>, order reflects dependency structure | ||
FT_OBJS = params_core.mod.o sofunutils.mod.o grid_siterun.mod.o params_siml_pmodel.mod.o params_siml_biomee.mod.o forcing_siterun_pmodel.mod.o forcing_siterun_biomee.mod.o params_soil_biomee.mod.o interface_biosphere_pmodel.mod.o interface_biosphere_biomee.mod.o tile_pmodel.mod.o plant_pmodel.mod.o soiltemp_sitch.mod.o waterbal_splash.mod.o vegdynamics_pmodel.mod.o gpp_pmodel.mod.o gpp_biomee.mod.o photosynth_pmodel.mod.o biosphere_pmodel.mod.o biosphere_biomee.mod.o vegetation_biomee.mod.o soil_biomee.mod.o sofun_r.o | ||
|
||
all: $(SHLIB) clean | ||
|
||
$(SHLIB): $(FT_OBJS) $(C_OBJS) | ||
|
||
# Dependency of objects (?) | ||
# <name.o>: <modulename.o> | ||
sofun_r.o: interface_biosphere_pmodel.mod.o interface_biosphere_biomee.mod.o params_core.mod.o params_core.mod.o params_soil_biomee.mod.o params_siml_pmodel.mod.o params_siml_biomee.mod.o | ||
interface_biosphere_pmodel.mod.o: forcing_siterun_pmodel.mod.o params_siml_pmodel.mod.o params_core.mod.o | ||
interface_biosphere_biomee.mod.o: forcing_siterun_biomee.mod.o params_soil_biomee.mod.o params_siml_biomee.mod.o params_core.mod.o | ||
forcing_siterun_pmodel.mod.o: params_core.mod.o params_siml_pmodel.mod.o grid_siterun.mod.o sofunutils.mod.o | ||
forcing_siterun_biomee.mod.o: params_core.mod.o params_siml_biomee.mod.o grid_siterun.mod.o | ||
params_soil_biomee.mod.o: params_core.mod.o | ||
tile_pmodel.mod.o: params_core.mod.o interface_biosphere_pmodel.mod.o | ||
waterbal_splash.mod.o: params_core.mod.o tile_pmodel.mod.o plant_pmodel.mod.o sofunutils.mod.o | ||
gpp_pmodel.mod.o: params_core.mod.o sofunutils.mod.o plant_pmodel.mod.o tile_pmodel.mod.o interface_biosphere_pmodel.mod.o photosynth_pmodel.mod.o | ||
gpp_biomee.mod.o: datatypes.mod.o soil_biomee.mod.o forcing_siterun_biomee.mod.o photosynth_pmodel.mod.o params_core.mod.o sofunutils.mod.o | ||
photosynth_pmodel.mod.o: params_core.mod.o sofunutils.mod.o | ||
soiltemp_sitch.mod.o: params_core.mod.o sofunutils.mod.o tile_pmodel.mod.o interface_biosphere_pmodel.mod.o | ||
plant_pmodel.mod.o: params_core.mod.o sofunutils.mod.o interface_biosphere_pmodel.mod.o | ||
vegdynamics_pmodel.mod.o: params_core.mod.o tile_pmodel.mod.o plant_pmodel.mod.o gpp_pmodel.mod.o waterbal_splash.mod.o | ||
biosphere_pmodel.mod.o: params_core.mod.o classdefs.mod.o sofunutils.mod.o plant_pmodel.mod.o waterbal_splash.mod.o gpp_pmodel.mod.o vegdynamics_pmodel.mod.o tile_pmodel.mod.o interface_biosphere_pmodel.mod.o soiltemp_sitch.mod.o vegdynamics_pmodel.mod.o | ||
biosphere_biomee.mod.o: params_core.mod.o interface_biosphere_biomee.mod.o datatypes.mod.o soil_biomee.mod.o vegetation_biomee.mod.o | ||
soil_biomee.mod.o: datatypes.mod.o | ||
vegetation_biomee.mod.o: datatypes.mod.o soil_biomee.mod.o gpp_biomee.mod.o | ||
datatypes.mod.o: interface_biosphere_biomee.mod.o params_core.mod.o classdefs.mod.o | ||
sofunutils.mod.o: params_core.mod.o | ||
|
||
# Source (object) of Fortran modules | ||
# <modulename.mod>: <filename.o> | ||
sofun_r_mod.mod: sofun_r.o | ||
md_params_core.mod: params_core.mod.o | ||
md_params_siml_pmodel.mod: params_siml_pmodel.mod.o | ||
md_params_siml_biomee.mod: params_siml_biomee.mod.o | ||
md_forcing_pmodel.mod: forcing_siterun_pmodel.mod.o | ||
md_forcing_biomee.mod: forcing_siterun_biomee.mod.o | ||
md_params_soil_biomee.mod: params_soil_biomee.mod.o | ||
md_interface_pmodel.mod: interface_biosphere_pmodel.mod.o | ||
md_interface_biomee.mod: interface_biosphere_biomee.mod.o | ||
md_grid.mod: grid_siterun.mod.o | ||
md_biosphere_pmodel.mod: biosphere_pmodel.mod.o | ||
md_biosphere_biomee.mod: biosphere_biomee.mod.o | ||
md_classdefs.mod: classdefs.mod.o | ||
md_plant_pmodel.mod: plant_pmodel.mod.o | ||
md_waterbal.mod: waterbal_splash.mod.o | ||
md_sofunutils.mod: sofunutils.mod.o | ||
md_tile_pmodel.mod: tile_pmodel.mod.o | ||
md_gpp_pmodel.mod: gpp_pmodel.mod.o | ||
md_gpp_biomee.mod: gpp_biomee.mod.o | ||
md_photosynth.mod: photosynth_pmodel.mod.o | ||
md_soiltemp.mod: soiltemp_sitch.mod.o | ||
md_vegdynamics_pmodel.mod: vegdynamics_pmodel.mod.o | ||
datatypes.mod: datatypes.o | ||
md_soil_biomee.mod: soil_biomee.o | ||
md_vegetation_biomee.mod: vegetation_biomee.o | ||
|
||
# Dependency of the C wrapper | ||
wrappersc.o: sofun_r_mod.mod | ||
|
||
clean: | ||
@rm -rf *.mod *.o |