Re: ncarg 4.4.1 compile problem

From: Rick Grubin <grubin_at_nyahnyahspammersnyahnyah>
Date: Wed, 17 May 2006 08:52:10 -0600

Hello,

> I have problem in compiling the ncarg 4.4.1 code which I am trying for
> first time. The following are specifications
>
> AMD Dual core 64 bit
> Linux (centos 4.2)
> Intel compiler 9.0.031

We don't have a system that exactly duplicates what you have, but can
come reasonably close: x86_64 host running SuSE ES v9

> compiling with config/LINUX.64.INTEL with following define statements
>
> #define HdfDefines -DLINUX
> #define StdDefines -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE
> -DDWORDSIZE=8

This looks OK...

> #define convert big_endian

I realize that this is a switch for Intel's Fortran compiler (ifort)
but do not believe it effects anything related to the build of NCAR
Graphics. If you wish this to be a flag to ifort, I suggest using it
in the FcOptions definition in the $NCARG/config/LINUX file, as well as
defining it at the shell level. As an example, here is what I use to
build NCAR Graphics with the Intel compilers:

setenv CC icc
setenv CPPFLAGS '-DNDEBUG -DLINUX -DUSE_STDARG -DHAVE_STDLIB_H
-DHAVE_STRING_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DUSE_STDARG
-DMALLOC_RET_VOID'
setenv CFLAGS '-O2 -ansi -fPIC'
setenv FC ifort
setenv F77 ifort
setenv FFLAGS '-O2 -integer_size 32 -real_size 32 -fPIC'
setenv CXX icpc
setenv CXXFLAGS '-O2 -ansi -DNDEBUG -DLINUX -DUSE_STDARG
-DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H -DHAVE_STDARG_H
-DUSE_STDARG -DMALLOC_RET_VOID'

setenv LD_LIBRARY_PATH
/coral/local/intel/cce/9.0/lib:/coral/local/intel/fce/9.0/lib:/lib64

This configuration will create a working NCAR Graphics for Intel
compilers.

> #define CCompiler cc

Do you mean this to be 'icc' -- Intel's C compiler -- or really 'cc'?
I don't know what 'cc' is on your host, but on mine it's a link to gcc.
  And I suspect this is where your problems noted below come from: the
undefined references for 's_copy' and 's_cmp' and other 's_xxxx'
symbols come from the library libg2c.a -- a GNU compiler library.

> The above error follows same udefined reference few lines of which is
> given below
>
> cfwrit.f: In subroutine `cfwrit':
> cfwrit.f:52: warning:
> CALL BINWRI(IUNIT, WRLEN, CHSTRT, IOS, STATUS)
> 1
> cfwrit.f:54: (continued):
> CALL BINWRI(IUNIT, NWRDS, BUFFER, IOS, STATUS)
> 2
> Argument #3 of `binwri' is one type at (2) but is some other type at
> (1) [info
> -f g77 M GLOBALS]
> f77 -O2 -c -o ffgttk.o ffgttk.f [...]
> ifort -O2 -o fontc cfaamn.o cfrdln.o cfwrit.o ffgttk.o ffinfo.o
> ffphol.o ffppkt.o ffprcf.o ffprsa.o fftbkd.o fftkin.o sffndc.o
> sfgtin.o
> sfgtkw.o sfprcf.o sfskbk.o sftbkd.o
> -L../../.././common/src/libncarg_c
> -lncarg_c -L/usr/local/ncarg/lib -L/usr/X11R6/lib64
> ffgttk.o(.text+0x53): In function `ffgttk_':
> : undefined reference to `s_cmp'
> ffgttk.o(.text+0xc1): In function `ffgttk_':
> : undefined reference to `s_copy'
> [...]

If you really do want to use 'cc' (and thus, I think, gcc) then you'll
need to change some of your definitions for compiler switches and
flags. I've never tried to mix-and-match gcc and ifort, and the
following is untested. I would start with what's below and go from
there with trial and error.

At the shell level:
setenv CC cc
setenv CPPFLAGS '-DNDEBUG -Df2cFortran'
setenv CFLAGS '-O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC'
setenv FC ifort
setenv F77 ifort
setenv FFLAGS '-O2 -integer_size 32 -real_size 32 -double_size=64 -fPIC'
setenv CXX icpc
setenv CXXFLAGS '-O2 -ansi -DNDEBUG -DLINUX -DUSE_STDARG
-DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H -DHAVE_STDARG_H
-DUSE_STDARG -DMALLOC_RET_VOID'

setenv LD_LIBRARY_PATH
/coral/local/intel/cce/9.0/lib:/coral/local/intel/fce/9.0/lib:/lib64

and I'd have my $NCARG/config/LINUX file as:

#define StdDefines -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE
-DDWORDSIZE=8 -DByteSwapped
#define Cstatic
#define Cdynamic
#define CppCommand '/usr/bin/cpp -traditional'
#define CCompiler cc
#define FCompiler ifort
#define CtoFLibraries -lg2c -lgcc -lm
#define CcOptions -ansi -fPIC
#define FcOptions -integer_size 32 -real_size 32 -double_size 64
-fPIC -mp
#define COptimizeFlag -O2
#define FOptimizeFlag -O2
#define XToolLibrary -lXt -lSM -lICE
#define BuildShared NO
#define XLibrary -lXpm -lX11 -lXext

#define ArchRecLibSearch -L/usr/X11R6/lib64
#define ArchRecIncSearch -I/usr/X11R6/include

Good luck.
-Rick.

----
Rick Grubin      NCAR/CISL/SCD/VETS
Visualization + Enabling Technologies
grubin_at_ucar.edu             303.497.1832
_______________________________________________
ncarg-talk mailing list
ncarg-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
Received on Wed May 17 2006 - 08:52:10 MDT

This archive was generated by hypermail 2.2.0 : Wed May 17 2006 - 10:07:40 MDT