DOC Version 1.02

2002/10/06

by Jean-Daniel GRIL

CNRM/GMAP/COOPE

E-mail : Jean-Daniel.GRIL++at++Meteo.fr

Tel : +33 (0) 561 078 416



What is PALADIN ?

Paladin is for Portable Auxillary Library And Development tools for aladIN.


The use of this package is to create a portable :

To do these you need gmake (gnu make), perl and ksh (or bash)

The package use the e-make utility of Eric Sevault modified by me.


0- Summary


  1. Directories tree

  2. Tested compilers

  3. Defined keys

  4. Description of files needed and used by « gmake »

  5. How to use « gmake »

  6. How to compile libraries and programs

  7. Endian problems on Linux/Intel

  8. Others compiler problems

  9. News & Changes


1- Directories tree



2- Tested Compilers


OS

Version

Mainframe

Compiler

Linux

2.4.18 #

alpha

egcs-2.91.66 (Compacq Fortran compiler)

Linux

2.4.17 #1

i686

Lahey/Fujitsu Fortran 95 Express Release L6.00a S/N: LX072865

Linux

2.4.3-20mdk #1

i686

pgf90 3.2-4 Copyright 1989-2001, The Portland Group, Inc.

Linux

2.4.18-6mdk #1

i686

pgf90 4.0-2 Copyright 1989-2000, The Portland Group, Inc. Copyright 2000-2002, STMicroelectronics, Inc.

HP-UX

B.11.00 A

9000/782

HP F90 v2.4

HP-UX

B.11.00 U

9000/800

HP F90 v2.5.3

SunOS

5.6

SUNW,Ultra-4

Fujitsu Fortran Compiler Driver Version 4.0.2.1

SunOS

5.6

SUNW,Ultra-4

Sun WorkShop 6 2000/04/07 FORTRAN 95 6.0

IRIX64

irix 6.5.10

IP30 mips

MIPSpro Compilers : Version 7.30



3- Defined Keys


OS

Compiler

Tested by

In e-make.0.3/arch/

Key

Locations where used

SunOS

Sun

J-D Gril

Makefile.in.SUN4S

-DSUN






./e-make.0.3/arch/Makefile.in.SUN4S

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/xbyte.c (file not used)

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/lfi/include/lficom0.h

-DSUN4S

./e-make.0.3/arch/Makefile.in.SUN4S

./src/jdglib/include/mykind.h

SunOS

Fujitsu

J-D Gril

Makefile.in.SUN4F

-DSUN






./e-make.0.3/arch/Makefile.in.SUN4F

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/xbyte.c (file not used)

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/lfi/include/lficom0.h

-DSUN4F

./e-make.0.3/arch/Makefile.in.SUN4F

HP-UX

HP

J-D Gril

Makefile.in.HP11H

-DHPPA






./e-make.0.3/arch/Makefile.in.HP11H

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/xbyte.c (file not used)

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/lfi/include/lficom0.h

-DHP11H


remember to use hpscriptFf before

./e-make.0.3/arch/Makefile.in.HP11H

-DHPF90I253

./jdglib/include/mykind.h

(for compiler version before 2.5.3)

Linux

PGI

J-D Gril

Makefile.in.LX86P

-DLX86P

./e-make.0.3/arch/Makefile.in.LX86P

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/grib_mf/Makefile.loc

./src/xrd/lfi/include/lficom0.h

Linux

Lahey/Fujitsu

Neva Pristov

Makefile.in.LX86L

-DLX86P

./e-make.0.3/arch/Makefile.in.LX86L

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/grib_mf/Makefile.loc (key not necessary here) ./src/xrd/lfi/include/lficom0.h

Linux

Compacq

Neva Pristov

Makefile.in.LalphaC

-DDEC

/e-make.0.3/arch/Makefile.in.LalphaC

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/lfi/include/lficom0.h

./src/xrd/support/ishell.F (routine not use in xrd)

IRIX64

MIPSpro

Pascal Lamboley

Makefile.in.IRIX64M

-DSGI





./e-make.0.3/arch/Makefile.in.IRIX64M

./src/xrd/fa/include/facomp.h

./src/xrd/grib_mf/gsbyte_mf.F

./src/xrd/grib_mf/mxmn_mf.F

./src/xrd/lfi/include/lficom0.h

-UCRAY

It s a Cray compiler (must not use the default compiler pre-defined key)


In fact this key gives the "Linux type" to the compiler but it's not necessary for PGI bug because it's not PGI compiler. But

it's not a problem because the pgi modified files force the optional argument SIZE only. I'll do better in next version.

way to do Little Endian conversion.


4- Description of files needed and used by "gmake"


with OSMFC is OS = OS

MF = MainFrame (except for SUN)

C = Compiler

(in fact gmake -r look at about ./e-make.0.3/arch/Makefile.in.OSMFC file)

In tested configurations we don't use *.c source files, so CC and CFLAGS are empty.


IS_LIT_E

= N

default if not present

= Y

if you have a Mainframe with Little Endian (as PC).

FMODINC

=

is the compiler option to specify where are the include

FMODEXT

=

is the extension of module files

FMODWRT

=

is the compiler option to specify where are stored the module files

FMODUP

= Y

to make module name uppercase : XXXXXXX.$(FMODEXT)

= N

otherwise (default) : xxxxxxx.$(FMODEXT)

SHARED

= Y

shared libraries (*.so or *.sl extensions)

if both are "N" then only *.o files will be done

STATLIB

= Y

static libraries (*.a extensions)

AR

= ar

program doing archive static libraries (*.a)

ARFLAGS

= rv

its options

LD

= ld

linker used to make shared libraries (depends mainframe)

LDFLAGS

= -shared

its options (depends ld version used)

SHRSUFX

= so

extension of shared libraies (depends mainframe)

PRGSTATFG

= -Wl,-Bstatic

for program compilation, options passed to linker to use static libraries at link

PRGDYNAFG

= -Wl,-Bdynamic

for program compilation, options passed to linker to use shared libraries at link




SHELL

= /bin/ksh

path of your shell (may be bash, better is ksh or sh)

ARCH

= OSMFC

description of the letters above

ifeq ($(MAKELEVEL), 0)


don't touch

MAKE

= /usr/bin/gmake

use only gmake (gnu), give the path

MAKEFLAGS

= r

you must use at least r option

MKTOP

= $(CURDIR)

don't touch

MKLOG

= $(CURDIR)/Makefile.log

don't touch

LOGFILE

= logfile

don't touch

MKROOT

= $(MKTOP)/e-make.$(VERSION)

don't touch

MKOUT

= $(MKTOP)/$(ARCH)

directory where the outputs will be locate (use a temprary directory, not your $HOME or /usr/local : see gmake -r clean-out command below)

MKMOD

= $(MKOUT)/mod

at your own risk

MKINC

= $(MKOUT)/include

at your own risk

MKLIB

= $(MKOUT)/lib

at your own risk

MKBIN

= $(MKOUT)/bin

at your own risk

MKBRPATH

= $(shell find . -type f -print | egrep -i -e ".(f90|h)$$" | perl -w $(MKROOT)/perl/depdir.pl)

don't touch

endif


don't touch




./Makefile.loc

SUBDIRS = src

./src/xrd/Makefile.loc

SUBDIRS = include module support lfi fa grib_mf

./src/jdglib/Makefile.loc

SUBDIRS = include module

./src/divers/Makefile.loc

SUBDIRS = biper

./src/eggx/Makefile.loc

SUBDIRS = old_eggx new_eggx

./src/jdgprg/Makefile.loc

SUBDIRS = edf ecto frodo pseudo domolalo

./src/Makefile.loc

SUBDIRS = dummy xrd eggx divers jdglib jdgprg


(Endian pb and ISHFTC intrinsic routine bug - optional argument SIZE needed)

SRC_NOTUSED := gsbite_mf.c gsbite_mf.F xbyte.c

ifeq "$(IS_LIT_E)" "Y"

SRC_NOTUSED := $(SRC_NOTUSED) packgb.F unpagb.F

else

SRC_NOTUSED := $(SRC_NOTUSED) packgb.le.F unpagb.le.F

endif

ifeq "$(ARCH)" "LX86P"

SRC_NOTUSED := $(SRC_NOTUSED) sbyte_mf.F sbytes_mf.F

else

SRC_NOTUSED := $(SRC_NOTUSED) sbyte_mf.pgi.F sbytes_mf.pgi.F

endif

ifeq "$(ARCH)" "VPP5000"

SRC_NOTUSED := set99.F fft991.F qpassm.F rpassm.F

else

SRC_NOTUSED := set99.vpp.F fft991.vpp.F qpassm.vpp.F rpassm.vpp.F

endif


(extension '.a' is added by "gmake") with LIB variable

LIB = $(CURDIR)/libbiper_$(ARCH)

LIB = $(CURDIR)/libdummy_$(ARCH)

LIB = $(CURDIR)/libneweggx_$(ARCH)

LIB = $(CURDIR)/liboldeggx_$(ARCH)

LIB = $(CURDIR)/libjdg_$(ARCH)

LIB = $(CURDIR)/libxrd_$(ARCH)


variables EXE (name of executable), SRCP (source program name), LIBS (libraries needed by linker)

(the name of libraries are as libXXX_$(ARCH).a, for the linker only the XXX_$(ARCH) part of name is usefull,

and for LIBS variable only the XXX is usefull because "gmake" adds '_$(ARCH)'). These variables are only used in

program compilation part, see below)

EXE = edf

SRCP = editfield.o

LIBS = jdg xrd dummy neweggx oldeggx

EXE = ecto

SRCP = ectoplasme.o

LIBS = jdg xrd dummy neweggx oldeggx

EXE = frodo

SRPC = frodo.o

LIBS = jdg xrd dummy neweggx oldeggx

EXE = pseudo

SRCP = pseudo.o

LIBS = jdg xrd dummy neweggx oldeggx

EXE = domolalo

SRCP = domolalo.o

LIBS = jdg xrd dummy neweggx oldeggx



VPATH = $(MKBRPATH) don't touch this line

(MKBRPATH variable is created by line in Makefile.in, see above)



5- How to use "gmake"


List of usefull commands used on PALADIN/ directory :


(The original code of Makefile is on ./e-make.0.3/make)

gmake -r make

gmake -r root

gmake -r compile 1> CompileLogFileName 2>&1

The CompileLogFileName contains the log of compilations

gmake -r install

gmake -r program

(the use of some "gmake -r" commands do implicitly a gmake -r depend

A bug can appear sometime, you need to re-run it)

gmake -r depend

gmake -r depend-r

gmake -r info

gmake -r info-r : recursive info along subdirectories

gmake -r clobber : rm *.o *.ok *.$(FMODEXT)

gmake -r clobber-r : recursive clobber along subdirectories

gmake -r clean : rm *.o *.ok *.$(FMODEXT) $(LIB) (if local libraries are selected : SHARED = Y or STATLIB = Y)

gmake -r clean-r : recursive clean along subdirectories

gmake -r clean-output : clean $(MKOUT) directory (take care at the value of $(MKOUT))

gmake -r clean-depend : clean *.dep file (dependencies)

gmake -r clean-depend-r : recursive clean-depend along subdirectories

gmake -r clean-all : equivalent to clean-r clean-depend-r clean-output

hpscriptFf : convert all *.F90 files in *.f90 before a use any "gmake -r" commands

hpscriptfF : convert all *.f90 files in *.F90 (to retrieve the original package)

gmake -r 1> CompileLogFileName 2>&1: compile libraries, install and do programs

gmake -r all 1> CompileLogFileName 2>&1 : the same

The CompileLogFileName contains the log of compilations


6- How to compile Libraies and Programs


After ungziped and untared this package :

gmake -r depend-r

gmake -r 1>CompileLogFileName 2>&1 : make the three next "gmake -r" commands ( see 5.b)

you have log file of compilation in CompileLogFileName file

pointing your shared libraries directory.

gmake -r compile 1>CompileLogFileName 2>&1 : compile all fortran libraries files and

create local libraries (if you specify it)

you have log file of compilation in CompileLogFileName file

gmake -r install : create $(MKOUT) subdirectories (lib, include, mod, bin) and fill the 3 first one)

gmake -r program : make executables in $(MKOUT)/bin

You can test them with file, namelists in ./TESTFILES

(if you use hp compiler then do : ./hpscriptfF) : you replace *.F90, but take care,

do it only if you want to recreate the original package after cleaning all.

use your shell command to launch it ie :

/bin/sh ./hpscriptfF


7- Endian problems on Linux/Intel


You need to convert little endian / big endian the use of a compiler with a good option.

On web I see tested fortran compilers and it seems that 4 have only this possibility :

ABsoft, Portland Group Inc, Fujitsu, Compacq


8- Others compilers problems


so version of the routines that call ISHFTC are cloned in *.pgi.F and selected in ./src/xrd/grib_mf/Makefile.loc file.

I don't make tests with PGI 4.0-2 (Next time)

the program, for 2nd... the arguments of the program. To resolve this problem, we use the F77 library (+U77 option) with a

defintion of GETARGC (and IARGC) as EXTERNAL. These modifications are used in all my programs and are selected by a macro

in my ./src/jdglib/include/mykind.h file (compiler key HPF90I253). Since version 2.5.3 Hp corrects this bug.

.TRUE. argument is present. To correct it, see the macro ./src/jdglib/include/mykind.h file used in (call of SCAN)

./jdglib/module/STRING_LIB_MOD.F90 file.

L(1,1)=1,

L(2,1)=2,

< USE DATAS_FA, ONLY : ALIFA

> USE DATAS_FA, ONLY : ALIFA, FACAD


< ii=NINT(PSEUDO_UO(I)%ENTETE%HAUT)

< I2STR( ( ii * _ITEN_) + _ICENMIL1_,_IFIVE_) // ' '

> I2STR((NINT(PSEUDO_UO(I)%ENTETE%HAUT) * _ITEN_) + _ICENMIL1_,_IFIVE_) // ' '


< i=SIZE(PSEUDO_UI)

< ALLOCATE(PSEUDO_UI(i)%DONNEES(_IZERO_:VCAD%NLEV))

> ALLOCATE(PSEUDO_UI(SIZE(PSEUDO_UI))%DONNEES(_IZERO_:VCAD%NLEV))

I'll look for these problems next time. I don't change the source now. I remember that I added FACAD in USE statement

because one of the tested compiler ( I don't remember that) need it.


9- News, Changes






Home Home Top Top