BZDEV: Re: Blitz++ ported to GCC 2.8.1

From: Todd Veldhuizen (tveldhui@oonumerics.org)
Date: Wed Jun 10 1998 - 10:17:41 EST


Moritz Franosch wrote:
> I have compiled Blitz++ version 980417, the checks and the examples
> successfully with GNU C++ 2.8.1.
> The examples run, but I dont't know if they give the correct output.
> I have used Linux on an i686 but I could also try a DEC Alpha.

Wow, Moritz, this is great news. Sorry for taking a while to get back
to you, I have been travelling a lot lately. I'm settled down now and
back to work again.

> Problems:
>
>
> In 'arrayeval.cc'
>
> #ifdef BZ_HAVE_STD
> enum { isStencil = (N_rank >= 3) && (T_expr::numArrayOperands > 6)
> && (T_expr::numIndexPlaceholders == 0) };
>
> if ( _bz_tryFastTraversal<isStencil>::tryFast(*this, expr, T_update()) ) {
> return *this;
> };
> #endif
>
> I get an internal compiler error, so I decided to comment those lines out with
>
> #if (__GNUC__!=2 || __GNUC_MINOR__!=8)
> ...
> #endif
>
> You should delete this again when GCC 2.8.2 becomes available.

This change looks fine.

> The check 'promote.cpp' compiles without any error but gives an error
> when
>
> check(bool(), bool(), int());
>
> is executed. I think the compiler is correct here because in
> 'promote-old.h' there are no bools. So I added some code to
> 'promote-old.h' (see the diffs below). Then I got errors in lines
>
> check(complex<float>(), foo(), foo());
> check(int(), foo(), foo());
> check(foo(), bigfoo(), bigfoo());
>
> When you uncomment
>
> #define BZ_DISABLE_NEW_PROMOTE
>
> in 'promote.h' the check 'promote.cpp' works. I really don't know
> exactly what to do here.

Yes, this needs some work. On the TODO.

> The bzconfig-test says IEEE math is missing. Most is implemented,
> however. Only 'trunc' and 'logb' seem to be missing.

Really need a better way to handle these. Also on the TODO.

> Here is the file 'config.h':
>
> /******************************************************************************
> * config.h Compiler language support flags
> *
> * This file was generated automatically by the script bzconfig.
> * You should rerun bzconfig each time you switch compilers, install new
> * standard libraries, or change compiler versions.
> *
> */
>
>
> #ifndef BZ_CONFIG_H
> #define BZ_CONFIG_H
>
> #define BZ_COMPILER_NAME "g++-2.8"
> #define BZ_COMPILER_OPTIONS "-ftemplate-depth-30"
> #define BZ_OS_NAME "Linux 2.0.30"
> #define BZ_BZCONFIG_DATE "Tue May 26 03:28:59 MEST 1998"
>
> #undef BZ_NAMESPACES
> #define BZ_EXCEPTIONS
> #define BZ_RTTI
> #define BZ_MEMBER_CONSTANTS
> #define BZ_OLD_FOR_SCOPING
> #define BZ_EXPLICIT
> #define BZ_MUTABLE
> #define BZ_TYPENAME
> #undef BZ_NCEG_RESTRICT
> #define BZ_BOOL
> #define BZ_CONST_CAST
> #define BZ_STATIC_CAST
> #define BZ_REINTERPRET_CAST
> #define BZ_DYNAMIC_CAST
> #define BZ_TEMPLATES
> #define BZ_PARTIAL_SPECIALIZATION
> #define BZ_PARTIAL_ORDERING
> #define BZ_DEFAULT_TEMPLATE_PARAMETERS
> #define BZ_MEMBER_TEMPLATES
> #define BZ_MEMBER_TEMPLATES_OUTSIDE_CLASS
> #define BZ_FULL_SPECIALIZATION_SYNTAX
> #define BZ_FUNCTION_NONTYPE_PARAMETERS
> #define BZ_TEMPLATE_QUALIFIED_BASE_CLASS
> #define BZ_TEMPLATE_QUALIFIED_RETURN_TYPE
> #define BZ_EXPLICIT_TEMPLATE_FUNCTION_QUALIFICATION
> #undef BZ_TEMPLATES_AS_TEMPLATE_ARGUMENTS
> #define BZ_TEMPLATE_KEYWORD_QUALIFIER
> #define BZ_TEMPLATE_SCOPED_ARGUMENT_MATCHING
> #define BZ_TYPE_PROMOTION
> #define BZ_USE_NUMTRAIT
> #define BZ_HAVE_COMPLEX
> #undef BZ_HAVE_NUMERIC_LIMITS
> #undef BZ_HAVE_VALARRAY
> #undef BZ_HAVE_COMPLEX_MATH
> #undef BZ_HAVE_IEEE_MATH
> #undef BZ_HAVE_SYSTEM_V_MATH
> #define BZ_HAVE_STD
> #define BZ_HAVE_RUSAGE
> #define BZ_ENUM_COMPUTATIONS
>
> #endif // BZ_CONFIG_H

Looks like gcc has come a long way quickly.

>
>
>
>
> Here are all the diffs I have made:
>
>
> *** ../blitz-980417/configure.in Tue May 26 02:50:57 1998
> --- ../blitz-980417.orig/blitz-980417/configure.in Wed Apr 15 02:19:47 1998
> ***************
> *** 83,101 ****
> F77_OPTIMIZE_FLAGS="-O"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES"
> ;;
> - g++)
> - echo "Configuring for g++ 2.8.1 or higher"
> - bz_compiler=g++
> - CXX=g++
> - GCC_VERSION=$($CXX --version)
> - echo "found version $GCC_VERSION"
> - CXXFLAGS="-ftemplate-depth-30"
> - CXX_OPTIMIZE_FLAGS="-O"
> - CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
> - F77=g77
> - F77_OPTIMIZE_FLAGS="-O"
> - CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES"
> - ;;
> aCC)
> echo "Configuring for aCC (HP-UX)"
> bz_compiler=aCC
> --- 83,88 ----
> ***************
> *** 200,209 ****
> AC_CHECK_TOOL(AR, ar)
> AC_CHECK_TOOL(RANLIB, ranlib)
>
> !
> ! #### AC_PROG_CXX
> ! AC_SUBST(CXX)
> !
> dnl AC_CHECK_PROGS(M4, gm4 gnum4 m4, m4)
>
> AC_CHECK_LIB(m, sin)
> --- 187,193 ----
> AC_CHECK_TOOL(AR, ar)
> AC_CHECK_TOOL(RANLIB, ranlib)
>
> ! AC_PROG_CXX
> dnl AC_CHECK_PROGS(M4, gm4 gnum4 m4, m4)
>
> AC_CHECK_LIB(m, sin)
>
>
>
>
> *** ../blitz-980417/blitz/arrayeval.cc Tue May 26 02:52:45 1998
> --- ../blitz-980417.orig/blitz-980417/blitz/arrayeval.cc Sat Apr 11 19:35:21 1998
> ***************
> *** 178,191 ****
> // library.
>
> #ifdef BZ_HAVE_STD
> ! #if (__GNUC__!=2 || __GNUC_MINOR__!=8)
> enum { isStencil = (N_rank >= 3) && (T_expr::numArrayOperands > 6)
> && (T_expr::numIndexPlaceholders == 0) };
>
> ! if ( _bz_tryFastTraversal<isStencil>::tryFast(*this, expr, T_update()) ) {
> return *this;
> ! };
> ! #endif
> #endif
>
> #ifdef BZ_ARRAY_2D_STENCIL_TILING
> --- 178,190 ----
> // library.
>
> #ifdef BZ_HAVE_STD
> !
> enum { isStencil = (N_rank >= 3) && (T_expr::numArrayOperands > 6)
> && (T_expr::numIndexPlaceholders == 0) };
>
> ! if (_bz_tryFastTraversal<isStencil>::tryFast(*this, expr, T_update()))
> return *this;
> !
> #endif
>
> #ifdef BZ_ARRAY_2D_STENCIL_TILING
>
>
>
>
> *** ../blitz-980417/blitz/promote-old.h Tue May 26 02:17:59 1998
> --- ../blitz-980417.orig/blitz-980417/blitz/promote-old.h Mon Apr 13 01:34:26 1998
> ***************
> *** 1344,1525 ****
> };
> #endif
>
> -
> -
> -
> -
> - template<>
> - class promote_trait<bool, bool> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, unsigned char> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, short int> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, short unsigned int> {
> - public:
> - typedef unsigned int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, int> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, unsigned int> {
> - public:
> - typedef unsigned int T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, long> {
> - public:
> - typedef long T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, unsigned long> {
> - public:
> - typedef unsigned long T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, float> {
> - public:
> - typedef float T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, double> {
> - public:
> - typedef double T_promote;
> - };
> -
> - template<>
> - class promote_trait<bool, long double> {
> - public:
> - typedef long double T_promote;
> - };
> -
> -
> - template<>
> - class promote_trait<unsigned char, bool> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<short int, bool> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<short unsigned int, bool> {
> - public:
> - typedef unsigned int T_promote;
> - };
> -
> - template<>
> - class promote_trait<int, bool> {
> - public:
> - typedef int T_promote;
> - };
> -
> - template<>
> - class promote_trait<unsigned int, bool> {
> - public:
> - typedef unsigned int T_promote;
> - };
> -
> - template<>
> - class promote_trait<long, bool> {
> - public:
> - typedef long T_promote;
> - };
> -
> - template<>
> - class promote_trait<unsigned long, bool> {
> - public:
> - typedef unsigned long T_promote;
> - };
> -
> - template<>
> - class promote_trait<float, bool> {
> - public:
> - typedef float T_promote;
> - };
> -
> - template<>
> - class promote_trait<double, bool> {
> - public:
> - typedef double T_promote;
> - };
> -
> - template<>
> - class promote_trait<long double, bool> {
> - public:
> - typedef long double T_promote;
> - };
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<bool, complex<long double> > {
> - public:
> - typedef complex<long double> T_promote;
> - };
> - #endif
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<complex<long double>, bool > {
> - public:
> - typedef complex<long double> T_promote;
> - };
> - #endif
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<bool, complex<double> > {
> - public:
> - typedef complex<double> T_promote;
> - };
> - #endif
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<complex<double>, bool > {
> - public:
> - typedef complex<double> T_promote;
> - };
> - #endif
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<bool, complex<float> > {
> - public:
> - typedef complex<float> T_promote;
> - };
> - #endif
> -
> - #ifdef BZ_HAVE_COMPLEX
> - template<>
> - class promote_trait<complex<float>, bool > {
> - public:
> - typedef complex<float> T_promote;
> - };
> - #endif
> -
> --- 1344,1346 ----
>
>
>
> Information on the system I have used:
>
> jfranosc@pcleo3:/home/jfranosc/tmp/blitz > cat /proc/version
> Linux version 2.0.30 (root@spine) (gcc version 2.7.2.1) #5 Fri Oct 24 09:31:17 MEST 1997
>
> jfranosc@pcleo3:/home/jfranosc/tmp/blitz > cat /proc/cpuinfo
> processor : 0
> cpu : 686
> model : Pentium Pro
> vendor_id : GenuineIntel
> stepping : 6
> fdiv_bug : no
> hlt_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid : yes
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 11 mtrr pge mca cmov
> bogomips : 199.07
>

--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo@oonumerics.org, with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:04 EST