NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdfgroup] netCDF-beta and 64-bit Snow Leopard build attempt (failed)

  • To: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] netCDF-beta and 64-bit Snow Leopard build attempt (failed)
  • From: Larry Baker <baker@xxxxxxxx>
  • Date: Tue, 19 Oct 2010 11:08:52 -0700
The reason I put the -m64 in the CC, CXX, and FC variables is so that - m64 is supplied to any LD step. That way the 64-bit libraries are used at link time. This is necessary on some of the platforms I've used. I think of -m64 as fundamentally selecting a different compiler; it's not really the same as other compile-time flags.

Larry Baker
US Geological Survey
650-329-5608
baker@xxxxxxxx

On Oct 19, 2010, at 10:35 AM, Ed Hartnett wrote:

Larry Baker <baker@xxxxxxxx> writes:

John,

I have no experience with the version of the library you are trying to
compile, nor with Snow Leopard yet.  However, my ./configure command
is slightly different than yours, esp. note -DgFortran:

        ./configure >configure.log 2>&1 \
           CC="gcc -m64" \
           CFLAGS="-g -O2" \
           CXX="g++ -m64" \
           CXXFLAGS="-g -O2" \
           CPPFLAGS="-DNDEBUG -DgFortran" \
           FC="gfortran -m64" \
           FCFLAGS="-g -O2"

Larry Baker
US Geological Survey
650-329-5608
baker@xxxxxxxx


#!/bin/bash
make distclean
#
export FCFLAGS='-m64'
export CC=/usr/bin/cc
export F77=gfortran
export FC=gfortran
export FCFLAGS=-qsuffix=cpp=f90
export CPPFLAGS='-Df2cFortran'
#
./configure --prefix=/usr/local/netcdf-4.1.2-beta1 --enable-f90 --
with-curl=/usr/local/lib

Assistance would be very helpful since I don't have a working copy
of GMT on this machine at the moment and need one.


It's a little confusing, but there are *two* sets of Fortran flags, one
for F77 (FFLAGS) and one for F90+ (FCFLAGS). If you are going to build
64 bit, with GNU compilers, you must use -m64 for BOTH F77 and
F90. Furthermore, you also need to use the same flag for C (and C++ if
you build that).

So a better set of environment vars for your flags would be:

CFLAGS=-m64
FFLAGS=-m64
FCFLAGS=-m64
CXXFLAGS=-m64

Setting CPPFLAGS is tricky, as it depends on your version of
gfortan. It should either be set to -Df2cFortran or (more likely)
-DgFortran. One way to handle this is to try setting neither, and see if
the netcdf configure script can figure it out.

I hope this answers all the questions!

Thanks,

Ed



--
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: