Skip to content

Commit

Permalink
-Fix parallel make
Browse files Browse the repository at this point in the history
  • Loading branch information
marcadella committed Nov 28, 2024
1 parent dcff535 commit 221fad1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 121 deletions.
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## Resubmission

Re-submission of archived package 'rsofun'.
Causes of rejection have been addressed (compilation warnings and runtime errors), as well as
new features added, leading to a new major version v5.0.0
- Fix parallel make errors

## R CMD check

Expand Down
71 changes: 17 additions & 54 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
#################################
# For debugging purpose, the following can be added to your local ~/.R/Makevars file
#PKG_FFLAGS = -frecursive -fbounds-check -fcheck=all -Wall -Wextra -pedantic -g -O0 -fbacktrace -ffpe-trap=invalid,zero,overflow -finit-real=snan -finit-integer=-9999999 -finit-derived
# -frecursive: to avoid "Warning: Array 'out_biosphere' at (1) is larger than limit ..."
# -fbounds-check: https://scicomp.stackexchange.com/questions/36045/ifort-everithing-ok-but-with-gfortran-segmentation-fault
# -Wall -Wextra -Wpedantic: to get more warnings
# -fbacktrace: Specify that, when a runtime error is encountered, the Fortran runtime library should output a backtrace of the error. This option only has influence for compilation of the Fortran main program.
# -fcheck=all: enable "run-time tests", such as, for instance, array bounds checks.
# -ffpe-trap=invalid,zero,overflow: Traps usual FP exceptions (for better debugging)
# The following are useful for debugging uninitialized values. It should not be used in production!
# -finit-real=snan -finit-integer=-9999999: Initialize uninitialized values to NaN for reals, and -9999999 for integers.
# -finit-derived: applies the settings above to fields in derive types too

# Link-time optimization, see https://cran.r-project.org/doc/manuals/R-admin.html#LTO-with-GCC-1
#LTO_OPT = -flto
#LTO_FC_OPT = -flto
#IN ADDITION,to adding these flags to ~/.R/Makevars, run 'R CMD INSTALL --use-LTO '
##################################

# 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 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
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 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
all: $(SHLIB)

$(SHLIB): $(FT_OBJS) $(C_OBJS)

# Dependency of objects (?)
# Source (object) of Fortran modules
# <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_siml_pmodel.mod.o params_siml_biomee.mod.o
sofun_r.o: interface_biosphere_pmodel.mod.o interface_biosphere_biomee.mod.o params_core.mod.o params_core.mod.o \
biosphere_pmodel.mod.o biosphere_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_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
Expand All @@ -42,42 +27,20 @@ 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 soiltemp_sitch.mod.o sofunutils.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 \
soiltemp_sitch.mod.o sofunutils.mod.o
soil_biomee.mod.o: datatypes.mod.o sofunutils.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_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
params_siml_biomee.mod.o: params_core.mod.o
params_siml_pmodel.mod.o: params_core.mod.o
classdefs.mod.o: params_core.mod.o

# Dependency of the C wrapper
wrappersc.o: sofun_r_mod.mod
wrappersc.o: sofun_r.o

clean:
@rm -rf *.mod *.o
@rm -rf *.o
64 changes: 0 additions & 64 deletions src/Makevars.win

This file was deleted.

0 comments on commit 221fad1

Please sign in to comment.