freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Use autoconf for basic configuration stuff


From: Richard Guenther
Subject: [PATCH] Use autoconf for basic configuration stuff
Date: Wed, 8 Jan 2003 11:49:33 +0100 (CET)

Hi!

I extracted and cleaned up the autoconfiscation of the compiler/library
features. This allows the addition of a "default" architecture (done)
suited to a gnu toolchain and then run pooma configuration by just

> ./configure --serial --opt

or even

> ./configure --serial --opt --cpp icpc

and succeed. Adding external packages to the build (like cheetah using
--messaging) works by setting the appropriate environment variable as
checked by the old-style configure script (here $CHEETAHDIR).

This is the least intrusive way of introducing autoconf to handle some of
the configuration mess. I probably dont have time to autoconfiscate the
whole build, so all old makefiles stay, so does the backward compatible
installation and external packages support (which is probably a good idea
anyway -- no changes needed to application makefiles).

Tested by running the above quoted configurations and building the
library. Tested by using this sort of configuration for my own work for a
few month now, too.

Ok to apply?

Richard.

# This is a BitKeeper generated patch for the following project:
# Project Name: pooma/cheetah repository tracking CVS/tarball
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.11    -> 1.17
#       r2/src/IO/tests/DiskLayoutTest1.cpp     1.1     -> 1.2
#       r2/src/IO/tests/FileSetReaderTest0.cpp  1.1     -> 1.2
#       r2/src/Tiny/Vector.h    1.1     -> 1.2
#               r2/configure    1.2     -> 1.6
#       r2/src/IO/FileSetReader.cpp     1.1     -> 1.2
#       r2/src/Field/FieldCentering.h   1.1     -> 1.2
#         r2/bin/makeinstall    1.1     -> 1.2
#       r2/src/IO/tests/dumper.cpp      1.1     -> 1.2
#       r2/src/IO/DiskLayout.h  1.1     -> 1.2
#       r2/src/IO/DiskLayout.cmpl.cpp   1.1     -> 1.2
#       r2/src/IO/FileSetReader.cmpl.cpp        1.1     -> 1.2
#       r2/src/Utilities/Inform.h       1.1     -> 1.2
#       r2/src/Tiny/TinyMatrix.h        1.1     -> 1.2
#                      (new)            -> 1.1     r2/config/arch/default.conf
#                      (new)            -> 1.3     r2/scripts/configure.in
#                      (new)            -> 1.2     r2/scripts/acconfig.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/01/08      address@hidden  1.12
# autoconf configure script introduction for detecting compiler/library features
# --------------------------------------------
# 03/01/08      address@hidden  1.13
# handle compilers not supporting template function default template arguments 
(like gcc 2.95)
# --------------------------------------------
# 03/01/08      address@hidden  1.14
# Add missing <string> include
# --------------------------------------------
# 03/01/08      address@hidden  1.15
# Inform.h:
#   use POOMA_NO_IOSBASE_FMTFLAGS
# acconfig.h:
#   POOMA_NO_IOSBASE_FMTFLAGS
# configure.in:
#   add check for ios_base::fmtflags type
# --------------------------------------------
# 03/01/08      address@hidden  1.16
# make autoconf configuration parallel suite safe
# --------------------------------------------
# 03/01/08      address@hidden  1.17
# Added default configuration suited to gnu toolchain.
# --------------------------------------------
#
diff -Nru a/r2/bin/makeinstall b/r2/bin/makeinstall
--- a/r2/bin/makeinstall        Wed Jan  8 11:42:22 2003
+++ b/r2/bin/makeinstall        Wed Jan  8 11:42:22 2003
@@ -141,12 +141,14 @@
 makefilename=Makefile.$libbase$extensions
 hdrdirname=PoomaConfiguration$extensions
 configfilename=PoomaConfiguration.h
+autoconfigfilename=PoomaAutoconf.h

 rm -rf $libdir/$makefilename $libdir/$libfilename $libdir/$hdrdirname
 cp lib/$suite/$makefilename $libdir/$makefilename
 cp lib/$suite/$libfilename $libdir/$libfilename
 mkdir $libdir/$hdrdirname
 cp lib/$suite/$configfilename $libdir/$hdrdirname/$configfilename
+cp lib/$suite/$autoconfigfilename $libdir/$hdrdirname/$autoconfigfilename


 ### Copy binary files to bin directory
diff -Nru a/r2/config/arch/default.conf b/r2/config/arch/default.conf
--- /dev/null   Wed Dec 31 16:00:00 1969
+++ b/r2/config/arch/default.conf       Wed Jan  8 11:42:22 2003
@@ -0,0 +1,283 @@
+# Perl input file
+# ACL:license
+#  ----------------------------------------------------------------------
+#  This software and ancillary information (herein called "SOFTWARE")
+#  called POOMA (Parallel Object-Oriented Methods and Applications) is
+#  made available under the terms described here.  The SOFTWARE has been
+#  approved for release with associated LA-CC Number LA-CC-98-65.
+#
+#  Unless otherwise indicated, this SOFTWARE has been authored by an
+#  employee or employees of the University of California, operator of the
+#  Los Alamos National Laboratory under Contract No.  W-7405-ENG-36 with
+#  the U.S. Department of Energy.  The U.S. Government has rights to use,
+#  reproduce, and distribute this SOFTWARE. The public may copy, distribute,
+#  prepare derivative works and publicly display this SOFTWARE without
+#  charge, provided that this Notice and any statement of authorship are
+#  reproduced on all copies.  Neither the Government nor the University
+#  makes any warranty, express or implied, or assumes any liability or
+#  responsibility for the use of this SOFTWARE.
+#
+#  If SOFTWARE is modified to produce derivative works, such modified
+#  SOFTWARE should be clearly marked, so as not to confuse it with the
+#  version available from LANL.
+#
+#  For more information about POOMA, send e-mail to address@hidden,
+#  or visit the POOMA web page at http://www.acl.lanl.gov/pooma/.
+#  ----------------------------------------------------------------------
+# ACL:license
+
+###########################################################################
+# POOMA configuration settings
+#
+# Platform: default, gnu toolchain
+# Compiler: gcc
+#
+###########################################################################
+#
+# This file contains specialized settings indicating how to build POOMA
+# with this platform and compiler.  This is a perl script executed by
+# the 'configure' script at the top level of the POOMA directory structure.
+# This file has two sections:
+#   1) The locations of include files and libraries for external packages.
+#   3) The specialized settings on how to use this platform and compiler.
+# You should edit the lines in section 1) to the proper location of the
+# external packages.  Do not edit the lines in section 2) unless you
+# know what you're doing.
+#
+###########################################################################
+
+###########################################################################
+# Section 0: architecture type
+###########################################################################
+
+$archtype = "gnu";
+
+###########################################################################
+# Section 1: external package locations.
+#   Include search directories should have a '-I' prepended.
+#   Library search directories should have a '-L' prepended.
+#   Library filenames should just list the name or use -l prefix as needed.
+#   Required defines should have -a '-D' prepended.
+###########################################################################
+
+### location of SMARTS files for threads
+
+$threads_able             = 1;
+$threads_default_dir      = "/home/smarts/build/smarts-current";
+$threads_lib_subdir       = "$archtype/lib";
+$threads_basic_makefile   = "Makefile.smarts-g++";
+$threads_profile_makefile = "Makefile.smarts-tau-g++";
+
+
+### location of TAU files for profiling
+
+$profile_able              = 1;
+$profile_default_dir       = "/home/tau/build/tau-current";
+$ductape_default_dir       = "/usr/local/pooma/packages/ductape";
+$profile_archtype         = "i386_linux";
+$profile_lib_subdir        = "$profile_archtype/lib";
+$profile_basic_makefile    = "Makefile.tau-gcc";
+$profile_smarts_makefile   = "Makefile.tau-smarts-gcc";
+$profile_pthreads_makefile = "Makefile.tau-pthread-gcc";
+
+
+### location of PAWS files for program coupling
+
+$paws_able                 = 1;
+$paws_default_dir          = "/home/paws/build/paws-current";
+$paws_lib_subdir           = "$archtype/lib";
+$paws_makefile             = "Makefile.paws-gcc";
+
+
+### location of HDF5 files for I/O
+
+$hdf5_able                 = 1;
+$hdf5_default_dir          = "/usr/local/pooma/packages/hdf5";
+
+
+### location of FFTW files for ffts
+
+$fftw_able                 = 1;
+$fftw_default_dir          = "/home/pooma/packages/fftw/$archtype";
+
+
+### location of cheetah
+
+$cheetah_able              = 1;
+$cheetah_default_dir       = "/home/cheetah/build/cheetah-1.0.0";
+$cheetah_arch              = "$archtype";
+$cheetah_lib_subdir        = "lib/g++";
+$cheetah_include_makefile  = "Makefile.cheetah";
+
+
+### location of LUX files for runtime visualization
+
+$lux_able                  = 0;
+
+
+### location and names of Purify analysis package
+
+$purify_able    = 0;
+
+
+### location and names of Insure++ analysis package
+
+$insure_able    = 0;
+
+
+###########################################################################
+# Section 2: compilation settings
+###########################################################################
+
+###################
+### characteristics
+###################
+
+$comptype = "gcc";
+$compext  = "-gcc";
+
+### are shared libraries supported?
+
+$canmakesharedlib = 0;
+
+### other special characteristics: for all special cases for this
+### architecture that differ from the standard, include a line
+### here to indicate what the differences are, setting a variable
+### equal to one.  If the architecture does the "right thing", though,
+### there is no reason to mention anything here, although you can set
+### the special characteristics variables to 0 if you want.
+
+# gcc does not have restrict (use __restrict__)
+$no_restrict = 1;
+
+# Must include <sys/stat.h> to get POSIX file modes
+$inc_sys_stat_h_file_modes = 1;
+
+# Use gettimeofday in Utilities/Clock.h
+$clock_uses_gettimeofday = 1;
+
+################
+### C++ settings
+################
+
+### general settings for using the C++ compiler, for both libs and apps
+
+$cpp        = "g++";
+$cppargs    = "-ftemplate-depth-80 -Drestrict=__restrict__";
+$cppex      = "";                  # flag to use exceptions
+$cppnoex    = "-fno-exceptions";   # flag to use to turn off exceptions
+$cppverbose = "-Wall";             # flag for verbose compiler output
+$cpponeper  = "";                  # flag to turn on one-instantance-per-obj
+$cppstrict  = " -ansi";            # flag for ANSI conformance checking
+
+
+### debug or optimized build settings for C++ applications
+
+$cppdbg_app  = "-g";
+$cppopt_app  = "-DNOPAssert -DNOCTAssert -O2";
+
+
+### debug or optimized build settings for C++ libraries
+
+$cppdbg_lib  = $cppdbg_app;
+$cppopt_lib  = $cppopt_app;
+
+
+##############
+### C settings
+##############
+
+### general settings for using the C compiler, for both libs and apps
+
+$c        = "gcc";
+$cargs    = "-Drestrict=__restrict__";
+$cverbose = "-Wall";
+
+
+### debug or optimized build settings for C applications
+
+$cdbg_app = "-g";
+$copt_app = "-O2";
+
+
+### debug or optimized build settings for C libraries
+
+$cdbg_lib = $cdbg_app;
+$copt_lib = $copt_app;
+
+
+################
+### F77 settings
+################
+
+### general settings for using the F77 compiler, for both libs and apps
+
+$f77        = "g77";
+$f77args    = "";
+$f77libs    = "";
+$f77verbose = "";
+
+
+### debug or optimized build settings for F77 applications
+
+$f77dbg_app = "-g";
+$f77opt_app = "-O2";
+
+
+### debug or optimized build settings for F77 libraries
+
+$f77dbg_lib = $f77dbg_app;
+$f77opt_lib = $f77opt_app;
+
+
+###################
+### linker settings
+###################
+
+$link        = $cpp;
+$linkargs    = "";
+$linkverbose = "-Wl,-v";
+
+#####################
+### archiver settings
+#####################
+
+$ar          = "ar";                     # program to make static lib
+
+# arguments for making static lib
+$arargs      = "rc";
+
+# flag to turn on verbose ar output
+$arverbose      = "";
+
+# flag for exceptions
+$arex        = "";
+
+# flag for no exceptions
+$arnoex      = "";
+
+# flag for one instantiation per object
+$aroneper      = "";
+
+# flag for ANSI conformance checking
+$arstrict      = "";
+
+### debug or optimized build settings for archiving libraries
+
+$ardbg       = "";
+$aropt       = "";
+
+
+# ACL:rcsinfo
+#  ----------------------------------------------------------------------
+#  $RCSfile: LINUXgcc.conf,v $   $Author: oldham $
+#  $Revision: 1.4 $   $Date: 2001/10/15 17:34:28 $
+#  ----------------------------------------------------------------------
+# ACL:rcsinfo
+
+###########################################################################
+# the last line of this file must be a '1' so that Perl sees a non-zero
+# results from this file
+###########################################################################
+1;
+
diff -Nru a/r2/configure b/r2/configure
--- a/r2/configure      Wed Jan  8 11:42:22 2003
+++ b/r2/configure      Wed Jan  8 11:42:22 2003
@@ -774,7 +774,8 @@
     }
   else
     {
-      printerror "You must specify an architecture with $archnm <arch>";
+      print "Using default architecture file - override with --arch <arch>\n";
+      $arch = "default";
     }
   $archfile = $configarchdir . "/" . $arch . $archfileext;
   -r $archfile or die "Cannot find architecture file $archfile.";
@@ -822,6 +823,11 @@
   if (scalar @{$arghash{$cppnm}} > 1)
     {
       $cpp = $arghash{$cppnm}[1];
+      # if no link cmd is specified, use $cpp
+      if (scalar @{$arghash{$linknm}} == 0)
+        {
+          $link = $cpp;
+        }
     }
   else
     {
@@ -875,7 +881,7 @@
     {
       $arargs .= " $arghash{$arargnm}[$i]";
     }
-  for $i (2 .. $#{$arghash{$linkargnm}})
+  for $i (1 .. $#{$arghash{$linkargnm}})
     {
       $linkargs .= " $arghash{$linkargnm}[$i]";
     }
@@ -1695,13 +1701,13 @@
 ### add settings for non-standard behavior
 sub setcharacteristics
 {
-  # if the system does not have the stringstream class, must use workaround
-  add_yesno_define("POOMA_NO_STRINGSTREAM",
-                  $no_stringstream);
-
-  # if the system is missing some of the iostream manipulators, must avoid them
-  add_yesno_define("POOMA_MISSING_IOMANIPS",
-                  $no_complete_iomanips);
+#  # if the system does not have the stringstream class, must use workaround
+#  add_yesno_define("POOMA_NO_STRINGSTREAM",
+#                 $no_stringstream);
+
+#  # if the system is missing some of the iostream manipulators, must avoid 
them
+#  add_yesno_define("POOMA_MISSING_IOMANIPS",
+#                 $no_complete_iomanips);

   # if the C++ compiler does not allow templated friends, must say so
   add_yesno_define("POOMA_NO_TEMPLATE_FRIENDS",
@@ -1716,34 +1722,34 @@
   add_yesno_define("POOMA_NO_OSTREAM_ITERATOR_1ARG",
                   $no_ostream_iterator_1arg);

-  # if the compiler does not allow definitions of placement delete operations
-  add_yesno_define("POOMA_NO_PLACEMENT_DELETE",
-                  $no_placement_delete);
+#  # if the compiler does not allow definitions of placement delete operations
+#  add_yesno_define("POOMA_NO_PLACEMENT_DELETE",
+#                 $no_placement_delete);

   # should we include extra specializations of some things for small dim?
   add_yesno_define("POOMA_SMALL_DIM_SPECIALIZATIONS",
                   $small_dim_specializations);

-  # if the C++ compiler does not allow template parameters to be dependent,
-  # on others (e.g., template<int D1, int D2=D1, ...>,  must say so
-  add_yesno_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS",
-                  $no_dependent_templ_args);
-
-  # if the C++ library does not have templated complex number class, say so
-  add_yesno_define("POOMA_NO_TEMPLATED_COMPLEX",
-                  $no_templated_complex);
-
-  # if the C++ library does not have complex number class in std::, say so
-  add_yesno_define("POOMA_NO_STD_COMPLEX",
-                  $no_std_complex);
+#  # if the C++ compiler does not allow template parameters to be dependent,
+#  # on others (e.g., template<int D1, int D2=D1, ...>,  must say so
+#  add_yesno_define("POOMA_NO_DEPENDENT_TEMPLATE_ARGS",
+#                 $no_dependent_templ_args);
+
+#  # if the C++ library does not have templated complex number class, say so
+#  add_yesno_define("POOMA_NO_TEMPLATED_COMPLEX",
+#                 $no_templated_complex);
+
+#  # if the C++ library does not have complex number class in std::, say so
+#  add_yesno_define("POOMA_NO_STD_COMPLEX",
+#                 $no_std_complex);

   # if the C++ library has O_BINARY defined
   add_yesno_define("POOMA_HAS_O_BINARY_OPEN_MODE",
                    $o_binary_open_mode);

-  # if the C++ library does not have ios_base class in std::, say so
-  add_yesno_define("POOMA_NO_STD_IOSBASE",
-                  $no_std_iosbase);
+#  # if the C++ library does not have ios_base class in std::, say so
+#  add_yesno_define("POOMA_NO_STD_IOSBASE",
+#                 $no_std_iosbase);

   # if must include <sys/stat.h> for POSIX file modes, say so
   add_yesno_define("POOMA_INC_SYS_STAT_H_FOR_FILE_MODES",
@@ -1855,7 +1861,7 @@
   # put all the link options together
   my $totlibraries = "$preliblist $midliblist $postliblist";
   my $liblinkargs="$linkshare $totlibraries";
-  my $totlinkargs = "$linkargs $liblinkargs";
+  my $totlinkargs = "$liblinkargs $linkargs";

   # open the suite file and write out a prefix
   print "Writing suite file $suitefile ...\n";
@@ -2093,6 +2099,8 @@
   print FHEADER "#ifndef POOMA_GENERATED_CONFIG_H\n";
   print FHEADER "#define POOMA_GENERATED_CONFIG_H\n";
   print FHEADER "\n";
+  print FHEADER "#include \"PoomaAutoconf.h\"\n";
+  print FHEADER "\n";

   # go through all the defines, and write them out.  First find max length
   # of macro names to get spacing right
@@ -2196,7 +2204,7 @@
     }

   # put all the link options together
-  my $totlinkargs = "$linkargs $linkshare $preliblist $midliblist 
$postliblist";
+  my $totlinkargs = "$linkshare $preliblist $midliblist $postliblist 
$linkargs";

   # put all the includes together
   my $totinclist = "-I\$(POOMA_LIBDIR)/$versionheaderbase$extensions $inclist";
@@ -2316,6 +2324,16 @@
   close MFILE;
 }

+sub runautoconf
+{
+  system("cp scripts/configure scripts/PoomaAutoconf.h.in lib/$suite/") == 0
+    or die "Unable to copy autoconf configuration files: $?\n";
+  chdir("lib/$suite");
+  unlink("config.cache");
+  system("env CXX=$cpp ./configure") == 0
+    or die "Autoconf configuration failed: $?\n";
+  chdir("../../");
+}

 ###########################################################################
 #
@@ -2408,6 +2426,9 @@

 ### create dependencies
 writedependfile;
+
+### run autoconfiguration part
+runautoconf;

 ### print out final instructions
 printinstructions;
diff -Nru a/r2/scripts/acconfig.h b/r2/scripts/acconfig.h
--- /dev/null   Wed Dec 31 16:00:00 1969
+++ b/r2/scripts/acconfig.h     Wed Jan  8 11:42:22 2003
@@ -0,0 +1,10 @@
+#undef POOMA_NO_STRINGSTREAM
+#undef POOMA_MISSING_IOMANIPS
+#undef POOMA_NO_STD_IOSBASE
+#undef POOMA_NO_STD_COMPLEX
+#undef POOMA_NO_TEMPLATED_COMPLEX
+#undef POOMA_NO_DEPENDENT_TEMPLATE_ARGS
+#undef POOMA_NO_PLACEMENT_DELETE
+#undef POOMA_NO_TEMPLATEFUNC_DEFAULTARGS
+#undef POOMA_NO_IOS_HEADER
+#undef POOMA_NO_IOSBASE_FMTFLAGS
diff -Nru a/r2/scripts/configure.in b/r2/scripts/configure.in
--- /dev/null   Wed Dec 31 16:00:00 1969
+++ b/r2/scripts/configure.in   Wed Jan  8 11:42:22 2003
@@ -0,0 +1,164 @@
+AC_INIT(configure)
+AC_CONFIG_HEADER([PoomaAutoconf.h])
+
+AC_PROG_CXX
+AC_PROG_CXXCPP
+
+AC_LANG_CPLUSPLUS
+
+dnl
+dnl check for IO manipulators
+dnl
+AC_MSG_CHECKING([wether we have complete IO manipulators])
+AC_TRY_COMPILE([
+#include <iostream>
+#include <iomanip>
+], [
+       std::cout << std::left;
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_MISSING_IOMANIPS)
+])
+
+dnl
+dnl check for std iosbase
+dnl
+AC_MSG_CHECKING([wether we have a standard iosbase class])
+AC_TRY_COMPILE([
+#include <iostream>
+#include <iomanip>
+class Inform;
+inline Inform &operator<<(Inform &o, std::ios_base &(*d)(std::ios_base &))
+{
+}
+], [
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_STD_IOSBASE)
+])
+
+dnl
+dnl check for stringstream
+dnl
+AC_MSG_CHECKING([wether we have sstream])
+AC_TRY_COMPILE([
+#include <sstream>
+], [
+       std::ostringstream *msg;
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_STRINGSTREAM)
+])
+
+dnl
+dnl check for complex in std and templated complex
+dnl
+AC_MSG_CHECKING([wether we have a complex inside std])
+AC_TRY_COMPILE([
+#include <complex>
+], [
+       std::complex<double> val;
+], [
+complexok=yes
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_STD_COMPLEX)
+])
+if test x$complexok != xyes; then
+  AC_MSG_CHECKING([wether we have a not-templated complex])
+  AC_TRY_COMPILE([
+  #include <complex>
+  ], [
+       complex<double> val;
+  ], [
+  AC_MSG_RESULT([no])
+  ] , [
+  AC_MSG_RESULT([yes])
+  AC_DEFINE(POOMA_NO_TEMPLATED_COMPLEX)
+  ])
+fi
+
+dnl
+dnl check for dependent template arguments
+dnl
+AC_MSG_CHECKING([wether we support dependent template arguments])
+AC_TRY_COMPILE([
+template <int D1, int D2>
+class Foo;
+template <int D1, int D2=D1>
+class Foo {
+};
+], [
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_DEPENDENT_TEMPLATE_ARGS)
+])
+
+dnl
+dnl check for placement delete operator support
+dnl
+AC_MSG_CHECKING([wether we support delete operators with placement argument])
+AC_TRY_COMPILE([
+class foo {
+       void operator delete(void *, void *) { }
+};
+], [
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_PLACEMENT_DELETE)
+])
+
+dnl
+dnl check for correct handling of default arguments to specialized
+dnl template functions
+dnl
+AC_MSG_CHECKING([wether we handle default args to template functions correct])
+AC_TRY_COMPILE([
+template <int Dim>
+class Centering {};
+template <int Dim>
+const Centering<Dim> test(int a, int b = 0);
+template <>
+const Centering<1> test<1>(int a, int b);
+], [
+       Centering<1> c = test<1>(1);
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_TEMPLATEFUNC_DEFAULTARGS)
+])
+
+dnl
+dnl check for ios header, use iostream if not
+dnl
+AC_CHECK_HEADER([ios], , [ AC_DEFINE(POOMA_NO_IOS_HEADER) ])
+
+dnl
+dnl check for std::ios_base::fmtflags
+dnl
+AC_MSG_CHECKING([wether we have std::ios_base::fmtflags])
+AC_TRY_COMPILE([
+#include <iostream>
+typedef std::ios_base::fmtflags FmtFlags_t;
+], [
+       FmtFlags_t f;
+], [
+AC_MSG_RESULT([yes])
+] , [
+AC_MSG_RESULT([no])
+AC_DEFINE(POOMA_NO_IOSBASE_FMTFLAGS)
+])
+
+AC_OUTPUT()
diff -Nru a/r2/src/Field/FieldCentering.h b/r2/src/Field/FieldCentering.h
--- a/r2/src/Field/FieldCentering.h     Wed Jan  8 11:42:22 2003
+++ b/r2/src/Field/FieldCentering.h     Wed Jan  8 11:42:22 2003
@@ -538,11 +538,19 @@
 extern const CanonicalCentering<2> canonicalCenteringTwo_g;
 extern const CanonicalCentering<3> canonicalCenteringThree_g;

+#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS
+template <int Dim>
+const Centering<Dim> canonicalCentering
+    (const enum CenteringType type,
+     const enum ContinuityType discontinuous,
+     const int dimension);
+#else
 template <int Dim>
 const Centering<Dim> canonicalCentering
     (const enum CenteringType type,
      const enum ContinuityType discontinuous,
      const int dimension = 0);
+#endif

 template <>
 const Centering<1> canonicalCentering<1>
@@ -561,6 +569,16 @@
     (const enum CenteringType type,
      const enum ContinuityType discontinuous,
      const int dimension);
+
+#if POOMA_NO_TEMPLATEFUNC_DEFAULTARGS
+template <int Dim>
+inline const Centering<Dim> canonicalCentering
+    (const enum CenteringType type,
+     const enum ContinuityType discontinuous)
+{
+       return canonicalCentering<Dim>(type, discontinuous, 0);
+}
+#endif

 //-----------------------------------------------------------------------------
 //
diff -Nru a/r2/src/IO/DiskLayout.cmpl.cpp b/r2/src/IO/DiskLayout.cmpl.cpp
--- a/r2/src/IO/DiskLayout.cmpl.cpp     Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/DiskLayout.cmpl.cpp     Wed Jan  8 11:42:22 2003
@@ -53,9 +53,7 @@
 #include "Layout/UniformGridLayout.h"
 #include "Tulip/RemoteProxy.h"

-// Re-check this when GCC 3.0 is ported
-
-#if defined(__CYGWIN32__)
+#if POOMA_NO_IOS_HEADER
 #include <iostream>
 #else
 #include <ios>
diff -Nru a/r2/src/IO/DiskLayout.h b/r2/src/IO/DiskLayout.h
--- a/r2/src/IO/DiskLayout.h    Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/DiskLayout.h    Wed Jan  8 11:42:22 2003
@@ -58,6 +58,7 @@

 #include <fstream>  // file I/O
 #include <vector>   // node lists
+#include <string>

 //-----------------------------------------------------------------------------
 // struct DiskNode<Dim>
diff -Nru a/r2/src/IO/FileSetReader.cmpl.cpp b/r2/src/IO/FileSetReader.cmpl.cpp
--- a/r2/src/IO/FileSetReader.cmpl.cpp  Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/FileSetReader.cmpl.cpp  Wed Jan  8 11:42:22 2003
@@ -43,9 +43,7 @@

 #include <iostream>

-// Really should add a POOMA_HAS_IOS_INCLUDE config macro.
-
-#if !(defined(__GNUC__) && (__GNUC__ < 3))
+#if !POOMA_NO_IOS_HEADER
 # include <ios>
 #endif

diff -Nru a/r2/src/IO/FileSetReader.cpp b/r2/src/IO/FileSetReader.cpp
--- a/r2/src/IO/FileSetReader.cpp       Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/FileSetReader.cpp       Wed Jan  8 11:42:22 2003
@@ -44,9 +44,7 @@

 #include <iostream>

-// Really should add a POOMA_HAS_IOS_INCLUDE config macro.
-
-#if !(defined(__GNUC__) && (__GNUC__ < 3))
+#if !POOMA_NO_IOS_HEADER
 # include <ios>
 #endif

diff -Nru a/r2/src/IO/tests/DiskLayoutTest1.cpp 
b/r2/src/IO/tests/DiskLayoutTest1.cpp
--- a/r2/src/IO/tests/DiskLayoutTest1.cpp       Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/tests/DiskLayoutTest1.cpp       Wed Jan  8 11:42:22 2003
@@ -48,7 +48,7 @@

 #include <fstream>

-#if !defined(__CYGWIN32__)
+#if !POOMA_NO_IOS_HEADER
 # include <ios>
 #endif

diff -Nru a/r2/src/IO/tests/FileSetReaderTest0.cpp 
b/r2/src/IO/tests/FileSetReaderTest0.cpp
--- a/r2/src/IO/tests/FileSetReaderTest0.cpp    Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/tests/FileSetReaderTest0.cpp    Wed Jan  8 11:42:22 2003
@@ -44,7 +44,7 @@

 #include <fstream>

-#if !(defined(__GNUC__) && __GNUC__ < 3)
+#if !POOMA_NO_IOS_HEADER
 # include <ios>
 #endif

diff -Nru a/r2/src/IO/tests/dumper.cpp b/r2/src/IO/tests/dumper.cpp
--- a/r2/src/IO/tests/dumper.cpp        Wed Jan  8 11:42:22 2003
+++ b/r2/src/IO/tests/dumper.cpp        Wed Jan  8 11:42:22 2003
@@ -32,8 +32,8 @@
 #include <string>
 #include <algorithm> // replace

-#if !(defined(__GNUC__) && __GNUC__ < 3)
-#include <ios>
+#if !POOMA_NO_IOS_HEADER
+#  include <ios>
 #endif

 using std::cout;
diff -Nru a/r2/src/Tiny/TinyMatrix.h b/r2/src/Tiny/TinyMatrix.h
--- a/r2/src/Tiny/TinyMatrix.h  Wed Jan  8 11:42:22 2003
+++ b/r2/src/Tiny/TinyMatrix.h  Wed Jan  8 11:42:22 2003
@@ -56,7 +56,11 @@
 #include "Tiny/TinyMatrixEngine.h"
 #include "Tiny/TinyMatrixElements.h"
 #include "Tiny/TinyMatrixOperators.h"
+#if POOMA_NO_IOS_HEADER
+#include <iostream>
+#else
 #include <ios>
+#endif

 //-----------------------------------------------------------------------------
 // Forward Declarations:
diff -Nru a/r2/src/Tiny/Vector.h b/r2/src/Tiny/Vector.h
--- a/r2/src/Tiny/Vector.h      Wed Jan  8 11:42:22 2003
+++ b/r2/src/Tiny/Vector.h      Wed Jan  8 11:42:22 2003
@@ -56,7 +56,11 @@
 #include "Tiny/VectorEngine.h"
 #include "Tiny/VectorElements.h"
 #include "Tiny/VectorOperators.h"
+#if POOMA_NO_IOS_HEADER
+#include <iostream>
+#else
 #include <ios>
+#endif

 //-----------------------------------------------------------------------------
 // Forward Declarations:
diff -Nru a/r2/src/Utilities/Inform.h b/r2/src/Utilities/Inform.h
--- a/r2/src/Utilities/Inform.h Wed Jan  8 11:42:22 2003
+++ b/r2/src/Utilities/Inform.h Wed Jan  8 11:42:22 2003
@@ -275,8 +275,7 @@
   void print() { flush(); }
   void output() { flush(); }

-#if (defined(__MWERKS__) && __MWERKS__ >= 0x2301) \
- || (defined(__GLIBCPP__) && __GLIBCPP__ >= 20001129)
+#if !POOMA_NO_IOSBASE_FMTFLAGS
   typedef std::ios_base::fmtflags FmtFlags_t;
 #else
   typedef long FmtFlags_t;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]