Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • b383306/libcdi
  • mpim-sw/libcdi
  • m214007/libcdi
3 results
Show changes
Showing
with 1269 additions and 683 deletions
## Process this file with automake to produce Makefile.in
#
bin_PROGRAMS =
noinst_PROGRAMS =
check_PROGRAMS =
if ENABLE_CDI_APP
if ENABLE_CDI_LIB
bin_PROGRAMS += cdi
......@@ -11,27 +10,46 @@ noinst_PROGRAMS += cdi
endif !ENABLE_CDI_LIB
noinst_PROGRAMS += createtable
else !ENABLE_CDI_APP
if with_on_demand_check_programs
check_PROGRAMS += cdi
else !with_on_demand_check_programs
noinst_PROGRAMS += cdi
endif !with_on_demand_check_programs
endif !ENABLE_CDI_APP
#
#
cdi_SOURCES = cdi.c printinfo.c printinfo.h
cdi_LDADD = $(top_builddir)/src/libcdi.la @LIBS@
AM_CPPFLAGS = -I$(top_srcdir)/src
AM_LDFLAGS =
if ENABLE_ALL_STATIC
cdi_LDFLAGS = -all-static
AM_LDFLAGS += -all-static
endif
#
LDADD = $(top_builddir)/src/libcdi.la
cdi_SOURCES = \
cdi.c \
printinfo.c \
printinfo.h
createtable_SOURCES = createtable.c
createtable_LDADD = $(top_builddir)/src/libcdi.la
if ENABLE_ALL_STATIC
createtable_LDFLAGS = -all-static
endif
#
AM_CPPFLAGS = -I$(top_srcdir)/src
#
CLEANFILES = `ls *~`
#
clean-local: clean-local-dirs
.PHONY: clean-local-dirs
clean-local-dirs:
clean-local:
-rm -rf *.dSYM
# Compile programs using Libtool:
COMPILE = $(LTCOMPILE)
FCCOMPILE = $(LTFCCOMPILE)
PPFCCOMPILE = $(LTPPFCCOMPILE)
CXXCOMPILE = $(LTCXXCOMPILE)
# Compile *.F90 without CPPFLAGS, which are normally meant for the C compiler
# and might not be compatible with the Fortran compiler:
LTPPFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
# Avoid compiling twice by running Libtool with '-static'
# This is safe because all Libtool libraries in this directory are
# static-only and contain PIC objects:
AM_CFLAGS = -static
AM_FCFLAGS = -static
AM_CXXFLAGS = -static
......@@ -741,7 +741,6 @@ main(int argc, char *argv[])
int Record = 0;
int Variable = 0;
int Debug = 0;
/* int Quiet = 0; */
int Vardis = 0;
int Version = 0;
int Longinfo = 0;
......@@ -754,6 +753,8 @@ main(int argc, char *argv[])
int numWorkerOut = 0;
char varname[CDI_MAX_NAME];
char paramstr[32];
char *queryNames[256];
int numQueryNames = 0;
Progname = strrchr(argv[0], '/');
if (Progname == 0)
......@@ -762,7 +763,7 @@ main(int argc, char *argv[])
Progname++;
// clang-format off
while ((c = getopt(argc, argv, "b:f:i:o:t:w:z:cdhlMmnqRrsvVxXZ")) != EOF)
while ((c = getopt(argc, argv, "b:f:i:o:q:t:w:z:cdhlMmnqRrsvVxXZ")) != EOF)
{
switch (c)
{
......@@ -776,7 +777,7 @@ main(int argc, char *argv[])
case 'M': cdiDefGlobal("HAVE_MISSVAL", 1); break;
case 'm': Move = 1; break;
case 'n': Info = 0; NoInfo = 1; break;
case 'q': /* Quiet = 1; */ break;
case 'q': queryNames[numQueryNames++] = strdup(optarg); break;
case 'R': cdiDefGlobal("REGULARGRID", 1); break;
case 'r': Record = 1; break;
case 'X': Variable = 1; break;
......@@ -812,6 +813,8 @@ main(int argc, char *argv[])
exit(0);
}
// for (int i = 0; i < numQueryNames; ++i) printf("queryName[%d] = %s\n", i+1, queryNames[i]);
if (fname1)
{
SizeType nmiss;
......@@ -826,9 +829,20 @@ main(int argc, char *argv[])
int taxisID2 = CDI_UNDEFID;
int vlistID2 = CDI_UNDEFID;
const int streamID1 = streamOpenRead(fname1);
const bool useQuery = (numQueryNames > 0);
CdiQuery *query = NULL;
if (useQuery)
{
query = cdiQueryCreate();
cdiQuerySetNames(query, numQueryNames, queryNames);
// cdiQueryPrint(query);
}
const int streamID1 = useQuery ? streamOpenReadQuery(fname1, query) : streamOpenRead(fname1);
if (streamID1 < 0) return handle_error(streamID1, "Open failed on %s", fname1);
if (query) cdiQueryDelete(query);
if (numWorkerIn > 0) streamDefNumWorker(streamID1, numWorkerIn);
const int vlistID1 = streamInqVlist(streamID1);
......@@ -1040,6 +1054,8 @@ main(int argc, char *argv[])
streamClose(streamID1);
}
for (int i = 0; i < numQueryNames; ++i) free(queryNames[i]);
if (wTable) tableWrite(wTable, itableID);
return 0;
......
......@@ -130,9 +130,7 @@ print_xvals(int gridID, int dig)
fprintf(stdout, " to %.*g", dig, xlast);
if (IS_NOT_EQUAL(xinc, 0)) fprintf(stdout, " by %.*g", dig, xinc);
}
fprintf(stdout, " %s", xunits);
if (gridIsCircular(gridID)) fprintf(stdout, " circular");
fprintf(stdout, "\n");
fprintf(stdout, " %s%s\n", xunits, gridIsCircular(gridID) ? " circular" : "");
}
}
......@@ -159,8 +157,7 @@ print_yvals(int gridID, int dig)
if (IS_NOT_EQUAL(yinc, 0) && gridtype != GRID_GAUSSIAN && gridtype != GRID_GAUSSIAN_REDUCED)
fprintf(stdout, " by %.*g", dig, yinc);
}
fprintf(stdout, " %s", yunits);
fprintf(stdout, "\n");
fprintf(stdout, " %s\n", yunits);
}
}
......@@ -256,14 +253,11 @@ print_xyvals2D(int gridID, int dig)
fprintf(stdout, "%33s : %.*g", xname, dig, xfirst);
if (gridsize > 1) fprintf(stdout, " to %.*g", dig, xlast);
if (IS_NOT_EQUAL(xinc, 0)) fprintf(stdout, " by %.*g", dig, xinc);
fprintf(stdout, " %s", xunits);
if (gridIsCircular(gridID)) fprintf(stdout, " circular");
fprintf(stdout, "\n");
fprintf(stdout, " %s%s\n", xunits, gridIsCircular(gridID) ? " circular" : "");
fprintf(stdout, "%33s : %.*g", yname, dig, yfirst);
if (gridsize > 1) fprintf(stdout, " to %.*g", dig, ylast);
if (IS_NOT_EQUAL(yinc, 0)) fprintf(stdout, " by %.*g", dig, yinc);
fprintf(stdout, " %s", yunits);
fprintf(stdout, "\n");
fprintf(stdout, " %s\n", yunits);
free(xvals2D);
free(yvals2D);
......@@ -337,18 +331,15 @@ printGridInfoKernel(int gridID, int index, bool lproj)
if (gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL))
{
fprintf(stdout, "%33s :", "available");
if (gridInqXbounds(gridID, NULL) && gridInqYbounds(gridID, NULL)) fprintf(stdout, " cellbounds");
if (gridHasArea(gridID)) fprintf(stdout, " area");
if (gridInqMask(gridID, NULL)) fprintf(stdout, " mask");
fprintf(stdout, "\n");
fprintf(stdout, "%33s :%s%s%s\n", "available",
(gridInqXbounds(gridID, NULL) && gridInqYbounds(gridID, NULL) ? " cellbounds" : ""),
gridHasArea(gridID) ? " area" : "", gridInqMask(gridID, NULL) ? " mask" : "");
}
}
else if (gridtype == GRID_SPECTRAL)
{
fprintf(stdout, "points=%zu nsp=%zu T%d", gridsize, gridsize / 2, trunc);
if (gridInqComplexPacking(gridID)) fprintf(stdout, " complexPacking");
fprintf(stdout, "\n");
fprintf(stdout, "points=%zu nsp=%zu T%d%s\n", gridsize, gridsize / 2, trunc,
gridInqComplexPacking(gridID) ? " complexPacking" : "");
}
else if (gridtype == GRID_FOURIER)
{
......@@ -399,11 +390,9 @@ printGridInfoKernel(int gridID, int index, bool lproj)
{
if (gridHasArea(gridID) || gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL))
{
fprintf(stdout, "%33s :", "available");
if (gridInqXbounds(gridID, NULL) && gridInqYbounds(gridID, NULL)) fprintf(stdout, " cellbounds");
if (gridHasArea(gridID)) fprintf(stdout, " area");
if (gridInqMask(gridID, NULL)) fprintf(stdout, " mask");
fprintf(stdout, "\n");
fprintf(stdout, "%33s :%s%s%s\n", "available",
(gridInqXbounds(gridID, NULL) && gridInqYbounds(gridID, NULL)) ? " cellbounds" : "",
gridHasArea(gridID) ? " area" : "", gridInqMask(gridID, NULL) ? " mask" : "");
}
}
......@@ -436,11 +425,9 @@ printGridInfo(int vlistID)
static void
printZaxisBoundsInfo(const int zaxisID, const int dig, const int levelsize, const double zinc, const char *zunits)
{
fprintf(stdout, "%33s : ", "bounds");
double level1 = zaxisInqLbound(zaxisID, 0);
double level2 = zaxisInqUbound(zaxisID, 0);
fprintf(stdout, "%.*g-%.*g", dig, level1, dig, level2);
fprintf(stdout, "%33s : %.*g-%.*g", "bounds", dig, level1, dig, level2);
if (levelsize > 1)
{
level1 = zaxisInqLbound(zaxisID, levelsize - 1);
......@@ -448,8 +435,7 @@ printZaxisBoundsInfo(const int zaxisID, const int dig, const int levelsize, cons
fprintf(stdout, " to %.*g-%.*g", dig, level1, dig, level2);
if (IS_NOT_EQUAL(zinc, 0)) fprintf(stdout, " by %.*g", dig, zinc);
}
fprintf(stdout, " %s", zunits);
fprintf(stdout, "\n");
fprintf(stdout, " %s\n", zunits);
}
static void
......@@ -480,8 +466,7 @@ printZaxisLevelInfo(const int levelsize, const int zaxisID, const int zaxistype,
fprintf(stdout, " to %.*g", dig, zlast);
if (IS_NOT_EQUAL(zinc, 0)) fprintf(stdout, " by %.*g", dig, zinc);
}
fprintf(stdout, " %s", zunits);
fprintf(stdout, "\n");
fprintf(stdout, " %s\n", zunits);
}
free(levels);
......@@ -496,10 +481,7 @@ printZaxisHybridInfo(const int zaxisID)
const int vctsize = zaxisInqVctSize(zaxisID);
if (vctsize || psname[0])
{
fprintf(stdout, "%33s :", "available");
if (vctsize) fprintf(stdout, " vct");
if (psname[0]) fprintf(stdout, " ps: %s", psname);
fprintf(stdout, "\n");
fprintf(stdout, "%33s :%s%s%s\n", "available", vctsize ? " vct" : "", psname[0] ? " ps: " : "", psname);
}
}
......@@ -519,8 +501,7 @@ printZaxisReferenceInfo(const int zaxisID)
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_NUMBEROFVGRIDUSED, &referenceNumber);
if (referenceNumber > 0)
{
fprintf(stdout, "%33s : ", "zaxis");
fprintf(stdout, "number=%d\n", referenceNumber);
fprintf(stdout, "%33s : number=%d\n", "zaxis", referenceNumber);
}
unsigned char uuidOfVGrid[CDI_UUID_SIZE];
......@@ -532,8 +513,7 @@ printZaxisReferenceInfo(const int zaxisID)
cdiUUID2Str(uuidOfVGrid, uuidOfVGridStr);
if (uuidOfVGridStr[0] != 0 && strlen(uuidOfVGridStr) == 36)
{
fprintf(stdout, "%33s : ", "uuid");
fprintf(stdout, "%s\n", uuidOfVGridStr);
fprintf(stdout, "%33s : %s\n", "uuid", uuidOfVGridStr);
}
}
}
......@@ -570,10 +550,8 @@ printZaxisInfo(int vlistID)
fprintf(stdout, " :");
fprintf(stdout, " levels=%d", levelsize);
const bool zscalar = (levelsize == 1) ? zaxisInqScalar(zaxisID) : false;
if (zscalar) fprintf(stdout, " scalar");
fprintf(stdout, "\n");
fprintf(stdout, " levels=%d%s\n", levelsize, zscalar ? " scalar" : "");
if (zaxisInqLevels(zaxisID, NULL))
{
......@@ -600,9 +578,7 @@ printSubtypeInfo(int vlistID)
const int subtypeID = vlistSubtype(vlistID, index);
const int subtypesize = subtypeInqSize(subtypeID);
// subtypePrint(subtypeID);
fprintf(stdout, " %4d : %-24s :", vlistSubtypeIndex(vlistID, subtypeID) + 1, "tiles");
fprintf(stdout, " ntiles=%d", subtypesize);
fprintf(stdout, "\n");
fprintf(stdout, " %4d : %-24s : ntiles=%d\n", vlistSubtypeIndex(vlistID, subtypeID) + 1, "tiles", subtypesize);
}
}
......
#!/bin/sh
autoreconf -fvi || exit $?
patch --forward --no-backup-if-mismatch -p1 -r - -i patch/libtool.m4.nag_wrapper.patch
# The program 'patch' exits with exitcode=1 if the patch has already been applied.
# Consider this a normal scenario:
exitcode=$?; test $exitcode -ne 0 && test $exitcode -ne 1 && exit $exitcode
patch --forward --no-backup-if-mismatch -p1 -r - -i patch/libtool.m4.arg_spaces.patch
exitcode=$?; test $exitcode -ne 0 && test $exitcode -ne 1 && exit $exitcode
# Rebuild configure if you need to patch M4 macros:
autoconf -f || exit $?
# Reset libtool.m4 timestamps to avoid confusing make:
touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
patch --forward --no-backup-if-mismatch -p1 -r - -i patch/ltmain.sh.nag_pthread.patch
exitcode=$?; test $exitcode -ne 0 && test $exitcode -ne 1 && exit $exitcode
# All went fine since we have not exited before:
exit 0
script_dir=`echo "$0" | sed 's@[^/]*$@@'`
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
cd "$script_dir"
./scripts/reconfigure
......@@ -13,7 +13,6 @@
"LD" : "@LD@",
"NM" : "@NM@",
"AR" : "@AR@",
"AS" : "@AS@",
"DLLTOOL" : "@DLLTOOL@",
"OBJDUMP" : "@OBJDUMP@",
"STRIP" : "@STRIP@",
......@@ -29,7 +28,7 @@
"libs" : "@MPI_C_LIB@",
"cflags" : "@MPI_C_INCLUDE@",
"fclibs" : "@MPI_FC_LIB@",
"fcflags" : "@MPI_FC_INCLUDE@"
"fcflags" : "@MPI_FC_MOD@"
},
"fdb5" : {
"lib" : "@FDB5_LIBS@",
......@@ -65,8 +64,8 @@
"ieg" : "@ENABLE_IEG@",
"enable_mpi" : @ENABLE_MPI@,
"parallel_nc4" : @HAVE_PARALLEL_NC4@,
"enable_python" : @ENABLE_PYTHON@,
"enable_ruby" : @ENABLE_RUBY@
"enable_python" : @ENABLE_PYTHON_INTERFACE@,
"enable_ruby" : @ENABLE_RUBY_INTERFACE@
"across" : "@ENABLE_ACROSS@",
}
}
#! /bin/sh
#
# default configuration options and compiler flags for different hosts
#
#
CONFPATH=`echo $0 | cut -c 1-6`
if [ "$CONFPATH" != "../../" ] ; then
CONFPATH='./'
fi
#
set -x
HOSTNAME=`hostname`
#
while test $# != 0
do
case $1 in
CC=?*)
COMP=`expr "X$1" : 'X[^=]*=\(.*\)'`
;;
CONFIG_OPTS=?*)
CONFIG_OPTS=`expr "X$1" : 'X[^=]*=\(.*\)'`
;;
*)
HOSTNAME=$1
;;
esac
shift
done
#
case "${HOSTNAME}" in
# i386-apple-darwin10
icc)
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
--enable-iso-c-interface \
--enable-swig \
--enable-python \
--with-eccodes=$HOME/local/eccodes-2.6.0 \
--with-netcdf=$HOME/local/netcdf-4.4.1.1 \
--with-szlib=$HOME/local \
CC=icc CFLAGS="-g -D_REENTRANT -Wall -Wwrite-strings -O3 -march=native -fp-model source"
;;
bailung*|d133*|d134*)
${CONFPATH}configure --prefix=$HOME/local/cdi \
--enable-maintainer-mode \
--enable-iso-c-interface \
--enable-swig \
--with-eccodes=/opt/local \
--with-netcdf=/opt/local \
--with-szlib=/opt/local/lib/libaec \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3"
;;
cinglung*|feilung*|wanglung*)
${CONFPATH}configure --prefix=$HOME/local \
--enable-shared \
--enable-maintainer-mode \
--enable-swig \
--enable-python \
--with-grib_api=/opt/local \
--with-netcdf=/opt/local \
--with-szlib=/opt/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2"
;;
hama*)
CDILIBS="--disable-iso-c-interface \
--enable-maintainer-mode \
--with-szlib=$HOME/local \
--with-fdb5=$HOME/src/fdb \
--with-eccodes=$HOME/local/eccodes-2.22.0 \
--with-netcdf=$HOME/local/netcdf-c-4.9.0"
PREFIX="--prefix=$HOME/local/cdi"
LD_ADD="-Wl,-rpath,$HOME/local/eccodes-2.22.0/lib -Wl,-rpath,$HOME/src/fdb/lib"
if test "$COMP" = clang ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
CC=clang CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3"
else
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3"
fi;
;;
# x86_64-squeeze-x64-linux
thunder*)
${CONFPATH}configure --with-grib_api=/sw/squeeze-x64/grib_api-1.13.0-static-gccsys \
--with-netcdf=/sw/squeeze-x64/netcdf-4.2-static \
--disable-cf-interface \
CC=gcc CFLAGS="-g -Wall -O3"
;;
# ia64-nec-linux
ds*)
${CONFPATH}configure --prefix=$HOME/local \
--with-netcdf=/pool/ia64/netcdf/netcdf-3.6.0-p1 \
--with-szlib=$HOME/local \
CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304"
;;
# i686-linux
melian)
${CONFPATH}configure --prefix=`pwd`/build \
--with-netcdf \
--with-szlib \
--with-eccodes \
--with-pic --enable-swig --enable-ruby --enable-python \
CC=gcc CFLAGS="-g -O2 -Wall" LIBS=-lopenjpeg
;;
# sx6-nec-superux12.2
cs*)
${CONFPATH}configure --prefix=$HOME/local \
--with-netcdf=/pool/netcdf/netcdf-3.6.0-p1 \
CC=c++ \
CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
;;
sx6)
${CONFPATH}configure --host=sx6 --prefix=$HOME/local \
--with-netcdf=/pool/SX-6/netcdf/netcdf-3.6.0-p1 \
CC=sxc++ AR=sxar RANLIB=ls \
CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
;;
lxe0*)
echo 'Please choose compiler modules! Checkout with "module av"!'
${CONFPATH}configure --prefix=$(pwd)/build-SX --host=sx9-nec-superux \
--with-netcdf=/usr/local/pkg-sx9 \
--with-grib_api=/usr/local/pkg-sx9/grib_api CC=sxc++ FC=sxf90 \
LD=/SX/opt/crosskit/inst/bin/sxld AR=/SX/opt/crosskit/inst/bin/sxar \
RANLIB=echo
;;
# powerpc-ibm-aix6.1.0.0
blizzard*)
CONFIG_SHELL=/bin/bash /bin/bash \
${CONFPATH}configure --prefix=$HOME/local \
--with-netcdf=/sw/aix61/netcdf-4.2 \
--with-szlib=/sw/aix61/szip-2.1-threadsafe \
AR="ar -X 64" LDFLAGS="-brtl" FC=xlf2003_r CC=xlc_r \
CFLAGS="-g -O3 -qhot -q64 -qarch=auto -qtune=auto -qlistfmt=html=transforms -DHAVE_MMAP" \
FCFLAGS="-qsuffix=cpp=f90 -qextname" \
SHELL=/bin/bash
;;
breeze*)
CDILIBS="--with-eccodes=/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys \
--with-netcdf=/sw/jessie-x64/netcdf-4.3.3.1-gccsys"
PREFIX="--prefix=$(pwd)/build/${COMP}"
LD_ADD="-Wl,-rpath,/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys/lib"
if test "$COMP" = intel ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
CC=icc FC=ifort CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = gnu ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
CC=gcc FC=gfortran F77=gfortran CFLAGS="-g -Wall -O2 -march=native"
elif test "$COMP" = pgi ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
CC=pgcc FC=pgf90 F77=pgf90 CFLAGS="-g"
elif test "$COMP" = clang ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
CC=clang FC=gfortran CFLAGS="-g -O2"
elif test "$COMP" = nag ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
CC=gcc FC=nagfor F77=nagfor CFLAGS="-g -O2"
elif test "$COMP" = nagClang ; then
${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS \
CC=clang FC=nagfor F77=nagfor CFLAGS="-g -Wall -02"
else
echo "no config found for host: $HOSTNAME, COMP: $COMP !!"
fi;
;;
mlogin*)
CDILIBS="--with-eccodes=/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48 \
--with-netcdf=/sw/rhel6-x64/netcdf/netcdf_c-4.3.2-gcc48"
PREFIX="--prefix=$(pwd)/build/${COMP}"
if test "$COMP" = intel ; then
${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
F77=ifort FC=ifort FFLAGS="-g -O2" \
CC=icc CFLAGS="-g -Wall -O2 -qopt-report=5 -march=core-avx2"
elif test "$COMP" = pgi ; then
${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
CXX=pgc++ CXXFLAGS="-g -fast" \
CC=pgcc CFLAGS="-g -fast"
elif test "$COMP" = gnu_pic ; then
${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
FC=gfortran F77=gfortran FFLAGS="-g -O2" \
CC=gcc CFLAGS='-g -Wall -O3 -march=native -mavx2 -fPIC'
else
${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
FC=gfortran F77=gfortran FFLAGS="-g -O2" \
CC=gcc CFLAGS='-g -Wall -O3 -march=native -mavx2'
fi
;;
*)
echo "configuration for hostname $HOSTNAME not found!"
;;
esac
......@@ -2,6 +2,8 @@ require 'mkmf'
require 'rbconfig'
if RUBY_VERSION[0,3] == '1.8'
puts "-I#{Config::expand(CONFIG['archdir'])}"
elsif RbConfig::CONFIG['MAJOR'].to_i >= 2
puts "-I#{RbConfig::CONFIG['rubyhdrdir']} -I#{RbConfig::CONFIG['rubyarchhdrdir']}"
else
puts "-I#{RbConfig::CONFIG['rubyhdrdir']} -I#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']}"
end
This diff is collapsed.
This patch is needed so that -Wl,-rpath option arguments make it into
the dependent libraries of a library and also ensures that -Wl,-Wl,,
options are passed to the compiler unaltered.
It is intended for libtool 2.4.2 and can be applied after
e.g. autoreconf by
$ patch -p1 <contrib/nagfor-libtool-patch/nagfor-libtool.patch
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_stripname "$wl" '' "$arg"
+ func_append new_inherited_linker_flags " -Wl,$func_stripname_result"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ func_quote_for_eval "$1"
+ func_append libtool_args " $func_quote_for_eval_result"
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -9515,6 +9562,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
@@ -10247,6 +10298,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3217,6 +3217,25 @@
}
# end func_convert_path_msys_to_cygwin
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_convert_path_nix_to_cygwin ARG
# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
@@ -7147,20 +7166,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -7221,6 +7227,49 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_stripname "$wl" '' "$arg"
+ func_append new_inherited_linker_flags " -Wl,$func_stripname_result"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ func_quote_for_eval "$1"
+ func_append libtool_args " $func_quote_for_eval_result"
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
@@ -9515,6 +9562,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
@@ -10247,6 +10298,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_append new_inherited_linker_flags " $arg"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
This patch changes ltmain.sh to add directories found in -R options of
dependent libraries to the final link command, such that non-libtool
dynamic libraries (which are a shared object inside the .a file on AIX) are
handled appropriately.
patching file /tmp/tmp.fUvdRDtWV1
--- /tmp/tmp.fUvdRDtWV1 2012-11-16 13:56:40.799501409 +0100
+++ b/config/ltmain.sh 2012-11-16 13:27:39.657253614 +0100
@@ -7171,7 +7171,10 @@
# practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
+ -R*)
+ func_stripname '-R' '' "$deplib"
+ func_add2xrpath "$func_stripname_result"
+ ;;
*)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
This patch changes NAG Fortran (nagfor) compilations of shared
libraries to correctly pass the -shared flag to the underlying
compiler.
--- a/m4/libtool.m4 2013-08-01 11:23:32.749610298 +0200
+++ b/m4/libtool.m4 2014-04-04 15:30:02.855209645 +0200
@@ -4817,6 +4817,8 @@
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
This patch changes ltmain.sh to keep the GNU ld library grouping options
-- -(, --start-group, -), and --end-group -- in the list of dependency
libraries so that the desired behaviour is retained (i.e. libraries with
cyclic dependencies can be linked).
--- a/config/ltmain.sh 2016-10-27 18:58:49.860787638 +0200
+++ b/config/ltmain.sh 2016-10-27 18:59:21.497411984 +0200
@@ -5806,6 +5806,11 @@
arg=$func_stripname_result
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ func_append deplibs " $arg"
+ continue
+ ;;
+
-Wl,*)
wlprefix=`expr x"$wl" : '.*' - 1`
wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
@@ -6434,6 +6439,15 @@
alldeplibs=yes
continue
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
esac # case $deplib
if test "$found" = yes || test -f "$lib"; then :
--- a/config/ltmain.sh 2016-10-27 18:24:46.464521224 +0200
+++ b/config/ltmain.sh 2016-10-27 18:25:41.837607694 +0200
@@ -7226,6 +7226,11 @@
arg=$func_stripname_result
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ func_append deplibs " $arg"
+ continue
+ ;;
+
-Wl,*)
wlprefix=`expr x"$wl" : '.*' - 1`
wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
@@ -7879,6 +7884,15 @@
alldeplibs=:
continue
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
esac # case $deplib
$found || test -f "$lib" \
This patch allows having -Xlinker and -XCClinker command line options in
libtool --mode=compile invocations.
This is crucial because linker flags are different for nagfor and gcc.