[MITgcm-support] Unable to compile

Gus Correa gus at ldeo.columbia.edu
Wed Sep 2 20:24:21 EDT 2020


Hi Kunal

You can choose the optfile that genmake2 will use
with genmake2 -of path_to_the_optfile (keep the -mpi flag also).
The optifiles are in the tools/build_options directory.
You can either use one of the existing optfiles, or take one of them and
modify to
fit your computer (the compiler, MPI, and netCDF library that you have).
You seem to have the only gfortran compiler right?
However, you are using an optfile that requires the PGI compiler.
I'd suggest to switch to an optifile based on gfortran instead.
This will also make it easier to use a netCDF library from Linux packages,
which are consistent with gfortran, but may not be consistent with PGI.

In general you can also make modifications to the code in a "code"
directory/folder,
where you put the modified code files. Normally this includes packages.conf
(to choose which
packages will be compiled and included in the MITgcm executable),
SIZE.h (to set up the MITgcm MPI domain decomposition), and other code
files appropriate to your experiment.
These are .F90 and .h files that you normally copy from the packages (pkg)
directories, and/or from the main
model and eesupp directories, and then make small modifications to adapt
them to your experiment.
For this to work you need to add
-mods path_to_the_code_modification_directory
to your genmake2 command line.

Take a closer look at the examples in the MITgcm "verification" directory,
as they may help clarify the way you set up,
compile, and run an MITgcm experiment.
http://lxr.mitgcm.org/lxr2/source/MITgcm/verification/
The global_ocean.90x40x15 experiment is a good starting point.

The error you're getting suggests that you either don't have a netCDF
library installed,
or the optfile you are using does not point to the correct location of your
netCDF library.
If you are using Linux, it is easy to get a netCDF library from your Linux
distribution packages
(something like "yum install netcdf", or "dnf install netcdf", or "apt-get
netcdf", depending on the distribution).
You may also need the "netcdf-devel" and "netcdf-fortran" packages.
You can list all that are available with something like "yum list | grep
netcdf", then make your choices of what to install.

In any case, check the optfile you have, make a copy of it with a modified
name,
and check if the variables NETCDF_ROOT, NETCDF_HOME, NETCDF_INC, NETCDF_LIB,
point to the correct location where your netCDF library is installed.

Likewise, you need to have an MPI library installed in your computer, if
you don't have one yet.
For example, you can get OpenMPI from Linux packages.

All suggestions above depend very much on the computer you are using, if it
is your own desktop,
or a laptop, or your university cluster, etc.
If you provide more details about the computer (type, operating system
(Linux?) and distribution,
if it has MPI and netCDF installed, which compiler you have and/or want to
use, etc, that may help
you get more specific suggestions.

I hope this helps,
Gus Correa


On Wed, Sep 2, 2020 at 11:53 AM kunal madkaiker <kunal.madkaiker02 at gmail.com>
wrote:

> Dear All,
>
> Am sorry for the confusion. I meant the "optfiles" instead of modules.
> I haven't added any modules so far, and was just trying to compile using
> the already provided optfiles.
>
> Also, Tried to run compile.sh using...
> .../tools/genmake2 -mpi
> make depend
> make
>
> When run on a local machine, it chooses gfortran and mpi77 as the suitable
> combination. But not in the case for HPC
> ===  Searching for possible settings for OPTFILE  ===
>   The platform appears to be:  linux_amd64
>   The possible FORTRAN compilers found in your path are:  gfortran f95
>   Setting OPTFILE to: ../../../../tools/build_options/linux_amd64_gfortran
>     using OPTFILE="../../../../tools/build_options/linux_amd64_gfortran"
> ../../../../tools/build_options/linux_amd64_gfortran: line 131: nf-config:
> command not found
> Package ompi was not found in the pkg-config search path.
> Perhaps you should add the directory containing `ompi.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'ompi' found
> MPI_HOME is not set and pkg-config not available, aborting
> make: *** No rule to make target `depend'.  Stop.
> make: *** No targets specified and no makefile found.  Stop.
>
> Kindly assist as to what changes I need to make, in this case,
> linux_amd64_gfortran optfile.
> I apologise for my lack of knowledge, since I have just started handling
> HPC.
>
> Regards
> Kunal
>
> On Thu, Aug 27, 2020 at 4:35 AM Michael Schaferkotter <
> schaferk at bellsouth.net> wrote:
>
>> you using (in the first case) pgi build options, yet gfortran (gcc) is
>> the compiler.
>> you need the compiler to be ifort. no telling what modules you have
>> loaded.
>>
>> report what ‘module list’ returns.
>>
>>
>> Sent from Here3.
>>
>> > On Aug 26, 2020, at 17:10, kunal madkaiker <kunal.madkaiker02 at gmail.com>
>> wrote:
>> >
>> > Dear MITgcm users,
>> >
>> > I am trying to run the model on hpc. In order to compile, I am using
>> the available modules from MITgcm/tools/build_options.
>> > Tried with 2 of the modules i.e. linux_amd64_pgf90+mpi_xd1 and
>> linux_amd64_ifort+impi, but getting compilation error from both. I am using
>> the MITgcm_c67f version
>> >
>> > My compiling script is:
>> > /home/adrao/Model/MITgcm_c67f/MITgcm/tools/genmake2
>> --optfile=/home/adrao/Model/MITgcm_c67f/MITgcm/tools/build_options/linux_amd64_pgf90+mpi_xd1
>> -mpi
>> > make depend
>> > make
>> > ---------
>> > The error that I get for linux_amd64_pgf90+mpi_xd1 is,
>> >
>> > cat chksum_tiled.F |  /usr/bin/cpp -P -traditional -DWORDLENGTH=4
>> -DALLOW_USE_MPI  -I/sopt/mpi/mpich/pgi/include
>> -I/sopt/netcdf/netcdf3-gcc-serial/include |
>> ../../../../tools/set64bitConst.sh  > chksum_tiled.f
>> > mpif90 -byteswapio -Mnodclchk -O2 -Munroll  -c chksum_tiled.f
>> > gfortran: error: unrecognized command line option ‘-byteswapio’
>> > gfortran: error: unrecognized command line option ‘-Mnodclchk’
>> > gfortran: error: unrecognized command line option ‘-Munroll’
>> > Makefile:1484: recipe for target 'chksum_tiled.o' failed
>> > make[1]: *** [chksum_tiled.o] Error 1
>> > make[1]: Leaving directory
>> '/home/adrao/Model/MITgcm_c67f/MITgcm/verification/kunal_RUNTESTRUN/test_trial/testing_mpi_compiler'
>> > Makefile:1392: recipe for target 'fwd_exe_target' failed
>> > make: *** [fwd_exe_target] Error 2
>> > ---------
>> > Whereas, for linux_amd64_ifort+impi is,
>> > cat chksum_tiled.F |  cpp -traditional -P -DWORDLENGTH=4
>> -DALLOW_USE_MPI  -I/usr/local/netcdf3/include
>> -I/usr/local/bin/mpich/include | ../../../../tools/set64bitConst.sh  >
>> chksum_tiled.f
>> > mpiifort -m64 -convert big_endian -assume byterecl -mcmodel=medium -O2
>> -align -ip -fp-model source -xHost  -c chksum_tiled.f
>> > make[1]: mpiifort: Command not found
>> > Makefile:1491: recipe for target 'chksum_tiled.o' failed
>> > make[1]: *** [chksum_tiled.o] Error 127
>> > make[1]: Leaving directory
>> '/home/adrao/Model/MITgcm_c67f/MITgcm/verification/kunal_RUNTESTRUN/test_trial/testing_mpi_compiler'
>> > Makefile:1399: recipe for target 'fwd_exe_target' failed
>> > make: *** [fwd_exe_target] Error 2
>> >
>> > Also, attaching genmake2, genmake.log files for both.
>> > Kindly assist in case I need to edit the modules, or if an alternative
>> is available. Thanks!
>> >
>> > Regards
>> > Kunal
>> > <genmake2>
>> > <ifort_impi_genmake.log>
>> > <linux_amd64_pgf90+mpi_xd1_genmake.log>
>> > _______________________________________________
>> > 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
>>
> _______________________________________________
> 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/20200902/aeb91859/attachment.html>


More information about the MITgcm-support mailing list