Hello! I have recently been trying to install and compile MPAS-CMAQ. There are others on the server where I am who have attempted to install MPAS and have installed all the necessary libraries, which I have accessed.
module purge
module load intel/18.0.0
export LIB=/share/MODEL/MPAS/intel/apps
#mpich
export MPI=${LIB}/mpich
export PATH=${MPI}/bin:$PATH
export LD_LIBRARY_PATH=${MPI}/lib:$LD_LIBRARY_PATH
export INCLUDE=${MPI}/include:$INCLUDE
#zlib
export ZLIB=${LIB}/zlib
export LD_LIBRARY_PATH=${ZLIB}/lib:$LD_LIBRARY_PATH
export INCLUDE=${ZLIB}/include:$INCLUDE
#szip
export SZIP=${LIB}/szip
export LD_LIBRARY_PATH=${SZIP}/lib:$LD_LIBRARY_PATH
export INCLUDE=${SZIP}/include:$INCLUDE
#hdf5
export HDF5=${LIB}/HDF5
export PATH=${HDF5}/bin:$PATH
export LD_LIBRARY_PATH=${HDF5}/lib:$LD_LIBRARY_PATH
export INCLUDE=${HDF5}/include:$INCLUDE
#pnetcdf
export PNETCDF=${LIB}/PnetCDF
export PATH=${PNETCDF}/bin:$PATH
export LD_LIBRARY_PATH=${PNETCDF}/lib:$LD_LIBRARY_PATH
export INCLUDE=${PNETCDF}/include:$INCLUDE
#netcdf
export NETCDF=${LIB}/netcdf
export PATH=${NETCDF}/bin:$PATH
export LD_LIBRARY_PATH=${NETCDF}/lib:$LD_LIBRARY_PATH
export INCLUDE=${NETCDF}/include:$INCLUDE
#pio
export PIO=${LIB}/pio
export LD_LIBRARY_PATH=${PIO}/lib:$LD_LIBRARY_PATH
export INCLUDE=${PIO}/include:$INCLUDE
export USE_PIO2=true
#cmake
export CMAKE=${LIB}/cmake
export PATH=${CMAKE}/bin:$PATH
Although the versions of the libraries do not completely match those mentioned in your post about iolib_installation.sh
, I believe they should be compatible. However, as I followed the installation guide,
git clone -b MPAS_CMAQ https://github.com/USEPA/CMAQ.git CMAQ_REPO
cd CMAQ_REPO
vi bldit_project.csh
set CMAQ_HOME = /share/home/wjd/panting/MPASCMAQ/CMAQ_5.5
./bldit_project.csh
cd /share/home/wjd/panting/MPASCMAQ/CMAQ_5.5/CCTM/scripts
./bldit_cctm.csh intel
git clone -b MPAS7.0 git@github.com:USEPA/MPAS.git MPAS
cp -r /share/home/wjd/panting/MPASCMAQ/CMAQ_5.5/CCTM/scripts/BLD_CCTM_v55_intel_cracmm2_m3dry /share/home/wjd/panting/MPASCMAQ/MPAS/src/core_atmosphere/cmaq
make intel CORE=atmosphere USE_PIO2=true
I encountered the following error message.
What could be the cause of this error? Is the installation process not as straightforward as it seems, and do I need to make changes to files such as config_cmaq.csh
for CMAQ or the Makefile
for MPAS?
I also encountered this failure in the test of building the pio2.out. To work around it, I commented out the rm pio.f90 in the Makefile and compiled this program by hand.
pio_test:
..
@($(FC) pio1.f90 -ffixed-line-length-132 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o pio1.out &> /dev/null && echo "=> PIO 1 detected") || \
($(FC) pio2.f90 -ffixed-line-length-132 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o pio2.out &> /dev/null && echo "=> PIO 2 detected") || \
(echo "************ ERROR ************"; \
echo "Failed to compile a PIO test program"; \
echo "Please ensure the PIO environment variable is set to the PIO installation directory"; \
echo "************ ERROR ************"; \
# rm -rf pio[12].f90 pio[12].out; exit 1)
The other option is to ignore the fallure by removing the pio_test from the Makefile.
Replace
mpas_main: openmp_test mpio_test
with
mpas_main: openmp_test
2 Likes
Thank you very much for your patient answers! Since I used Intel and MVAPICH to compile various libraries, I modified the ifort
section in the Makefile:
Before modification:
After modification:
As a result, my compilation was able to run, but I encountered a new error at the end:IT_version=unknown
Could you please help me? I have provided my environment and commands here, and I look forward to your response very much!
myworkflow.txt (1.1 KB)
In addition, I have two questions:
- Is it necessary to run
./config_cmaq.csh
before copying CMAQ to the MPAS folder? Or can I just follow the operations in my attached files?
- The MPAS-CMAQ usage guide mentions, “The version of CMAQ that can be coupled with MPAS uses a new I/O system called MIO. This I/O code is in the
CCTM/src/mio
directory and is compiled along with MPAS and CMAQ. There is no need to compile a separate I/O API library for this CMAQ configuration.” However, I did not find the src
folder in the CCTM
folder; there is only a scripts
folder in CCTM
. I am very confused.
Prior to running bldit_cctm.csh in your myworkflow.txt please do the following:
Uncomment the set build_mpas_cmaq
option to build MPAS-CMAQ
#> MPAS-CMAQ coupled model
set build_mpas_cmaq #> uncomment to build MPAS-CMAQ coupled model;
Then run:
./bldit_cctm.csh intel
You will then need to redo the remaining steps.
2 Likes
There should be a Makefile (for CMAQ), MIO code, and CMAQ code in your build directory:
/share/home/wjd/panting/MPASCMAQ/CMAQ_5.5/CCTM/scripts/BLD_CCTM_v55_intel_cracmm2_m3dry
I’m curious what the output of your bldit_cctm.csh looks like. The source (src) directory is in the code repository (repo):
CMAQ_REPO/CCTM/src
The project directory ($CMAQ_HOME/CCTM) doesn’t have a “src” directory. It pulls the source code from the repo into the build directory (BLD_CCTM_v55_intel_cracmm2_m3dry). This BLD_** directory is then copied over to src/core_atmosphere/cmaq
5 Likes
@lizadams @willison.jeff
Thank you both for your replies! I think there might have been some issues already when I was installing CMAQ. After cloning MPAS_CMAQ,i set the "CMAQ_HOME"in bldit_project.csh
and then ran it. The interface looked like this:
Afterwards, I entered CMAQ_V5.5/CCTM/scripts
,uncommented the line “set build_mpas_cmaq” and directly ran ./bldit_cctm.csh intel
. But the interface looked like this,
error.txt (14.0 KB)
maybe I didn’t succeed in running this step at all. That would explain why my BLD_CCTM_v55_intel_cracmm2_m3dry
folder only contains these items and the Makefile
is an empty file.
I would like to know if I’ve missed something somewhere? Here I’m attaching my CMAQ_REPO/bldit_project.csh
and CMAQ_V5.5/CCTM/scripts/bldit_cctm.csh
files. I’m looking forward to and sincerely appreciate your answers!
bldit_project.csh (12.1 KB)
bldit_cctm.csh (38.0 KB)
I see a few errors in your error.txt. It seems to be related to your using mpiifort instead of mpifort.
setenv FC mpiifort
change to
setenv FC mpifort
You can verify the command that should be used by doing:
which mpifort
and
which mpiifort
To see which is correct.
This is the error message in your error.txt that is preventing progress.
mpiifort: Command not found.
mpiifort: Command not found.
mpiifort: Command not found.
mpiifort: Command not found.
mpiifort: No match.
***ERROR*** BLDMAKE Compile failed
Actually, the error may be in the config_cmaq.csh
Check these settings and verify that you are using mpifort not mpiifort.
setenv myFC mpifort
setenv myCC icc
The config_cmaq.csh on line 99 in the repo uses mpiifort, but this may not work for every system.
3 Likes
Thank you for your reply! I tried to follow your instructions and successfully set setenv myFC mpifort
, which allowed bldit_cctm.csh
to run without issues. However, after copying the BLD_*
files to MPAS, modifying the top-level MPAS/Makefile
by replacing mpas_main: openmp_test mpio_test
with mpas_main: openmp_test
, and making the changes to the ifort
section as I previously described, I encountered a new error when running make Intel CORE=atmosphere USE_PIO2=true
.
BTW, before running, I had already executed
csh env.csh
, and this script contains the following content:
#!/bin/csh -f
module delete netcdf/4.3.0
module add netcdf/4.8.0
module add PnetCDF/1.9.0
setenv PIO /share/home/wjd/wb/lib/pio-2.6.2
setenv NETCDF /nuist/p/public/app/netcdf/4.8.0/intel/18.0.0
setenv PNETCDF /nuist/p/public/app/PnetCDF/1.9.0
setenv USE_PIO2 true
Why am I still encountering such an error then?
I’m really sorry for encountering so many problems and disturbing you repeatedly.
Thank you for sharing your findings.
I believe that this section of the Makefile needs to be edited depending on what version of the pio library is compiled.
I am including the settings that I used, notice where I commented out the requirement to find -lpio, as on my system, there is only a -lpiof and -lpioc
#
# Depending on PIO version, libraries may be libpio.a, or libpiof.a and libpioc.a
# Keep open the possibility of shared libraries in future with, e.g., .so suffix
#
ifneq ($(wildcard $(PIO_LIB)/libpio\.*), )
# LIBS += -lpio
endif
ifneq ($(wildcard $(PIO_LIB)/libpiof\.*), )
LIBS += -lpiof
endif
ifneq ($(wildcard $(PIO_LIB)/libpioc\.*), )
LIBS += -lpioc
endif
ifneq ($(wildcard $(PIO_LIB)/libgptl\.*), )
LIBS += -lgptl
endif
The reason that this section fails is because there exists a file that meets the criteria but it is not the libpio.a library. My commenting out the -lpio is a workaround.
ls libpio\.*
libpio.settings