From 390cbd406534320e198393c543dd7b18b3e0968a Mon Sep 17 00:00:00 2001 From: James Laird Date: Thu, 28 Apr 2005 16:49:38 -0500 Subject: [svn-r10692] Purpose: Cray X1 port Description: Added configuration files (config/nv1-cray) and made some minor changes so that the 1.6 branch will build and pass tests on Cray X1 machines. Solution: hl/test/test_table will never compile if compiler optimizations are turned on. Optimization in test_table.c is thus disabled when __crayx1 is defined. Platforms tested: Cray X1s, eirene, sleipnir --- config/nv1-cray | 137 ++++++++++++++++++++++++++++++++++++++ fortran/acsite.m4 | 2 +- fortran/config/nv1-cray | 174 ++++++++++++++++++++++++++++++++++++++++++++++++ fortran/configure | 2 +- fortran/src/H5Pf.c | 1 + fortran/src/H5f90i.h | 16 ++++- hl/test/test_table.c | 7 +- 7 files changed, 335 insertions(+), 4 deletions(-) create mode 100644 config/nv1-cray create mode 100644 fortran/config/nv1-cray diff --git a/config/nv1-cray b/config/nv1-cray new file mode 100644 index 0000000..a3af268 --- /dev/null +++ b/config/nv1-cray @@ -0,0 +1,137 @@ +# -*- shell-script -*- +# +# This file is part of the HDF5 build script. It is processed shortly +# after configure starts and defines, among other things, flags for +# the various compile modes. + + +#---------------------------------------------------------------------------- +# Compiler flags. The CPPFLAGS values should not include package debug +# flags like `-DH5G_DEBUG' since these are added with the +# `--enable-debug' switch of configure. +#---------------------------------------------------------------------------- + + +# Choosing a C Compiler +# --------------------- +# +# The user should be able to specify the compiler by setting the CC +# environment variable to the name of the compiler and any switches it +# requires for proper operation. If CC is unset then this script may +# set it. If CC is unset by time this script completes then configure +# will try `gcc' and `cc' in that order (perhaps some others too). +# +# Note: Code later in this file may depend on the value of $CC_BASENAME +# in order to distinguish between different compilers when +# deciding which compiler command-line switches to use. This +# variable is set based on the incoming value of $CC and is only +# used within this file. + +if test "X-" = "X-$CC"; then + CC=cc + CC_BASENAME=cc +fi +# no need to use RANLIB +RANLIB=: + + +# C Compiler and Preprocessor Flags +# --------------------------------- +# +# Flags that end with `_CFLAGS' are always passed to the compiler. +# Flags that end with `_CPPFLAGS' are passed to the compiler when +# compiling but not when linking. +# +# DEBUG_CFLAGS Flags to pass to the compiler to create a +# DEBUG_CPPFLAGS library suitable for use with debugging +# tools. Usually this list will exclude +# optimization switches (like `-O') and include +# switches that turn on symbolic debugging +# support (like `-g'). +# +# PROD_CFLAGS Flags to pass to the compiler to create a +# PROFILE_CPPFLAGS library suitable for performance testing (like +# `-pg'). This may or may not include debugging +# or production flags. +# +# CFLAGS Flags can be added to this variable which +# might already be partially initialized. These +# flags will always be passed to the compiler +# and should include switches to turn on full +# warnings. HDF5 attempts to be ANSI and Posix +# compliant and employ good programming +# practices resulting in few if any +# warnings. +# +# Warning flags do not have to be added to CFLAGS +# variable if the compiler is the GNU gcc +# compiler or a descendent of gcc such as EGCS or PGCC. +# +# The CFLAGS should contains *something* or else +# configure will probably add `-g'. For most +# systems this isn't a problem but some systems +# will disable optimizations in favor of the +# `-g'. +# +# +# These flags should be set according to the compiler being used. +# There are two ways to check the compiler. You can try using `-v' or +# `--version' to see if the compiler will print a version string. You +# can use the value of $CC_BASENAME which is the base name of the +# first word in $CC (note that the value of CC may have changed +# above). + +case $CC_BASENAME in + gcc) + CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions + DEBUG_CFLAGS="-g -fverbose-asm" + DEBUG_CPPFLAGS= + PROD_CFLAGS="-O3 -fomit-frame-pointer" + PROD_CPPFLAGS= + PROFILE_CFLAGS="-pg" + PROFILE_CPPFLAGS= + ;; + + cc) + CFLAGS="$CFLAGS -O0" + DEBUG_CFLAGS="-g" + DEBUG_CPPFLAGS= + PROD_CFLAGS="" + PROD_CPPFLAGS= + PROFILE_CFLAGS= + PROFILE_CPPFLAGS= + ;; + + *) + CFLAGS="$CFLAGS -ansi -O0" + DEBUG_CFLAGS="-g" + DEBUG_CPPFLAGS= + PROD_CFLAGS="" + PROD_CPPFLAGS= + PROFILE_CFLAGS="-pg" + PROFILE_CPPFLAGS= + ;; +esac + + + +# Overriding Configure Tests +# -------------------------- +# +# Values for overriding configuration tests when cross compiling. +# This includes compiling on some machines where the serial front end +# compiles for a parallel back end. + +# Set this to `yes' or `no' depending on whether the target is big +# endian or little endian. +#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} + +# Set this to the width required by printf() to print type `long +# long'. For instance, if the format would be `%lld' then set it to +# `ll' or if the format would be `%qd' set it to `q'. +#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} + +# Hard set the flag to indicate that converting denormalized floating-point +# values doesn't work. +hdf5_cv_convert_denormal_float=${hdf5_cv_convert_denormal_float='no'} + diff --git a/fortran/acsite.m4 b/fortran/acsite.m4 index 9dbff52..9c5b0819 100644 --- a/fortran/acsite.m4 +++ b/fortran/acsite.m4 @@ -24,7 +24,7 @@ dnl dnl Check for a Fortran 9X compiler. dnl AC_DEFUN(AC_PROG_F9X, -[AC_CHECK_PROGS(F9X, f90 pgf90 xlf90 f95 g95 xlf95) +[AC_CHECK_PROGS(F9X, f90 pgf90 xlf90 f95 g95 xlf95 ftn) test -z "$F9X" && AC_MSG_ERROR([no acceptable f9X compiler found in \$PATH]) AC_PROG_F9X_WORKS diff --git a/fortran/config/nv1-cray b/fortran/config/nv1-cray new file mode 100644 index 0000000..b7389a0 --- /dev/null +++ b/fortran/config/nv1-cray @@ -0,0 +1,174 @@ +# -*- shell-script -*- +# +# This file is part of the HDF5 build script. It is processed shortly +# after configure starts and defines, among other things, flags for +# the various compile modes. + + +#---------------------------------------------------------------------------- +# Compiler flags. The CPPFLAGS values should not include package debug +# flags like `-DH5G_DEBUG' since these are added with the +# `--enable-debug' switch of configure. +#---------------------------------------------------------------------------- + + +# Choosing a C Compiler +# --------------------- +# +# The user should be able to specify the compiler by setting the CC +# environment variable to the name of the compiler and any switches it +# requires for proper operation. If CC is unset then this script may +# set it. If CC is unset by time this script completes then configure +# will try `gcc' and `cc' in that order (perhaps some others too). +# +# Note: Code later in this file may depend on the value of $CC_BASENAME +# in order to distinguish between different compilers when +# deciding which compiler command-line switches to use. This +# variable is set based on the incoming value of $CC and is only +# used within this file. + +if test "X-" = "X-$CC"; then + CC=cc + CC_BASENAME=cc +fi +# no need to use RANLIB +RANLIB=: + + +# C Compiler and Preprocessor Flags +# --------------------------------- +# +# Flags that end with `_CFLAGS' are always passed to the compiler. +# Flags that end with `_CPPFLAGS' are passed to the compiler when +# compiling but not when linking. +# +# DEBUG_CFLAGS Flags to pass to the compiler to create a +# DEBUG_CPPFLAGS library suitable for use with debugging +# tools. Usually this list will exclude +# optimization switches (like `-O') and include +# switches that turn on symbolic debugging +# support (like `-g'). +# +# PROD_CFLAGS Flags to pass to the compiler to create a +# PROD_CPPFLAGS production version of the library. These +# usualy exclude symbolic debugging switches +# (like `-g') and include optimization switches +# (like `-O'). +# +# PROFILE_CFLAGS Flags to pass to the compiler to create a +# PROFILE_CPPFLAGS library suitable for performance testing (like +# `-pg'). This may or may not include debugging +# or production flags. +# +# CFLAGS Flags can be added to this variable which +# might already be partially initialized. These +# flags will always be passed to the compiler +# and should include switches to turn on full +# warnings. HDF5 attempts to be ANSI and Posix +# compliant and employ good programming +# practices resulting in few if any +# warnings. +# +# Warning flags do not have to be added to CFLAGS +# variable if the compiler is the GNU gcc +# compiler or a descendent of gcc such as EGCS or PGCC. +# +# The CFLAGS should contains *something* or else +# configure will probably add `-g'. For most +# systems this isn't a problem but some systems +# will disable optimizations in favor of the +# `-g'. +# +# +# These flags should be set according to the compiler being used. +# There are two ways to check the compiler. You can try using `-v' or +# `--version' to see if the compiler will print a version string. You +# can use the value of $CC_BASENAME which is the base name of the +# first word in $CC (note that the value of CC may have changed +# above). + +case $CC_BASENAME in + gcc) + CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions + DEBUG_CFLAGS="-g -fverbose-asm" + DEBUG_CPPFLAGS= + PROD_CFLAGS="-O3 -fomit-frame-pointer" + PROD_CPPFLAGS= + PROFILE_CFLAGS="-pg" + PROFILE_CPPFLAGS= + ;; + + cc) + CFLAGS="$CFLAGS" + DEBUG_CFLAGS="-g" + DEBUG_CPPFLAGS= + PROD_CFLAGS="" + PROD_CPPFLAGS= + PROFILE_CFLAGS= + PROFILE_CPPFLAGS= + ;; + + *) + CFLAGS="$CFLAGS -ansi" + DEBUG_CFLAGS="-g" + DEBUG_CPPFLAGS= + PROD_CFLAGS="-O" + PROD_CPPFLAGS= + PROFILE_CFLAGS="-pg" + PROFILE_CPPFLAGS= + ;; +esac + + + +# Overriding Configure Tests +# -------------------------- +# +# Values for overriding configuration tests when cross compiling. +# This includes compiling on some machines where the serial front end +# compiles for a parallel back end. + +# Set this to `yes' or `no' depending on whether the target is big +# endian or little endian. +#ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'} + +# Set this to the width required by printf() to print type `long +# long'. For instance, if the format would be `%lld' then set it to +# `ll' or if the format would be `%qd' set it to `q'. +#hdf5_cv_printf_ll=${hdf5_cv_printf_ll='ll'} + +# The default Fortran 90 compiler + +# +# HDF5 integers +# +# R_LARGE is the number of digits for the bigest integer supported. +# R_INTEGER is the number of digits in INTEGER +# +# (for the UNICOS architechture) +# +R_LARGE=18 +R_INTEGER=9 +HADDR_T='SELECTED_INT_KIND(R_LARGE)' +HSIZE_T='SELECTED_INT_KIND(R_LARGE)' +HSSIZE_T='SELECTED_INT_KIND(R_LARGE)' +HID_T='SELECTED_INT_KIND(R_INTEGER)' +SIZE_T='SELECTED_INT_KIND(R_LARGE)' +OBJECT_NAMELEN_DEFAULT_F=-1 + +if test "X-" = "X-$F9X"; then + F9X=ftn +fi + +if test "X-" = "X-$f9x_flags_set"; then + # -Wl passes flags to the linker and -M# will ignore warnings with + # number #. Warning 405 and 412 were stopping the executable from being built. + F9XSUFFIXFLAG="" + FSEARCH_DIRS="" + FFLAGS="$FFLAGS" + DEBUG_FFLAGS="-g" + PROD_FFLAGS="" + PROFILE_FFLAGS="" + f9x_flags_set=yes +fi + diff --git a/fortran/configure b/fortran/configure index 2665a0b..703c77d 100755 --- a/fortran/configure +++ b/fortran/configure @@ -8113,7 +8113,7 @@ echo "${ECHO_T}disabled" >&6 ;; esac -for ac_prog in f90 pgf90 xlf90 f95 g95 xlf95 +for ac_prog in f90 pgf90 xlf90 f95 g95 xlf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index cb3f870..a20511c 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2995,6 +2995,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f */ c_prp_id = (hid_t)*prp_id; +#pragma _CRI novector for (i=0; i < H5FD_MEM_NTYPES; i++) { c_memb_map[i] = (H5FD_mem_t)memb_map[i]; /*printf("map %d \n", c_memb_map[i]); */ diff --git a/fortran/src/H5f90i.h b/fortran/src/H5f90i.h index 3002963..a6cb26b 100644 --- a/fortran/src/H5f90i.h +++ b/fortran/src/H5f90i.h @@ -22,7 +22,7 @@ #include "H5private.h" -#if (defined (UNICOS) || (defined (_UNICOS))) +#if (defined (UNICOS) || defined (_UNICOS)) && !defined(__crayx1) #include @@ -128,6 +128,20 @@ typedef float real_f; #define _fcdtocp(desc) (desc) #endif /* IRIX */ +#if defined(__crayx1) + +typedef char *_fcd; +typedef long haddr_t_f; +typedef long hsize_t_f; +typedef long hssize_t_f; +typedef long size_t_f; +typedef int int_f; +typedef int hid_t_f; +typedef float real_f; +#define FNAME_POST_UNDERSCORE +#define _fcdtocp(desc) (desc) +#endif /* Cray X1 */ + #if (defined(SUN) || defined(sun) || defined(__sun__) || defined(__SUNPRO_C)) & !defined(__i386) typedef char *_fcd; diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 57b3791..9b0de4d 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -22,6 +22,12 @@ #define TEST_FILE_LE "test_table_le.hdf5" #define TEST_FILE_CRAY "test_table_cray.hdf5" +/* Compiler optimization on Cray X1s can cause this file not to compile. + * Turn it off. + */ +#ifdef __crayx1 +#pragma OPTIMIZE OFF +#endif /*------------------------------------------------------------------------- * Table API test @@ -1594,4 +1600,3 @@ static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, return 0; } - -- cgit v0.12