[MITgcm-support] mnc package was enabled but tests failed to compile NetCDF

fancer fancer fancer.lancer at gmail.com
Tue Jul 17 14:06:32 EDT 2012


Hi Ben,

Please, carefully look on the darwin_amd64_gfortran configuration file. You
have sent the part of that script:

if [ "x$NETCDF_ROOT" != x ] ; then
    INCLUDEDIR="${NETCDF_ROOT}/opt/local/include"
    INCLUDES="-I${NETCDF_ROOT}/opt/local/include"
    LIBDIR="${NETCDF_ROOT}/opt/local/lib"
    LIBS="-L${NETCDF_ROOT}/opt/local/lib -lnetcdf -lcurl"
fi

If you haven't set NETCDF_ROOT environment variable, then condition
[ "x$NETCDF_ROOT" != x ] will no be true, because "x" == "x".
It you have set NETCDF_ROOT environment variable, then the under
conditional assignments will have wrong paths.

You have to get back the previous version of the script and set the right
path to the NETCDF_ROOT environment variable, for example:

NETCDF_ROOT=/opt/local/

if [ "x$NETCDF_ROOT" != x ] ; then
    INCLUDEDIR="${NETCDF_ROOT}/include"
    INCLUDES="-I${NETCDF_ROOT}/include"
    LIBDIR="${NETCDF_ROOT}/lib"
    LIBS="-L${NETCDF_ROOT}/lib -lnetcdf -lcurl"
fi

As alternative you can export the NETCDF_ROOT environment variable in your
current shell or in .profile:

export NETCDF_ROOT=/opt/local/

I have attached my configuration script to this e-mail. It works for me.
Perhaps it will be helpful for you.

Sincerely,
Sergey V. Semin

On Tue, Jul 17, 2012 at 5:50 PM, Ben Ward <benw at mit.edu> wrote:

> Hello,
> I am trying to setup MITgcm to run on a Mac Pro, 12 core (2 x 3.06 GHz
> 6-Core Intel Xeon) running Lion (OS X 10.7.4), but I cannot get genmake to
> see the netcdf package
>
> I have installed gcc and gfortran from http://hpc.sourceforge.net/
> hdf5 and netcdf-fortran have been installed with macports
> MITgcm was checked out this morning with the darwin and quota packages.
> The testreport for quota comes back good.
>
> I ran " ../../tools/genmake2 -mods=../code_limit ", and it selected
> the darwin_amd64_gfortran optfile, but spat out this error message:
>
> *********************************************************************
> WARNING: the "mnc" package was enabled but tests failed to compile
>   NetCDF applications.  Please check that:
>
>   1) NetCDF is correctly installed for this compiler and
>   2) the LIBS variable (within the "optfile") specifies the correct
>        NetCDF library to link against.
>
>   Due to this failure, the "mnc" package is now DISABLED.
> *********************************************************************
>
> (The full output is pasted at the end of the email.)
>
> I think this is related to the need to set the NETCDF_ROOT in the optfile.
> I think this is /opt/local, so I adjusted the optfile as follows
>
> if [ "x$NETCDF_ROOT" != x ] ; then
>     INCLUDEDIR="${NETCDF_ROOT}/opt/local/include"
>     INCLUDES="-I${NETCDF_ROOT}/opt/local/include"
>     LIBDIR="${NETCDF_ROOT}/opt/local/lib"
>     LIBS="-L${NETCDF_ROOT}/opt/local/lib -lnetcdf -lcurl"
> fi
>
> this made no difference.
>
> Any suggestions please.
>
> thank you,
>
> Ben
>
>
>
>
>
> grieg:build ward$ ../../tools/genmake2 -mods=../code_limit
>
> 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 Developer's HOWTO manual at:
>    http://mitgcm.org/public/docs.html
>
> ===  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:
> Warning: no OPTFILE specified so we'll look for possible settings
>
> ===  Searching for possible settings for OPTFILE  ===
>   The platform appears to be:  darwin_amd64
>   The possible FORTRAN compilers found in your path are:  gfortran
>   Setting OPTFILE to: ../../tools/build_options/darwin_amd64_gfortran
>     using OPTFILE="../../tools/build_options/darwin_amd64_gfortran"
>   getting AD_OPTFILE information:
>     using AD_OPTFILE="../../tools/adjoint_options/adjoint_default"
>
> ===  Checking system libraries  ===
>   Do we have the system() command using gfortran...  yes
>   Do we have the fdate() command using gfortran...  yes
>   Do we have the etime() command using gfortran...  no
>   Can we call simple C routines (here, "cloc()") using gfortran...  yes
>   Can we unlimit the stack size using gfortran...  yes
>   Can we register a signal handler using gfortran...  no
>   Can we use stat() through C calls...  yes
>   Can we create NetCDF-enabled binaries...  no
>
> ===  Setting defaults  ===
>   Adding MODS directories: ../code_limit
>   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_limit/packages.conf"
>     before group expansion packages are: ptracers gchem darwin quota
> generic_advdiff mdsio sbo timeave rw monitor mnc kpp
>     after group expansion packages are:  ptracers gchem darwin quota
> generic_advdiff mdsio sbo timeave rw monitor mnc kpp
>   applying DISABLE settings
>   applying ENABLE settings
>     packages are:  darwin gchem generic_advdiff kpp mdsio mnc monitor
> ptracers quota rw sbo timeave
> *********************************************************************
> WARNING: the "mnc" package was enabled but tests failed to compile
>   NetCDF applications.  Please check that:
>
>   1) NetCDF is correctly installed for this compiler and
>   2) the LIBS variable (within the "optfile") specifies the correct
>        NetCDF library to link against.
>
>   Due to this failure, the "mnc" package is now DISABLED.
> *********************************************************************
>   applying package dependency rules
>     packages are: darwin gchem generic_advdiff kpp mdsio  monitor ptracers
> quota rw sbo timeave
>   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_OPTIONS="../code_limit/CPP_OPTIONS.h"
>     found CPP_EEOPTIONS="../../eesupp/inc/CPP_EEOPTIONS.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  ===
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20120717/a6fa297d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin_amd64_gfortran
Type: application/octet-stream
Size: 2641 bytes
Desc: not available
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20120717/a6fa297d/attachment-0001.obj>


More information about the MITgcm-support mailing list