[MITgcm-support] Errors in the installation of MITgcm

ankan sarkar 519er2002 at nitrkl.ac.in
Fri May 20 08:18:29 EDT 2022


Hello Sir, 
Thank you for your response. Yes sir, the MPI library (Here, I am using OpenMPI) is installed in my system. To be sure about that, firstly, I have checked with the following command to see if the OpenMPI library is properly installed in my system or not. The commands and the corresponding outputs are given in the following: 
>>mpirun -version 

mpirun (Open MPI) 1.10.2 

Report bugs to http://www.open-mpi.org/community/help/ 

>>which mpirun 

/usr/local/openmpi/bin/mpirun 

>>which mpif77 

/usr/local/openmpi/bin/mpif77 

I have also checked that the 'mpif-config.h' file exists in the folder path /usr/local/openmpi/include/. So, I think OpenMPI is properly installed in my system and it's working. So, after that, I opened the opt file as you mentioned there must be something wrong going on along the lines of MPI. Like you said that it should be FC=mpif77 so that all the tests will be done with mpif77. So, I checked these lines and just changed the lines accordingly. The new modified lines in the opt file are: 
if test "x$MPI" = xtrue ; then 
CC=mpicc 
FC=mpif77 
F90C=mpif90 
else 
CC=gcc 
FC=gfortran 
F90C=gfortran 
fi 

While the lines in the previous opt file were: 

if test "x$MPI" = xtrue ; then 
CC=${CC:=mpicc} 
FC=${FC:=mpif77} 
F90C=${F90C:=mpif90} 
else 
CC=gcc 
FC=gfortran 
F90C=gfortran 
fi 

And, guess what?.. It throws no error, thankfully. And, I have checked that the new executable file 'mitgcmuv' exists now in the current folder (here, in this case, it is in build10_std) . So, I think you were right that previously there was some issue with the path of MPI library. So, now my question is, is MITgcm successfully installed now in my system? And is there any specific command to know about that? Though there was no error, I have seen some warning signs in the output lines after giving the make command. But, I am not sure whether this will hardly create any problems or not. I am attaching the output lines. Can you check these lines to make me sure about the correct installation? This will be really very much helpful for me. Thank you again. 

From: "Martin Losch" <Martin.Losch at awi.de> 
To: "mitgcm-support" <mitgcm-support at mitgcm.org> 
Sent: Friday, May 20, 2022 1:33:26 PM 
Subject: Re: [MITgcm-support] Errors in the installation of MITgcm 

Hi, 

I think that your compiler cannot link the appropriate libraries you somehow don’t have access to your mpi installation (if it exists). 

genmake2 with “-mpi” should select FC=mpif77, and not gfortran (see “optfile_MITgcmInstalation.txt”), so there’s already something going wrong there. The full output of genmake2 (genmake_state?) should look something like this (but you are using very old code and so it might be a little different): 

build (master) > ../../../tools/genmake2 -mods ../code -of /Users/mlosch/MITgcm/darwin_arm64_gfortran -mpi 

GENMAKE : 

A program for GENerating MAKEfiles for the MITgcm project. 
For a quick list of options, use "genmake2 -h" 
or for more detail see the documentation, section "Building the model" 
(under "Getting Started") at: https://mitgcm.readthedocs.io/ 

=== Processing options files and arguments === 
getting local config information: none found 
Warning: ROOTDIR was not specified ; try using a local copy of MITgcm found at "../../.." 
getting OPTFILE information: 
using OPTFILE="/Users/mlosch/MITgcm/darwin_arm64_gfortran" 
get Compiler-version: '12' 
getting AD_OPTFILE information: 
using AD_OPTFILE="../../../tools/adjoint_options/adjoint_default" 
check Fortran Compiler... pass (set FC_CHECK=5/5) 
check makedepend (local: 0, system: 1, 1) 
Turning on MPI cpp macros 

=== Checking system libraries === 
Do we have the system() command using mpif77... yes 
Do we have the fdate() command using mpif77... yes 
Do we have the etime() command using mpif77... c,r: yes (SbR) 
Can we call simple C routines (here, "cloc()") using mpif77... yes 
Can we unlimit the stack size using mpif77... yes 
Can we register a signal handler using mpif77... no 
Can we use stat() through C calls... yes 
Can we create NetCDF-enabled binaries... yes 
skip check for LAPACK Libs 
Can we call FLUSH intrinsic subroutine... yes 

=== Setting defaults === 
Adding MODS directories: ../code 
Making source files in eesupp from templates 
Making source files in pkg/exch2 from templates 
Making source files in pkg/regrid from templates 

=== Determining package settings === 
getting package dependency info from ../../../pkg/pkg_depend 
getting package groups info from ../../../pkg/pkg_groups 
checking list of packages to compile: 
using PKG_LIST="../code/packages.conf" 
before group expansion packages are: gfd exf seaice thsice diagnostics mnc 
replacing "gfd" with: mom_common mom_fluxform mom_vecinv generic_advdiff debug mdsio rw monitor 
after group expansion packages are: mom_common mom_fluxform mom_vecinv generic_advdiff debug mdsio rw monitor exf seaice thsice diagnostics mnc 
applying DISABLE settings 
applying ENABLE settings 
packages are: debug diagnostics exf generic_advdiff mdsio mnc mom_common mom_fluxform mom_vecinv monitor rw seaice thsice 
applying package dependency rules 
packages are: debug diagnostics exf generic_advdiff mdsio mnc mom_common mom_fluxform mom_vecinv monitor rw seaice thsice cal 
Adding STANDARDDIRS='eesupp model' 
Searching for *OPTIONS.h files in order to warn about the presence 
of "#define "-type statements that are no longer allowed: 
found CPP_EEOPTIONS="../../../eesupp/inc/CPP_EEOPTIONS.h" 
found CPP_OPTIONS="../../../model/inc/CPP_OPTIONS.h" 
Creating the list of files for the adjoint compiler. 

=== Creating the Makefile === 
setting INCLUDES 
Determining the list of source and include files 
Writing makefile: Makefile 
Add the source list for AD code generation 
Making list of "exceptions" that need ".p" files 
Making list of NOOPTFILES 
Add rules for links 
Adding makedepend marker 

=== Done === 
original 'Makefile' generated successfully 
=> next steps: 
> make depend 
> make (<-- to generate executable) 



It’s important that the tests are done with mpif77 and not gfortran. In your genmake.log all tests are done with gfortran. Does your system have mpi installed? did you load the appropriate modules so that the path contains mpif77 (which mpif77)? Please get in touch with your colleagues with access to the same computer to debug this part of the problem. 

Related: Does / usr/local/openmpi/include actually exist and is mpi working? In the genmake.log there are error messages like "genmake_tnc.f:1806: Error: Can't open included file 'mpif-config.h’”, which implies problems at that end. 
This seems to makes the netcdf test fail (not netcdf itself). 

So, bottom line: I think you mpi installation has a problem or you somehow cannot access it. 

Martin 




On 17. May 2022, at 14:18, ankan sarkar < 519er2002 at nitrkl.ac.in > wrote: 

Dear Sir/Madam, 

I am currently installing MITgcm as an ocean component of the RegCM-ES model. But, I am getting some errors during the installation of MITgcm when I gave the 'make' command. The last few lines of the errors that I am getting after giving the 'make' command is given in the following 
collect2: error: ld returned 1 exit status 
gmake[1]: *** [Makefile:1056: mitgcmuv] Error 1 
gmake[1]: Leaving directory '/data2/REGCM-ES/src/ocn/MITgcm_c63s/build10_std' 
make: *** [Makefile:1052: fwd_exe_target] Error 2 
I don't know why this error is coming. I am really stuck on this problem. 
For your convenience, 
I am giving the command lines that are used to install the standalone version of MITgcm in the following. 
mkdir build10_std 
cd build10_std 
/data2/REGCM-ES/src/ocn/MITgcm_c63s/tools/genmake2 -rootdir=/data2/REGCM-ES/src/ocn/MITgcm_c63s/ -optfile=/data2/REGCM-ES/src/ocn/MITgcm_c63s/tools/build_options/linux_amd64_gfortran -mods=/data2/REGCM-ES/src/ocn/MITgcm_c63s/CODE_MYMODS_STRESSES -make=gmake -mpi 
make depend 
make 
As per my system, I have modified some lines of the default opt file 'linux_amd64_gfortran' to link the libraries of NetCDF and mpi. I don't know if it is correct or not. Is the error coming because of the opt file? Can you look at the opt file? Can you guide me to modify the opt file according to my case? I am attaching the opt file with this. Note that, the environment variables $NETCDF and $MPI_INC_DIR in opt file are predefined in the bashrc file as 

export NETCDF=/usr/local/netcdf 

export MPI_INC_DIR=/usr/local/openmpi/include 

Also, I am attaching the all lines that I got after giving the 'make' command. So, that it can help you to understand the problem. Please have a look at these. Note that though there was no error after giving the 'make depend' command, I got the following error when I gave the third command line using genmake 

WARNING: the "mnc" package was enabled but tests failed to compile 
NetCDF applications. Please check that: 

NetCDF is correctly installed for this compiler and 
the LIBS variable (within the "optfile") specifies the correct 
NetCDF library to link against. 
Due to this failure, the "mnc" package is now DISABLED. 

So, is the error coming because of this or anything else? For your convenience, I am also attaching the genmake.log file if it helps. Additionally, I am also attaching the modified SIZE.h file which is in the folder path /data2/REGCM-ES/src/ocn/MITgcm_c63s/CODE_MYMODS_STRESSES. Please, anyone, help me in this regard. Any help on this would be very much appreciable. Thank you. 

With regards, 
Ankan <optfile_MITgcmInstallation.txt> <SIZE.h.txt> <genmake.log> <error_MITgcm_modelinstallation.txt> _______________________________________________ 
MITgcm-support mailing list 
MITgcm-support at mitgcm.org 
http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support 





_______________________________________________ 
MITgcm-support mailing list 
MITgcm-support at mitgcm.org 
http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20220520/9402b008/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MITgcm_InstallationOutput.txt
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20220520/9402b008/attachment-0001.txt>


More information about the MITgcm-support mailing list