pgf90-Error-Unknown switch: -M/opt/netcdf4/lib

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
phamsymt
Posts: 26
Joined: Fri May 09, 2008 3:21 pm
Location: center for environment

pgf90-Error-Unknown switch: -M/opt/netcdf4/lib

#1 Unread post by phamsymt »

Hello,

I am trying to build ROMS v3.4 with pgi10.6 and netcdf-4.1-beta2 on UBUNTU 10.10. I met an error as following:
......................
cp -p /home/dhson/make_macros.mk Build
makefile:234: INCLUDING FILE Build/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
/opt/pgi/linux86-64/10.6/bin/pgf90 -O3 Build/roms_import.o Build/propagator.o Build/master.o Build/roms_export.o Build/ocean_coupler.o Build/esmf_roms.o Build/ocean_control.o -o /home/dhson/ROMS/run/oceanS Build/libUTIL.a Build/libNLM.a Build/libNLM_bio.a Build/libNLM_sed.a Build/libANA.a Build/libUTIL.a Build/libMODS.a -M/opt/netcdf4/lib -lnetcdf
rm -f -r /home/dhson/make_macros.mk
pgf90-Error-Unknown switch: -M/opt/netcdf4/lib
make: *** [/home/dhson/ROMS/run/oceanS] Error 1

I highly appreciate any helps

Pham Van Sy (Mr)
E-mail: phamsymt@gmail.com

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: pgf90-Error-Unknown switch: -M/opt/netcdf4/lib

#2 Unread post by m.hadfield »

I think this is an issue with the output of netCDF's nc-config command, via these lines in the make file

Code: Select all

ifdef USE_NETCDF4
        NC_CONFIG ?= nc-config
...
             LIBS := $(shell $(NC_CONFIG) --flibs)
else
...
You can confirm this by running "nc-config --flibs" at the command line, yourself.

You shouldn't be using a beta copy of netCDF, especially a relatively old one, as the nc-config script has been developed over the past couple of years, and there have been a few breakages in the betas along the way. (In fact I think I remember this specific problem, but my memory ain't so good these days.)

I suggest you install the latest stable version of netCDF (netcdf-4.1.3) and try again. You can get it here:

ftp://ftp.unidata.ucar.edu/pub/netcdf/n ... 1.3.tar.gz

Alternatively, as a work-around, you could edit the nc-config script. I think all you need to do is replace -M with -L in the flibs variable.

phamsymt
Posts: 26
Joined: Fri May 09, 2008 3:21 pm
Location: center for environment

Re: pgf90-Error-Unknown switch: -M/opt/netcdf4/lib

#3 Unread post by phamsymt »

I greatly appreciate for your help.

As you mention, I replaced -M with -L in the flibs variable. Now it is compiled without any errors

Thank you very much

Post Reply