troubl compiling NCAR graphics on new Mac OSX machine

From: Ronald L. Gilliland <gillil_at_nyahnyahspammersnyahnyah>
Date: Tue, 17 Mar 2009 12:23:11 -0400

Hello,

   I installed the new 5.1 version of NCL yesterday on
my new Intel-based MacBook Pro running 10.5.6.
   Everything went pretty smoothly getting to the point
of being able to run the example 'ng4ex xy01n -clean'
producing an on screen plot, and 'ncargex cpex08'
producing a metafile which I could display with idt,
convert with ctrans, etc.

   The only way in which I want to use NCL is for Fortran
callable graphics, which I've most recently for 5 yrs
done on a PowerPC-based Mac running 10.3, then 10.4.

   My problem is knowing how to set up a make file properly
that links in all the needed binaries. An example of
what has worked for 5 yrs on PowerPC, linking with IBM xlf
compiled fortran is:

----------------------------
SHELL=/bin/sh
#
CFT= xlf
FFLAGS= -O2 -qextname
.DEFAULT: .f
.SUFFIXES: .f
.f.o: $*.f
        $(CFT) -c $(FFLAGS) $*.f

OBJS= plser.o

#
LDFLAGS=
LIBS= /usr/local/ncarg/lib/libncarg.a /usr/local/ncarg/lib/
libncarg_gks.a \
         /usr/local/ncarg/lib/libncarg_c.a /usr/X11R6/lib/
libXpm.a /usr/X11R6/lib/libX11.a \
         /usr/X11R6/lib/libXext.a /usr/lib/gcc/darwin/2.95.2/
libcc_dynamic.a \
         /usr/lib/libSystemStubs.a /sw/lib/libg2c.a

COMMAND=plser.out

$(COMMAND): $(OBJS)
        $(CFT) $(LDFLAGS) -o $(COMMAND) $(OBJS) $(LIBS)

clean:
        rm $(OBJS) $(COMMAND)
------------------------------

   I'm now, at least temporarily, attempting to replicate similar using
gfortran on my Intel-based 10.5 machine.
   BUT, I'm at a loss for all of the libraries that need to be linked
in.
   I've found the libnarg.a, libncarg_gks.a and libncarg_c.a
under my /usr/local/lib and linked these in. The basic NCAR graphics
calls are recognized. But, I only see 'libX11.a' etc files in a
Developer directory with a 10.4 path, if I drill down in the one with
a 10.5 path I see only similar files ending in 'dylib' instead of 'a'.

   Without great confidence I'm doing the right thing I've linked
in the corresponding 'dylib' libraries. This led to a large number
of previously unreferenced "X" items not being complained about.

   But there are still issues. Using the following makefile:

-----------------------
SHELL=/bin/sh
#
CFT= gfortran
#FFLAGS= -O2 -qextname
FFLAGS=
.DEFAULT: .f
.SUFFIXES: .f
.f.o: $*.f
        $(CFT) -c $(FFLAGS) $*.f

OBJS= pltest2.o

#
LDFLAGS=
LIBS= /usr/local/lib/libncarg.a /usr/local/lib/libncarg_c.a \
        /usr/local/lib/libncarg_gks.a /sw/lib/libg2c.a \
        /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystemStubs.a \
        /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libXpm.4.dylib \
        /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.dylib \
        /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libXext.6.dylib

COMMAND=pltest2.out

$(COMMAND): $(OBJS)
        $(CFT) $(LDFLAGS) -o $(COMMAND) $(OBJS) $(LIBS)

clean:
        rm $(OBJS) $(COMMAND)
--------------------------

Results in problems:
About 60 lines of the type:
ld: warning for symbol _vctseq_ tentative definition of size 512 from /
usr/local/lib/libncarg.a(plotif.o) is is smaller than the real
definition of size 508 from /usr/local/lib/libncarg.a(utilbd.o)

And: some still Undefined symbols:
   "_png_malloc", referenced from:
       _write_png in libncarg_gks.a(pixwrite_png.o)
   "_png_write_png", referenced from:
       _write_png in libncarg_gks.a(pixwrite_png.o)

(a total of 8 of these all looking like above).
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [pltest2.out] Error 1

   Would anyone have a makefile for compiling codes with Fortran
on an Intel system that shows successful specification of libraries
that are needed? Or fairly explicit advice of what to try next,
I've read through the install and NCL FAQs pretty extensively.

   And, ultimately, if this matters I'm intending to switch to Intel
Fortran shortly.

Thanks,
Ron Gilliland

_______________________________________________
ncl-install mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-install
Received on Tue Mar 17 2009 - 10:23:11 MDT

This archive was generated by hypermail 2.2.0 : Wed Mar 18 2009 - 14:50:42 MDT