![]() |
Blitz Devel : |
From: Todd Veldhuizen (tveldhui_at_[hidden])
Date: 1998-06-26 08:57:09
Thanks, Theo. I'm leaving today for a 2 week summer school, so I will
incorporate your patches when I return in mid-July. The syntax you
have for specifying compiler name and options is great!
Cheers,
Todd
>
>
> Hi,
>
> As I promised you some time ago, here is a patch (+one file)
> that allow:
>
> - The specification of the directory for blas.
> - the user to give his own name and parameters for the c++
> compiler.
>
> I felt that the second one might be interesting for two reasons:
>
> - quite often people install egcs at some place but use an
> alternate name to access that compiler. This allows having
> both g++ end egcs/g++ to be used on the same system.
>
> - It might be interesting to allow someone to modify easily the
> compiler flags its uses for blitz.
>
> I had two possibilities for that last feature:
>
> - either allows predefined CXX and CXXFLAGS to override those
> that are set by the with-cxx parameter.
>
> - or extend your syntax which is the solution I took (because
> that's the way I started to do it and because I think it's
> more user friendly).
>
> With this patch, you can:
>
> - use the --with-blas=... to specify the path where to find
> the blas library.
>
> - use the syntax --with-cxx="egcs:eg++ -ftemplate-depth-50" to
> specify that the name of the egcs c++ compiler is eg++ and
> that the parameter to be used is -ftemplate-depth-50.
> Everything after the colon (including it) is optional with
> defaults corresponding to what you put in the original
> script. You cannot specify parameters without specifying a
> compiler name.
>
> Example:
>
> ./configure --with-blas=/u/corse/2/robotvis/lib --with-cxx="egcs:eg++ -ftemplate-depth-50"
>
> I hope that those will be useful. It is implemented in two files:
> There is a m4 macro in the (new) file aclocal.m4 and modifications to
> the configure.in script (I'm providing the patch with respect to the
> blitz-19980625 configure.in below).
>
> Best regards,
>
> Theo.
>
> PS: For my mail of yesterdayconverning stencils, I did not realize that the
> biggest problem was to find a macro solution with a reasonnable
> syntax... I think that it will be difficult with the proposal I made.
> On the other hand, I do not like much the use of macros. If I can
> think of something else, I will forward it to you.
>
> ###################### aclocal.m4 ####################################
> AC_DEFUN(AC_BZ_SET_COMPILER,
> [cxxwith=`echo $1 | sed -n -e 's/ /@/gp'`
> case "$cxxwith" in
> *:*@*) # Full initialization syntax
> CXX=`echo "$cxxwith" | sed -n -e 's/.*:\(.*\)@.*/\1/p'`
> CXXFLAGS=`echo "$cxxwith" | sed -n -e 's/.*:.*@\(.*\)/\1/p'`
> ;;
> *@*) # Simple initialization syntax
> CXX=`echo "$cxxwith" | sed -n -e 's/.*@\(.*\)/\1/p'`
> CXXFLAGS=$3
> ;;
> *) # Default values
> CXX="$2"
> CXXFLAGS="$3"
> ;;
> esac])
>
> #################### patch for configure.in #######################
> *** configure.in.orig Wed May 6 14:02:03 1998
> --- configure.in Fri Jun 26 15:00:51 1998
> ***************
> *** 35,104 ****
> know_compiler=0
>
> AC_ARG_WITH(cxx,
> ! [ --with-cxx=COMPILER set options for COMPILER (KCC, cray, egcs, DECcxx, aCC)],
> [case "$withval" in
> ! KCC) # KAI C++ http://www.kai.com/
> echo "Configuring for KAI C++"
> bz_compiler=kcc
> ! CXX=KCC
> ! CXXFLAGS="--restrict --strict_warnings"
> CXX_OPTIMIZE_FLAGS="+K3 -O3"
> CXX_DEBUG_FLAGS="-g +K0 -DBZ_DEBUG"
> ;;
> ! KCCdev) # KAI C++ (development flags)
> echo "Configuring for KAI C++ development environment"
> bz_compiler=kccdev
> ! CXX=KCC
> ! CXXFLAGS="-DTV_KCC --restrict \
> --no_implicit_include --abstract_pointer --abstract_float \
> --no_implicit_typename --no_old_specializations \
> ! --strict_warnings"
> CXX_OPTIMIZE_FLAGS="+K3 -O3"
> CXX_DEBUG_FLAGS="-g +K0 -DBZ_DEBUG"
> ;;
> ! DECcxx) # DEC C++ http://www.digital.com/
> echo "Configuring for DEC cxx"
> bz_compiler=cxx
> ! CXX=cxx
> ! CXXFLAGS="-std strict_ansi"
> CXX_OPTIMIZE_FLAGS="-O4 -tune host -std strict_ansi"
> CXX_DEBUG_FLAGS="-g -w0 -msg_display_tag -DBZ_DEBUG -std strict_ansi"
> ;;
> ! cray) # Cray C++
> echo "Configuring for Cray C++."
> bz_compiler=cray
> ! CXX=CC
> ! CXXFLAGS="-h instantiate=used"
> CXX_OPTIMIZE_FLAGS="-O3 -hpipeline3 -hunroll -haggress -hscalar2"
> CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
> ;;
> ! egcs) # EGCS http://egcs.cygnus.com/
> echo "Configuring for EGCS (wahoo!)"
> bz_compiler=egcs
> ! CXX=g++
> ! 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
> ! CXX=aCC
> ! CXXFLAGS=""
> CXX_OPTIMIZE_FLAGS="-O"
> CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
> F77=f77
> F77_OPTIMIZE_FLAGS="-O"
> ;;
> ! pgCC) # Portland group http://www.pgroup.com/
> echo "Configuring for Portland Group C++"
> echo "You do know this isn't supported yet, right?"
> bz_compiler=pgCC
> ! CXX=pgCC
> ! CXXFLAGS=""
> CXX_OPTIMIZE_FLAGS="-O4 -Mnoframe -Mnodepchk -Minline=levels:25"
> CXX_DEBUG_FLAGS="-g -O0 -DBZ_DEBUG"
> ;;
> --- 35,97 ----
> know_compiler=0
>
> AC_ARG_WITH(cxx,
> ! [ --with-cxx=COMPILER[:name-flags] set options for COMPILER (KCC, cray, egcs, DECcxx, aCC)],
> [case "$withval" in
> ! KCC*) # KAI C++ http://www.kai.com/
> echo "Configuring for KAI C++"
> bz_compiler=kcc
> ! AC_BZ_SET_COMPILER($withval,"KCC","--restrict --strict_warnings")
> CXX_OPTIMIZE_FLAGS="+K3 -O3"
> CXX_DEBUG_FLAGS="-g +K0 -DBZ_DEBUG"
> ;;
> ! KCCdev*) # KAI C++ (development flags)
> echo "Configuring for KAI C++ development environment"
> bz_compiler=kccdev
> ! AC_BZ_SET_COMPILER($withval,"KCC","-DTV_KCC --restrict \
> --no_implicit_include --abstract_pointer --abstract_float \
> --no_implicit_typename --no_old_specializations \
> ! --strict_warnings")
> CXX_OPTIMIZE_FLAGS="+K3 -O3"
> CXX_DEBUG_FLAGS="-g +K0 -DBZ_DEBUG"
> ;;
> ! DECcxx*) # DEC C++ http://www.digital.com/
> echo "Configuring for DEC cxx"
> bz_compiler=cxx
> ! AC_BZ_SET_COMPILER($withval,"cxx","-std strict_ansi")
> CXX_OPTIMIZE_FLAGS="-O4 -tune host -std strict_ansi"
> CXX_DEBUG_FLAGS="-g -w0 -msg_display_tag -DBZ_DEBUG -std strict_ansi"
> ;;
> ! cray*) # Cray C++
> echo "Configuring for Cray C++."
> bz_compiler=cray
> ! AC_BZ_SET_COMPILER($withval,"CC","-h instantiate=used")
> CXX_OPTIMIZE_FLAGS="-O3 -hpipeline3 -hunroll -haggress -hscalar2"
> CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
> ;;
> ! egcs*) # EGCS http://egcs.cygnus.com/
> echo "Configuring for EGCS (wahoo!)"
> bz_compiler=egcs
> ! AC_BZ_SET_COMPILER($withval,"g++","-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
> ! AC_BZ_SET_COMPILER($withval,"aCC","")
> CXX_OPTIMIZE_FLAGS="-O"
> CXX_DEBUG_FLAGS="-g -DBZ_DEBUG"
> F77=f77
> F77_OPTIMIZE_FLAGS="-O"
> ;;
> ! pgCC*) # Portland group http://www.pgroup.com/
> echo "Configuring for Portland Group C++"
> echo "You do know this isn't supported yet, right?"
> bz_compiler=pgCC
> ! AC_BZ_SET_COMPILER($withval,"pgCC","")
> CXX_OPTIMIZE_FLAGS="-O4 -Mnoframe -Mnodepchk -Minline=levels:25"
> CXX_DEBUG_FLAGS="-g -O0 -DBZ_DEBUG"
> ;;
> ***************
> *** 126,131 ****
> --- 119,129 ----
> exit 1
> fi
>
> + AC_ARG_WITH(blas,
> + [ --with-blas=DIR set the path for the blas library],
> + BLASPATH=-L"$withval",
> + BLASPATH="")
> +
> # Set platform-specific fortran compilers and optimization settings
>
> case "$target" in
> ***************
> *** 205,229 ****
>
> echo "Checking to see if there is a usable BLAS library kicking around.."
>
> AC_CHECK_LIB(blas, daxpy_,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES"
> ! BLASLIB="-lblas" ])
>
> AC_CHECK_LIB(blas, daxpy,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS=""
> ! BLASLIB="-lblas" ])
>
> AC_CHECK_LIB(blas, DAXPY,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_CAPS"
> ! BLASLIB="-lblas" ])
>
> AC_CHECK_LIB(blas, daxpy__,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES"
> ! BLASLIB="-lblas" ])
>
> dnl This is where an integrated bzconfig will go eventually.
> dnl For now, I'm happy to do it with the makefile.
> --- 203,232 ----
>
> echo "Checking to see if there is a usable BLAS library kicking around.."
>
> + LDFLAGSsave=$LDFLAGS
> + LDFLAGS="$BLASPATH $LDFLAGS"
> +
> AC_CHECK_LIB(blas, daxpy_,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_TRAILING_UNDERSCORES"
> ! BLASLIB="$BLASPATH -lblas" ])
>
> AC_CHECK_LIB(blas, daxpy,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS=""
> ! BLASLIB="$BLASPATH -lblas" ])
>
> AC_CHECK_LIB(blas, DAXPY,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_CAPS"
> ! BLASLIB="$BLASPATH -lblas" ])
>
> AC_CHECK_LIB(blas, daxpy__,
> [ CXX_OPTIMIZE_FLAGS="$CXX_OPTIMIZE_FLAGS -DUSE_LIBBLAS"
> CXXFFLAGS="-DBZ_FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES"
> ! BLASLIB="$BLASPATH -lblas" ])
> !
> ! LDFLAGS=$LDFLAGSsave
>
> dnl This is where an integrated bzconfig will go eventually.
> dnl For now, I'm happy to do it with the makefile.
>
>
>
>
> --
> --------------------------------------------------------------------------------
> Theodore Papadopoulo (papadop_at_[hidden])
>
> Projet Robotvis, INRIA - Sophia Antipolis,
> 2004, route des Lucioles, BP 93, 06902 Sophia Antipolis Cedex -- FRANCE
> Phone: (33) 04 92 38 76 01, Fax: (33) 04 92 38 78 45
> --------------------------------------------------------------------------------
>
>
>