Installing ROMS on Mac - error compiling netCDF3 with gfortr

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
ckerry
Posts: 22
Joined: Wed Sep 15, 2010 1:59 pm
Location: UNSW Australia

Installing ROMS on Mac - error compiling netCDF3 with gfortr

#1 Unread post by ckerry »

Hi,
I am trying to install ROMS on a Mac following the directions at https://www.myroms.org/wiki/index.php/ROMS_Mac

I have downloaded netcdf-3.6.3.tar.gz and extracted it, then from the directory ~/src/netcdf-3.6.3 I execute
export FC=gfortran
export FFLAGS='-O3'
./configure --prefix=/opt/gfortran/serial/netcdf3

I get the following output, saying that Fortran could not compile .f90 files

checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
configure: checking user options
checking whether CXX is set to ''... no
checking whether FC is set to ''... no
checking whether F90 is set to ''... no
checking whether this is a netCDF-4.x build... no
checking whether netCDF extra tests should be run (developers only)... no
checking whether documentation is to be installed... no
checking whether Fortran compiler(s) should be tested during configure... yes
checking whether configure should try to set compiler flags... yes
checking whether FFIO will be used... no
checking whether to skip C++, F77, or F90 APIs if compiler is broken... yes
checking whether only the C library is desired... no
checking whether examples should be built... yes
checking whether F77 API is desired... yes
checking whether F90 API is desired... yes
checking whether fortran type sizes should be checked... yes
checking whether C API is desired... yes
checking where to get netCDF C-only library for separate fortran libraries...
checking whether CXX API is desired... yes
checking whether v2 netCDF API should be built... yes
checking whether the ncgen/ncdump should be built... yes
checking whether large file (> 2GB) tests should be run... no
checking whether benchmaks should be run (experimental)... no
checking whether extreme numbers should be used in tests... yes
checking where to put large temp files if large file tests are run... .
checking whether a win32 DLL is desired... no
checking whether separate fortran libs are desired... no
configure: finding C compiler
checking for xlc... no
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking whether cc understands -c and -o together... yes
checking for an ANSI C-conforming const... yes
configure: finding Fortran compiler (will not be used if Fortran API is not desired)
checking whether we are using the GNU Fortran compiler... no
checking whether gfortran accepts -g... yes
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files

I have followed all the instructions exactly and have installed the GNU Fortran Compiler. When I type 'which gfortran' I get '/usr/local/bin/gfortran'

Can anyone help me with why I am getting this error when I try to compile netCDF3 with gfortran...?

Thanks,
Colette

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Installing ROMS on Mac - error compiling netCDF3 with gfortr

#2 Unread post by robertson »

Please check the config.log file to see the actual error that is occurring and report back.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Installing ROMS on Mac - error compiling netCDF3 with gf

#3 Unread post by kate »

I think you need to set more than just FC. Here's what I used (for netcdf 4):

Code: Select all

configure FC=gfortran F77=gfortran F90=gfortran CXX=g++ --prefix=/u1/uaf/kate --enable-netcdf4 --enable-shared --with-hdf5=/u1/uaf/kate

Post Reply