EDmodel / ED2

Ecosystem Demography Model
78 stars 112 forks source link

plant_hydro problem when compiling EDR #238

Closed hamiddashti closed 6 years ago

hamiddashti commented 6 years ago

When I try to compile EDR I get the following error:

rm -f patch_pft_size_profile_mod.F90 make[1]: Circular plant_hydro.o <- plant_hydro.mod dependency dropped. m2c -o plant_hydro.o allometry.mod make[1]: m2c: Command not found make[1]: *** [plant_hydro.o] Error 127

I can compile the main ED (ED folder) with no issue... Any thought how can I fix the error? Thanks

serbinsh commented 6 years ago

@hamid4965 are you using the latest master branch? I can take a look but perhaps we need to update the codebase in EDR to reflect recent changes in ED2

Also, what compiler, architecture, etc.

Thanks! Shawn

hamiddashti commented 6 years ago

@serbinsh Yes I'm using the latest master branch and am using gfortran on our local cluster (here). I've also attached the include file if it helps. include.mk.gfortran.txt Thanks

serbinsh commented 6 years ago

OK, yes my EDR build is also now having this problem:

cp -f ../../../ED/src/dynamics/bdf2_solver.f90 bdf2_solver.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI bdf2_solver.f90
rm -f bdf2_solver.f90
cp -f ../../../ED/src/utils/budget_utils.f90 budget_utils.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI budget_utils.f90
rm -f budget_utils.f90
cp -f ../../../ED/src/memory/canopy_layer_coms.f90 canopy_layer_coms.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI canopy_layer_coms.f90
rm -f canopy_layer_coms.f90
cp -f ../../../ED/src/memory/canopy_radiation_coms.f90 canopy_radiation_coms.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI canopy_radiation_coms.f90
rm -f canopy_radiation_coms.f90
cp -f ../../../ED/src/dynamics/canopy_struct_dynamics.f90 canopy_struct_dynamics.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI canopy_struct_dynamics.f90
rm -f canopy_struct_dynamics.f90
cp -f ../../../ED/src/memory/c34constants.f90 c34constants.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI c34constants.f90
rm -f c34constants.f90
cp -f ../../../ED/src/utils/charutils.f90 charutils.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI charutils.f90
rm -f charutils.f90
cp -f ../../../ED/src/utils/dateutils.f90 dateutils.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI dateutils.f90
rm -f dateutils.f90
cp -f ../../../ED/src/memory/decomp_coms.f90 decomp_coms.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI decomp_coms.f90
rm -f decomp_coms.f90
cp -f ../../../ED/src/memory/detailed_coms.f90 detailed_coms.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI detailed_coms.f90
rm -f detailed_coms.f90
cp -f ../../../ED/src/memory/mem_polygons.f90 mem_polygons.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI mem_polygons.f90
rm -f mem_polygons.f90
cp -f ../../../ED/src/utils/patch_pft_size_profile_mod.F90 patch_pft_size_profile_mod.F90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI patch_pft_size_profile_mod.F90
rm -f patch_pft_size_profile_mod.F90
make[1]: Circular plant_hydro.o <- plant_hydro.mod dependency dropped.
m2c    -o plant_hydro.o allometry.mod
make[1]: m2c: Command not found
make[1]: *** [plant_hydro.o] Error 127
make[1]: Leaving directory `/data/sserbin/Modeling/ED2_testing/ED2/EDR/build/bin-opt-E-master-e255f24'
make: *** [all] Error 2

I think there is something within the EDR code base that needs to be updated to be compatible with ED2 code base. tagging @ashiklom and @mdietze as well to loop them in

serbinsh commented 6 years ago

OK, so I copied the updated objects.mk and rules.mk to /make in EDR and that seemed to fix the compile issue for me

/bin/rm -f utils_f.f90
/bin/cp -f ../../../ED/src/utils/utils_f.f90 utils_f.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI utils_f.f90
/bin/rm -f vegetation_dynamics.f90
/bin/cp -f ../../../ED/src/dynamics/vegetation_dynamics.f90 vegetation_dynamics.f90
mpif90 -c -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI vegetation_dynamics.f90
ar rs ../../build//ed_2.1-opt-master-e255f24.a allometry.o an_header.o average_utils.o bdf2_solver.o budget_utils.o canopy_air_coms.o canopy_layer_coms.o canopy_radiation_coms.o canopy_struct_dynamics.o c34constants.o charutils.o consts_coms.o dateutils.o decomp_coms.o detailed_coms.o disturbance.o disturb_coms.o edio.o ed_1st.o ed_bigleaf_init.o ed_driver.o ed_filelist.o ed_grid.o ed_init.o ed_init_atm.o ed_init_full_history.o ed_load_namelist.o ed_max_dims.o ed_mem_alloc.o ed_mem_grid_dim_defs.o ed_met_driver.o ed_misc_coms.o ed_model.o ed_mpass_init.o ed_nbg_init.o ed_node_coms.o ed_opspec.o ed_params.o ed_para_coms.o ed_para_init.o ed_print.o ed_read_ed10_20_history.o ed_read_ed21_history.o ed_state_vars.o ed_therm_lib.o ed_type_init.o ed_var_tables.o ed_work_vars.o ed_xml_config.o ename_coms.o euler_driver.o events.o farq_leuning.o farq_katul.o fatal_error.o fire.o forestry.o fusion_fission_coms.o fuse_fiss_utils.o patch_pft_size_profile_mod.o grid_coms.o growth_balive.o h5_output.o hdf5_coms.o hdf5_utils.o heun_driver.o hybrid_driver.o hydrology_coms.o hydrology_constants.o invmondays.o landuse_init.o lapse.o leaf_database.o libxml2f90.f90_pp.o lsm_hyd.o mem_polygons.o met_driver_coms.o mortality.o multiple_scatter.o numutils.o old_twostream_rad.o phenology_aux.o phenology_coms.o phenology_driv.o phenology_startup.o photosyn_driv.o physiology_coms.o plant_hydro.o pft_coms.o radiate_driver.o radiate_utils.o reproduction.o rk4_coms.o rk4_copy_patch.o rk4_derivs.o rk4_driver.o rk4_integ_utils.o rk4_misc.o rsys.o soil_coms.o soil_respiration.o stable_cohorts.o structural_growth.o therm_lib.o therm_lib8.o twostream_rad.o update_derived_props.o utils_c.o utils_f.o vegetation_dynamics.o
ar: creating ../../build//ed_2.1-opt-master-e255f24.a

cp -f ../../../ED/src/driver/edmain.F90 edmain.F90
mpif90 -c -DUSE_INTERF=1 -DUSENC=0 -DPC_LINUX1 -DUSE_HDF5=1 -DUSE_COLLECTIVE_MPIO=0 -DUSE_MPIWTIME=1 -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   -DRAMS_MPI edmain.F90
rm -f edmain.F90

mpif90 -o ../../build//ed_2.1-opt-master-e255f24 edmain.o -O3 -ffree-line-length-none  -fno-whole-file  -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include   ../../build//ed_2.1-opt-master-e255f24.a -L/data/software/hdf5/1.8.19-gcc540/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz   \
     -L/dev/null  -O3 -ffree-line-length-none  -fno-whole-file

Finished building === ../../build//ed_2.1-opt-master-e255f24

make[1]: Leaving directory `/data/sserbin/Modeling/ED2_testing/ED2/EDR/build/bin-opt-E-master-e255f24'
Installation Complete.
[sserbin@modex build]$

Thoughts?

FYI - this isnt the correct fix yet, just trying to isolate where things might be breaking the build

xiangtaoxu commented 6 years ago

I added two new files and modified objects.mk and rules.mk in the most recent pull request. I did not realize that EDR needs another copy of these files. Anyway, good to hear the issue is resolved.

Xiangtao

On Thu, Mar 15, 2018, 4:12 PM Shawn P. Serbin notifications@github.com wrote:

OK, so I copied the updated objects.mk and rules.mk to /make in EDR and that seemed to fix the compile issue for me

/bin/rm -f utils_f.f90 /bin/cp -f ../../../ED/src/utils/utils_f.f90 utils_f.f90 mpif90 -c -O3 -ffree-line-length-none -fno-whole-file -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include -DRAMS_MPI utils_f.f90 /bin/rm -f vegetation_dynamics.f90 /bin/cp -f ../../../ED/src/dynamics/vegetation_dynamics.f90 vegetation_dynamics.f90 mpif90 -c -O3 -ffree-line-length-none -fno-whole-file -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include -DRAMS_MPI vegetation_dynamics.f90 ar rs ../../build//ed_2.1-opt-master-e255f24.a allometry.o an_header.o average_utils.o bdf2_solver.o budget_utils.o canopy_air_coms.o canopy_layer_coms.o canopy_radiation_coms.o canopy_struct_dynamics.o c34constants.o charutils.o consts_coms.o dateutils.o decomp_coms.o detailed_coms.o disturbance.o disturb_coms.o edio.o ed_1st.o ed_bigleaf_init.o ed_driver.o ed_filelist.o ed_grid.o ed_init.o ed_init_atm.o ed_init_full_history.o ed_load_namelist.o ed_max_dims.o ed_mem_alloc.o ed_mem_grid_dim_defs.o ed_met_driver.o ed_misc_coms.o ed_model.o ed_mpass_init.o ed_nbg_init.o ed_node_coms.o ed_opspec.o ed_params.o ed_para_coms.o ed_para_init.o ed_print.o ed_read_ed10_20_history.o ed_read_ed21_history.o ed_state_vars.o ed_therm_lib.o ed_type_init.o ed_var_tables.o ed_work_vars.o ed_xml_config.o ename_coms.o euler_driver.o events.o farq_leuning.o farq_katul.o fatal_error.o fire.o forestry.o fusion_fission_coms.o fuse_fiss_utils.o patch_pft_size_profile_mod.o grid_coms.o growth_balive.o h5_output.o hdf5_coms.o hdf5_utils.o heun_driver.o hybrid_driver.o hydrology_coms.o hydrology_constants.o invmondays.o landuse_init.o lapse.o leaf_database.o libxml2f90.f90_pp.o lsm_hyd.o mem_polygons.o met_driver_coms.o mortality.o multiple_scatter.o numutils.o old_twostream_rad.o phenology_aux.o phenology_coms.o phenology_driv.o phenology_startup.o photosyn_driv.o physiology_coms.o plant_hydro.o pft_coms.o radiate_driver.o radiate_utils.o reproduction.o rk4_coms.o rk4_copy_patch.o rk4_derivs.o rk4_driver.o rk4_integ_utils.o rk4_misc.o rsys.o soil_coms.o soil_respiration.o stable_cohorts.o structural_growth.o therm_lib.o therm_lib8.o twostream_rad.o update_derived_props.o utils_c.o utils_f.o vegetation_dynamics.o ar: creating ../../build//ed_2.1-opt-master-e255f24.a

cp -f ../../../ED/src/driver/edmain.F90 edmain.F90 mpif90 -c -DUSE_INTERF=1 -DUSENC=0 -DPC_LINUX1 -DUSE_HDF5=1 -DUSE_COLLECTIVE_MPIO=0 -DUSE_MPIWTIME=1 -O3 -ffree-line-length-none -fno-whole-file -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include -DRAMS_MPI edmain.F90 rm -f edmain.F90

mpif90 -o ../../build//ed_2.1-opt-master-e255f24 edmain.o -O3 -ffree-line-length-none -fno-whole-file -I../../../ED/src/include -I/data/software/hdf5/1.8.19-gcc540/include ../../build//ed_2.1-opt-master-e255f24.a -L/data/software/hdf5/1.8.19-gcc540/lib -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz \ -L/dev/null -O3 -ffree-line-length-none -fno-whole-file

Finished building === ../../build//ed_2.1-opt-master-e255f24

make[1]: Leaving directory `/data/sserbin/Modeling/ED2_testing/ED2/EDR/build/bin-opt-E-master-e255f24' Installation Complete. [sserbin@modex build]$

Thoughts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EDmodel/ED2/issues/238#issuecomment-373507785, or mute the thread https://github.com/notifications/unsubscribe-auth/ACptr5cjITK9P8pqGtKa78aEjWurBc8fks5tess6gaJpZM4SswZQ .

--

Xiangtao Xu Harvard University Dept of Organismic and Evolutionary Biology Suite 43, HMNH, 26 Oxford Street, Cambridge, MA, 02138

serbinsh commented 6 years ago

@xiangtaoxu @hamid4965 Yeah, but we also need to update the paths in the local EDR versions so they point to the right place

Sorry actually just add the changes to those files to the EDR versions

hamiddashti commented 6 years ago

@serbinsh Thanks! That worked for me as well.

serbinsh commented 6 years ago

@hamid4965 just want to be clear that you followed the changes in my PR #240 not the "quick and dirty" test I did here where I just copied over. There are differences in the EDR version to point to the EDR versions of some of the f90 files.