[MITgcm-support] Errors in the installation of MITgcm

Martin Losch Martin.Losch at awi.de
Fri May 20 04:03:26 EDT 2022


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20220520/ee1865af/attachment-0001.html>


More information about the MITgcm-support mailing list