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 ortable uxillary ibrary nd evelopment tools for alad.
The use of this package is to create a portable :
xrd library (minimal package of routine to use only the LFI,FA,FFT parts)
jdglib library (my library to use my programs)
eggx library (with the old eggx and the new eggx)
biper library (some routines of biperidisation : not fully tested)
pack of my programs (PSEUDO,FRODO,EDF,ECTO,DOMOLOLA)
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
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 |
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) |
Nota Bene: the -DLX86P key for "Linux Lahey/Fujitsu" is necessary for all files excepted ./src/xrd/grib_mf/Makefile.loc.
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.
Remember that on Lahey/Fujitsu compiler you must use: export FORT90L="-Wl, -T" before execution. It's the
way to do Little Endian conversion.
4- Description of files needed and used by "gmake"
a) create a ./e-make.0.3/arch/Makefile.in.OSMFC or use or modify one of existing
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 |
b) go on PALADIN directory and open Makefile.in that contains variables you can modify :
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 |
c) Makefile.loc description:
In ./ directory and subdirectories, the Makefile.loc files contains : SUBDIRS where the "gmake" must go
./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 |
In ./src/ subdirectories, the Makefile.loc files contains : SRC_NOTUSED (deselects some sources file)
./xrd/grib_mf/Makefile.loc : use of *.pgi.F version for Portland Group, Inc compiler
(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 |
./xrd/support/Makefile.loc : use of *.vpp.F version for VPP
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 |
In ./src/ subdirectories, the Makefile.loc files contains : definitions of libraries local name
(extension '.a' is added by "gmake") with LIB variable
./src/divers/biper/Makefile.loc
LIB = $(CURDIR)/libbiper_$(ARCH) |
./src/dummy/Makefile.loc
LIB = $(CURDIR)/libdummy_$(ARCH) |
./src/eggx/new_eggx/Makefile.loc
LIB = $(CURDIR)/libneweggx_$(ARCH) |
./src/eggx/old_eggx/Makefile.loc
LIB = $(CURDIR)/liboldeggx_$(ARCH) |
./src/jdglib/Makefile.loc
LIB = $(CURDIR)/libjdg_$(ARCH) |
./src/xrd/Makefile.loc
LIB = $(CURDIR)/libxrd_$(ARCH) |
In ./src/jdgprg/ subdirectories, the Makefile.loc files contains : definitions of executables making with use of
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)
./src/jdgprg/edf/Makefile.loc
EXE = edf SRCP = editfield.o LIBS = jdg xrd dummy neweggx oldeggx |
./src/jdgprg/ecto/Makefile.loc
EXE = ecto SRCP = ectoplasme.o LIBS = jdg xrd dummy neweggx oldeggx |
./src/jdgprg/frodo/Makefile.loc
EXE = frodo SRPC = frodo.o LIBS = jdg xrd dummy neweggx oldeggx |
./src/jdgprg/pseudo/Makefile.loc
EXE = pseudo SRCP = pseudo.o LIBS = jdg xrd dummy neweggx oldeggx |
./src/jdgprg/domolalo/Makefile.loc
EXE = domolalo SRCP = domolalo.o LIBS = jdg xrd dummy neweggx oldeggx |
d) Makefile.root description:
All Makefile.root files contain paths for dependencies search :
VPATH = $(MKBRPATH) don't touch this line
(MKBRPATH variable is created by line in Makefile.in, see above)
List of usefull commands used on PALADIN/ directory :
Copy of Makefile program in all subdir (if I send you a new version) :
(The original code of Makefile is on ./e-make.0.3/make)
gmake -r make
Copy of Makefile.root from PALADIN/ directory to subdirectories (generaly not used) :
gmake -r root
Compile libraries (after updating ./Makefile.in and ./e-make.0.3/arch/Makefile.in.OSMFC, see 4.a and 4.b) :
gmake -r compile 1> CompileLogFileName 2>&1
The CompileLogFileName contains the log of compilations
Install usefull files in ./$(MKOUT)/lib,./$(MKOUT)/mod,./$(MKOUT)/include, directories :
gmake -r install
Make program files in ./$(MKOUT)/bin :
gmake -r program
Make dependencies files (local or recursive) :
(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
Info on variables :
gmake -r info
gmake -r info-r : recursive info along subdirectories
Clean commands :
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
HP compiler doesn't compile *.F90 sources files, so you must used :
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)
All :
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 :
go under PALADIN directory
modify the Makefile.in with your shell and ARCH value
modify or create the ./e-make.0.3/arch/Makefile.in.$(ARCH) file
do : export MKPACK=/(absolute-path-to)/PALADIN
a) Classic use :
(if you use hp compiler do : ./hpscriptFf) : use your shell command to launch it, ie : (/bin/sh ./hpscriptFf)
WARNING : On some mainframes if you have problem ("entering in an unknown directory") then try to do :
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
WARNING : if you use shared libraries then don't forget to add LD_LIBRARY_PATH in your .profile (or others)
pointing your shared libraries directory.
b) Equivalent use :
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
Nota Bene :
(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
With this version of PGI compiler the intrinsec subroutine ISHFTC is bugged : the optional argument SIZE must be specified,
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)
With this version of HP compiler the GETARGC function is bugged : it returns for argument 0 a blank line, for 1st the name of
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.
With this version of SUN compiler the SCAN intrinsec function is bugged : it returns -xxxx and not 0 with no occurence when
.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.
Neva Pristov had some problems :
with ecto namelist format and Compacq compiler : L(:,1)=1,2,.. don't work, she must split as
L(1,1)=1,
L(2,1)=2,
with pseudo.F90 code with Lahey/Fujitsu compiler : ( > : original file, < : modified file )
< 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.
View Update.html