Comments (4)
Hi Hamid,
I think the easiest solution to this problem is to use the "mpif90" wrapper function that calls gfortran. A wrapper is kind of like an alias, that makes a compilcated command very simple. For instance, I use openmpi for MPI communications, and it is built with gfortran. If I execute the command "mpif90 -show" in my terminal window, it will show me what it's equivalent command string is, as if it was passed to compile a program:
rgknox@eddi:$ mpif90 -show
gfortran -I/home/rgknox/local/openmpi-1.8.1/include -pthread -I/home/rgknox/local/openmpi-1.8.1/lib -Wl,-rpath -Wl,/home/rgknox/local/openmpi-1.8.1/lib -Wl,--enable-new-dtags -L/home/rgknox/local/openmpi-1.8.1/lib -lmpi_usempi -lmpi_mpifh -lmpi
All that stuff that comes after the gfortran command tell the compiler where to find external libraries and how exactly to compile. So you need to work with your system administrator to find out what type of MPI is available on your system, and once you have identified that you must have the binaries (mpif90) and the libraries that come with it, in your path.
See below I have the F_COMP variable in my include.mk.opt file set to mpif90, and the C_COMP variable set to mpicc.
F_COMP=mpif90
F_OPTS=-g -ffree-line-length-none -fno-whole-file -O2
C_COMP=mpicc
C_OPTS=-g -O2
LOADER=mpif90
LOADER_OPTS=${F_OPTS}
C_LOADER=mpicc
LIBS=
MOD_EXT=mod
Note that you will run into a similar issue when the build process tries to incorporate the HDF5 libraries and functionality. In this case you have to make sure that the HDF5_INCS variable and HDF5_LIBS variable are set to the correct path on your machine. See http://www.hdfgroup.org/HDF5/ for more info.
from ed2.
Another comment:
For some reason, the build process will tell you it can't find mpif.h and some other libraries, but these are just false positives and can be ignored. This is generated during my compile:
./generate_deps.sh ../..
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: mpif.h
Can't find file: stdio.h
Can't find file: math.h
Can't find file: stdlib.h
Can't find file: malloc/malloc.h
Can't find file: sys/malloc.h
Can't find file: malloc.h
Can't find file: stdlib.h
Can't find file: errno.h
Can't find file: string.h
Can't find file: ctype.h
Can't find file: dirent.h
Can't find file: string.h
=== Finished dependencies ===
Do you get any specific error messages during compile time?
from ed2.
Thanks for your response.
Actually i get the " Can't find file: mpif.h " error when i am trying to compile the ED model downloaded from Moorcroft Lab website. But when i compile the BRAMS version downloaded from GitHub i don't get any more that error. however in BRAMS version the compiling error is something related to "Landuse_input.f90" as follow:
.
.
.
cp -f /home/hamid/opt/source/ED2-master/BRAMS/src/mksfc/mem_mksfc.f90 mem_mksfc.f90
mpif90 -c -O3 -ffree-line-length-none -I/home/hamid/opt/source/ED2-master/BRAMS/src/include -I/home/hamid/opt/source/hdf5-1.8.14/build/include -DRAMS_MPI mem_mksfc.f90
rm -f mem_mksfc.f90
cp -f /home/hamid/opt/source/ED2-master/BRAMS/src/mksfc/landuse_input.F90 landuse_input.F90
mpif90 -c -DUSE_INTERF=1 -DUSENC=0 -DPC_GFORTRAN -DUSE_HDF4= -DUSE_HDF5=1 -DUSE_MPIWTIME=1 -DCOUPLED -O3 -ffree-line-length-none -I/home/hamid/opt/source/ED2-master/BRAMS/src/include -I/home/hamid/opt/source/hdf5-1.8.14/build/include -DRAMS_MPI -DUSE_COLLECTIVE_IO=0 landuse_input.F90
landuse_input.F90:1207:0: error: #if with no expression
#if USE_HDF4
^
make[1]: *** [landuse_input.o] Error 1
make[1]: Leaving directory `/home/hamid/opt/source/ED2-master/BRAMS/build/bin'
make: *** [all] Error 2
And here is my address to HDF5:
HDF5_INCS=-I/home/hamid/opt/source/hdf5-1.8.14/build/include
HDF5C_INCS=-I/home/hamid/opt/source/hdf5-1.8.14/build/include
HDF5_LIBS=-lz /home/hamid/opt/source/hdf5-1.8.14/build/lib/libhdf5_fortran.a
/home/hamid/opt/source/hdf5-1.8.14/build/lib/libhdf5.a
/home/hamid/opt/source/hdf5-1.8.14/build/lib/hdf5_hl.a
/home/hamid/opt/source/hdf5-1.8.14/build/lib/libhdf5hl_fortran.a
Thanks
from ed2.
This is essentially a wild guess, but it looks like the issue might be the omission of any sort of HDF4 flag I've italicized below...
cp -f /home/hamid/opt/source/ED2-master/BRAMS/src/mksfc/landuse_input.F90 landuse_input.F90
mpif90 -c -DUSE_INTERF=1 -DUSENC=0 -DPC_GFORTRAN -DUSE_HDF4= -DUSE_HDF5=1 -DUSE_MPIWTIME=1 -DCOUPLED -O3 -ffree-line-length-none -I/home/hamid/opt/source/ED2-master/BRAMS/src/include -I/home/hamid/opt/source/hdf5-1.8.14/build/include -DRAMS_MPI -DUSE_COLLECTIVE_IO=0 landuse_input.F90
Which is to say it looks like the compiler simply doesn't know how to interpret 'USE_HDF4'. Seems reasonable anyway.
from ed2.
Related Issues (20)
- how to modify the settings to increase the NPLANT of pft 3 ? ? HOT 2
- Issue with HPC build HOT 6
- soil water off-track HOT 1
- Problem writing the T-file HOT 12
- NPLANT
- little mistake in adjust_veg_properties of rk4_misc HOT 3
- question about unit in reproduction.f90 HOT 3
- Typo in the events.f90 file HOT 3
- Docker image not being updated by GH actions
- `HYDAULIC_MORTALITY_SCHEME` missing from ED2IN HOT 4
- ED2 Installation error
- Patch Bfusion budget failed (CO2 Summary: FINE: F)
- hdf5 problem when running HISTORY mode HOT 4
- question about MPI HOT 1
- Crop yield estimation
- psi_max or psi_min in leaf phenology HOT 1
- typo in calc_plant_water_flux HOT 2
- Issue with compilation in a server HOT 4
- unable to synchronously open file
- Issue installation ED2 Model. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ed2.