[netcdfgroup] Fwd: g77, g95, netcdf-g95 on mac

I apologize, I forgot to give a reply to: all.
Felipe


---------- Forwarded message ----------
From: Felipe Pimenta <felipepimenta@xxxxxxxxx>
Date: Jan 28, 2008 12:38 PM
Subject: Re: [netcdfgroup] g77, g95, netcdf-g95 on mac
To: Ian Harris <i.harris@xxxxxxxxx>


Hi Ian,

Thanks for your message. I've changed the path as you suggested inside
the subroutine write_netcdf.f (the only I have which includes
netcdf.inc) to:

include 'netcdf.inc'

The problem is that when compiling the subroutine, it doesn't find the file.
Running "make", the subroutines start to compile with no problem, until ....

...
...
g95      -O5    -c -o def_var_netcdf.o def_var_netcdf.f
g95      -O5    -c -o handle_netcdf_error.o handle_netcdf_error.f
g95      -O5    -c -o write_netcdf.o write_netcdf.f
Error: Can't open included file 'netcdf.inc'
make: *** [write_netcdf.o] Error 1

Even if I keep the path as include
'sw/lib/netcdf-g95/include/netcdf.inc' and at the I follow your
suggestion, it does not work:

g95      -O5   -o pom.exe pom2k.f areas_masks.o advave.o advq.o
advt1.o advt2.o advct.o advu.o advv.o baropg.o bcond.o bcondorl.o
box.o dens.o depth.o file2ic.o findpsi.o printall.o profq.o proft.o
profu.o profv.o prxy.o prxyz.o prxz.o pryz.o seamount.o slpmax.o
smol_adif.o vertvl.o def_var_netcdf.o handle_netcdf_error.o
write_netcdf.o  -L/sw/lib/libnetcdf.a
-l/sw/lib/netcdf-g95/include/netcdf
ld: can't locate file for: -l/sw/lib/netcdf-g95/include/netcdf

Thanks,

Felipe




On Jan 28, 2008 12:05 PM, Ian Harris <i.harris@xxxxxxxxx> wrote:
> Hi Felipe
>
> Not sure if this will help, but when I had problems last year I
> discovered that putting the path in the include statement didn't work
> - I had to put it on the compile line instead!
>
> So instead of having this near the start of the program:
>
> >>> include '/sw/lib/netcdf-g95/include/netcdf.inc'
>
> Try:
>
> include 'netcdf.inc'
>
> And then compile with:
> g77 -O5 -I/sw/lib/netcdf-g95/include -o pom.exe pom2k.f areas_masks.o
> advave.o advq.o advt1.o advt2.o advct.o advu.o advv.o baropg.o
> bcond.o bcondorl.o box.o dens.o depth.o file2ic.o findpsi.o
> printall.o profq.o proft.o profu.o profv.o prxy.o prxyz.o prxz.o
> pryz.o seamount.o slpmax.o smol_adif.o vertvl.o def_var_netcdf.o
> handle_netcdf_error.o write_netcdf.o -L/sw/lib/libnetcdf.a -lnetcdf
>
> Worth a try! And, for the record, I had lots of helpful suggestions
> that didn't work before I got the magic bullet - so don't give up!
>
> Cheers
>
> Harry
>
>
>
> On 28 Jan 2008, at 16:51, Felipe Pimenta wrote:
>
> > Dear Ed Hartnett and Roy Mendelssohn,
> >
> > Thanks for your email. I tried to compile the code with the
> > following flags:
> >
> > -fno-second-underscore and
> > -fno-underscoring
> >
> >  Together, separated and with g95 and g77. The problem still occurs. I
> > also checked  the packages I have from Fink:
> >
> >   g95     0.90-3  Another GNU Fortran 1995 compiler
> >   netcdf-g95      3.6.2-6 Interface & lib for array-based data access
> >
> > I've rebuild them from source with Fink, but I could not solve the
> > problem.
> >
> > Thanks,
> >
> > Felipe
> >
> >
> > On 1/26/08, Roy Mendelssohn <Roy.Mendelssohn@xxxxxxxx> wrote:
> >> Use whatever is he option that suppresses adding an underscore to
> >> subroutine names.
> >>
> >> -Roy M.
> >>
> >> On Jan 26, 2008, at 6:16 AM, Felipe Pimenta wrote:
> >>
> >>> Hi,
> >>>
> >>> I currently upgraded the netcdf of my mac power pc OS X 10.4.11 to
> >>> netcdf-g95 using fink (I will have to work with g95 in a near
> >>> future).
> >>>
> >>> However, a code that I used to run on g77 with netcdf not is not
> >>> compiling anymore. I've changed the library file path inside the
> >>> fortran subroutine to:
> >>>
> >>> include '/sw/lib/netcdf-g95/include/netcdf.inc'
> >>>
> >>> but the following problem occurs:
> >>>
> >>> g77 -O5  -o pom.exe pom2k.f areas_masks.o advave.o advq.o advt1.o
> >>> advt2.o advct.o advu.o advv.o baropg.o bcond.o bcondorl.o box.o
> >>> dens.o
> >>> depth.o file2ic.o findpsi.o printall.o profq.o proft.o profu.o
> >>> profv.o
> >>> prxy.o prxyz.o prxz.o pryz.o seamount.o slpmax.o smol_adif.o
> >>> vertvl.o
> >>> def_var_netcdf.o handle_netcdf_error.o write_netcdf.o
> >>> -L/sw/lib/libnetcdf.a -lnetcdf
> >>> /usr/bin/ld: Undefined symbols:
> >>> _nf_def_var__
> >>> _nf_put_att_text__
> >>> _nf_strerror__
> >>> _nf_close__
> >>> _nf_create__
> >>> _nf_def_dim__
> >>> _nf_enddef__
> >>> _nf_put_var_real__
> >>> _nf_put_vara_real__
> >>> collect2: ld returned 1 exit status
> >>> make: *** [pom.exe] Error 1
> >>>
> >>> I also tried to compile the code with g95, without success. Does
> >>> anybody have any suggestions?
> >>>
> >>> Thanks a lot,
> >>>
> >>> Felipe
> >>> _______________________________________________
> >>> netcdfgroup mailing list
> >>> netcdfgroup@xxxxxxxxxxxxxxxx
> >>> For list information or to unsubscribe,  visit: http://
> >>> www.unidata.ucar.edu/mailing_lists/
> >>
> >> **********************
> >> "The contents of this message do not reflect any position of the U.S.
> >> Government or NOAA."
> >> **********************
> >> Roy Mendelssohn
> >> Supervisory Operations Research Analyst
> >> NOAA/NMFS
> >> Environmental Research Division
> >> Southwest Fisheries Science Center
> >> 1352 Lighthouse Avenue
> >> Pacific Grove, CA 93950-2097
> >>
> >> e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
> >> voice: (831)-648-9029
> >> fax: (831)-648-8440
> >> www: http://www.pfeg.noaa.gov/
> >>
> >> "Old age and treachery will overcome youth and skill."
> >>
> >>
> >>
> >>
> >
> >
> > --
> > =================================
> > Felipe  Mendonca  Pimenta
> > College of Marine and Earth Studies
> > University of Delaware, 211 Robinson Hall
> > Newark, DE, 19716-3501 USA
> > Phone: (302) 831-2848, felipe@xxxxxxxx
> > =================================
> > _______________________________________________
> > netcdfgroup mailing list
> > netcdfgroup@xxxxxxxxxxxxxxxx
> > For list information or to unsubscribe,  visit: http://
> > www.unidata.ucar.edu/mailing_lists/
>
> Ian "Harry" Harris
> Climatic Research Unit
> School of Environmental Sciences
> University of East Anglia
> Norwich NR4 7TJ
> United Kingdom
>
>
>



--
=================================
Felipe  Mendonca  Pimenta
College of Marine and Earth Studies
University of Delaware, 211 Robinson Hall
Newark, DE, 19716-3501 USA
Phone: (302) 831-2848, felipe@xxxxxxxx
=================================



-- 
=================================
Felipe  Mendonca  Pimenta
College of Marine and Earth Studies
University of Delaware, 211 Robinson Hall
Newark, DE, 19716-3501 USA
Phone: (302) 831-2848, felipe@xxxxxxxx
=================================


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