From 6e0ed746fd5ce44ae03fad9d1ddfe1c1c61ccaf1 Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Mon, 1 Dec 2003 18:54:00 +0000 Subject: [PATCH] Update from ALBERT to ALBERTA. Try to be more detailed about setting of compiler-flags. --- README | 96 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 28 deletions(-) diff --git a/README b/README index 471679b..90668ce 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ -ALBERTA: an Adaptive multi Level finite element toolbox using - Bisectioning refinement and Error control by Residual - Techniques +ALBERTA is an Adaptive multi-Level finite element toolbox using + Bisectioning refinement and Error control by Residual + Techniques for scientific Applications. Contents ======== @@ -241,9 +241,8 @@ following options: packages "gltools" and "GRAPE" . --with-PKG-name=NAME - The library is not called PKG, but NAME, e.g. "MesaGL" instead - of "GL", or "cxml" instead of "blas". Configure will then - search for "libNAME" instead of "libPKG". + Alter the default name of the package, + e.g. "--with-opengl-name=MesaGL" or "--with-blas-name=cxml". --with-PKG-dir=DIR Search for header-files and for the library itself below DIR, @@ -257,8 +256,8 @@ following options: Use DIR as search-path for the include-files for PKG, e.g. "--with-opengl-include=/usr/people/claus/software/include/". -The following quotes the online-help obtained by running "configure ---help" +The following quotes the relevant fragment of the online-help obtained +by running "configure --help" --with-blas-name=NAME use NAME as the name of the blas library (without leading "lib" prefix and trailing suffix). Default: @@ -300,8 +299,8 @@ The following quotes the online-help obtained by running "configure (default: PREFIX/include/) -IV. Compiler flags settings -=========================== +IV. Compiler flags +================== The default flags for the optimised libraries are "-O3" when using gcc and "-O" otherwise. @@ -309,37 +308,78 @@ and "-O" otherwise. The default flags for the debugging-enabled libraries are "-O0 -ggdb -fno-inline -fno-builtin" with gcc and "-g" otherwise. -You are strongly encouraged to change this. To do so, you can set the -environment variables +The relevant environment- respectively make-variables are + +CFLAGS + C-compiler flags used for _both_, optimised and debug enabled libraries ALBERTA_OPTIMISE_CFLAGS + C-compiler flags used fo the optimised library. They are prepended + to the CFLAGS variable. + ALBERTA_DEBUG_CFLAGS + C-compiler flags used fo the debug enabled library. They are + prepended to the CFLAGS variable. + FFLAGS + Fortran-compiler flags. They are separated from the CFLAGS because + in general the Fortran compiler can come from a different vendor + than the C-compiler in which case the flags understood by the + Fortran compiler are different from the flags understood by the + C-compiler. -before you run configure. You can also set these variables on the -command-line of the "configure" or the "make" program, e.g. with a recent -gcc on a Pentium 4 you could use +You have to consult the documentation for the compiler(s) you are using +to determine the appropriate switches for your setup. -configure ALBERTA_OPTIMISE_CFLAGS="-O3 -march=pentium4 -mfpmath=sse" +There are three ways to set those flags: -or (later, when building the libraries) +a.) arguments to configure +b.) environment variables (have to be defined _before_ running configure) +c.) arguments to make -make ALBERTA_OPTIMISE_CFLAGS="-O3 -march=pentium4 -mfpmath=sse" +We recommend using a.). -You have to consult the documentation for the compiler(s) you are using -to determine the appropriate switches for your setup. +Examples: +--------- + +1.) gcc with a Pentium 4 + + ./configure <blablabla> \ + CFLAGS="-march=pentium4 -mfpmath=sse" \ + FFLAGS="-march=pentium4 -mfpmath=sse" + make + make install + +or (assuming a Bourne-shell) + + CFLAGS="-march=pentium4 -mfpmath=sse" + FFLAGS="-march=pentium4 -mfpmath=sse" + export CFLAGS FFLAGS + + ./configure <blablabla> + make + make install + +or -NOTE: if you use the CFLAGS-variable, then it's value will be prepended -to the compiler flags at built-time. So using e.g. + ./configure <blablabla> + make CFLAGS="-march=pentium4 -mfpmath=sse" \ + FFLAGS="-march=pentium4 -mfpmath=sse" + make install -make CFLAGS="-O3 -funroll-all-loops -g0" ALBERT_DEBUG_CFLAGS="-ggdb" +2.) Pentium 4 with icc and with Intel "math kernel library" (BLAS +implementation) -will result in '-O3 -funroll-all-loops -g0 -ggdb' for the -debug-enabled libraries. This might not be quite the thing you were -aiming at. + ./configure <blablabla> \ + CC=icc CFLAGS="-mcpu=pentium4" ALBERA_OPTIMISE_CFLAGS="-O3" \ + ALBERTA_DEBUG_CFLAGS="-O0 -g" \ + F77=ifc FFLAGS="-mcpu=pentum4 -O3" \ + --with-blas-name=mkl --with-blas-lib=/opt/intel/mkl61/lib/32/ + make + make install -You still can use CFLAGS to set compiler flags used for both, -optimising and debug-enabled objects. +or set environment variables or use arguments to "make" as shown in +example 1.) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- GitLab