<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I think that your compiler cannot link the appropriate libraries you somehow don’t have access to your mpi installation (if it exists).</div><div class=""><br class=""></div><div class="">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):</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">build</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #9fa01c" class=""> (master)</span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">> </b>../../../tools/genmake2 -mods ../code -of /Users/mlosch/MITgcm/darwin_arm64_gfortran -mpi</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">GENMAKE :</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">A program for GENerating MAKEfiles for the MITgcm project.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> For a quick list of options, use "genmake2 -h"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">or for more detail see the documentation, section "Building the model"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (under "Getting Started") at: <a href="https://mitgcm.readthedocs.io/" class="">https://mitgcm.readthedocs.io/</a></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Processing options files and arguments ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> getting local config information: none found</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Warning: ROOTDIR was not specified ; try using a local copy of MITgcm found at "../../.."</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> getting OPTFILE information:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> using OPTFILE="/Users/mlosch/MITgcm/darwin_arm64_gfortran"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> get Compiler-version: '12'</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> getting AD_OPTFILE information:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> using AD_OPTFILE="../../../tools/adjoint_options/adjoint_default"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> check Fortran Compiler... pass (set FC_CHECK=5/5)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> check makedepend (local: 0, system: 1, 1)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Turning on MPI cpp macros</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Checking system libraries ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Do we have the system() command using mpif77... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Do we have the fdate() command using mpif77... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Do we have the etime() command using mpif77... c,r: yes (SbR)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we call simple C routines (here, "cloc()") using mpif77... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we unlimit the stack size using mpif77... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we register a signal handler using mpif77... no</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we use stat() through C calls... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we create NetCDF-enabled binaries... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> skip check for LAPACK Libs</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Can we call FLUSH intrinsic subroutine... yes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Setting defaults ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Adding MODS directories: ../code </span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Making source files in eesupp from templates</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Making source files in pkg/exch2 from templates</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Making source files in pkg/regrid from templates</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Determining package settings ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> getting package dependency info from ../../../pkg/pkg_depend</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> getting package groups info from ../../../pkg/pkg_groups</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> checking list of packages to compile:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> using PKG_LIST="../code/packages.conf"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> before group expansion packages are: gfd exf seaice thsice diagnostics mnc</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> replacing "gfd" with: mom_common mom_fluxform mom_vecinv generic_advdiff debug mdsio rw monitor</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> after group expansion packages are: mom_common mom_fluxform mom_vecinv generic_advdiff debug mdsio rw monitor exf seaice thsice diagnostics mnc</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> applying DISABLE settings</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> applying ENABLE settings</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> packages are: debug diagnostics exf generic_advdiff mdsio mnc mom_common mom_fluxform mom_vecinv monitor rw seaice thsice</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> applying package dependency rules</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> packages are: debug diagnostics exf generic_advdiff mdsio mnc mom_common mom_fluxform mom_vecinv monitor rw seaice thsice cal</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Adding STANDARDDIRS='eesupp model'</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Searching for *OPTIONS.h files in order to warn about the presence</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> of "#define "-type statements that are no longer allowed:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> found CPP_EEOPTIONS="../../../eesupp/inc/CPP_EEOPTIONS.h"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> found CPP_OPTIONS="../../../model/inc/CPP_OPTIONS.h"</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Creating the list of files for the adjoint compiler.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Creating the Makefile ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> setting INCLUDES</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Determining the list of source and include files</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Writing makefile: Makefile</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Add the source list for AD code generation</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Making list of "exceptions" that need ".p" files</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Making list of NOOPTFILES</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Add rules for links</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Adding makedepend marker</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=== Done ===</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> original 'Makefile' generated successfully</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=> next steps:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> > make depend</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> > make (<-- to generate executable)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">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.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Related: Does /</span>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.</div><div class="">This seems to makes the netcdf test fail (not netcdf itself).</div><div class=""><br class=""></div><div class="">So, bottom line: I think you mpi installation has a problem or you somehow cannot access it.</div><div class=""><br class=""></div><div class="">Martin</div><div><br class=""><blockquote type="cite" class=""><div class="">On 17. May 2022, at 14:18, ankan sarkar <<a href="mailto:519er2002@nitrkl.ac.in" class="">519er2002@nitrkl.ac.in</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear Sir/Madam,<br class=""><br class="">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<br class="">collect2: error: ld returned 1 exit status<br class="">gmake[1]: *** [Makefile:1056: mitgcmuv] Error 1<br class="">gmake[1]: Leaving directory '/data2/REGCM-ES/src/ocn/MITgcm_c63s/build10_std'<br class="">make: *** [Makefile:1052: fwd_exe_target] Error 2<br class="">I don't know why this error is coming. I am really stuck on this problem.<br class="">For your convenience,<br class="">I am giving the command lines that are used to install the standalone version of MITgcm in the following.<br class="">mkdir build10_std<br class="">cd build10_std<br class="">/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<br class="">make depend<br class="">make<br class="">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 <br class=""><br class="">export NETCDF=/usr/local/netcdf<br class=""><br class="">export MPI_INC_DIR=/usr/local/openmpi/include<br class=""><br class="">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<br class=""><br class="">WARNING: the "mnc" package was enabled but tests failed to compile<br class="">NetCDF applications. Please check that:<br class=""><br class="">NetCDF is correctly installed for this compiler and<br class="">the LIBS variable (within the "optfile") specifies the correct<br class="">NetCDF library to link against.<br class="">Due to this failure, the "mnc" package is now DISABLED.<br class=""><br class="">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.<br class=""><br class="">With regards,<br class="">Ankan<span id="cid:C76233E5-72D0-465E-B7BD-1D6FB63ECFB7"><optfile_MITgcmInstallation.txt></span><span id="cid:7FF2888E-2356-49DA-AAEB-B4B0B6FEBE66"><SIZE.h.txt></span><span id="cid:5E65ED07-6148-4B7B-998C-DD08AECD6EBC"><genmake.log></span><span id="cid:A7188498-D901-459D-961D-89355A1AA007"><error_MITgcm_modelinstallation.txt></span>_______________________________________________<br class="">MITgcm-support mailing list<br class=""><a href="mailto:MITgcm-support@mitgcm.org" class="">MITgcm-support@mitgcm.org</a><br class="">http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br class=""></div></div></blockquote></div><br class=""></div></body></html>