Update ubuntu.cfg

Issue #1184 closed
Erik Schnetter created an issue

I suggest to update ubuntu.cfg:

  • remove some outdated comments
  • consolidate Fortran line length options
  • add -ffast-math
  • correct Fortran OpenMP flag
  • move -rdynamic to LDFLAGS
  • add -Wall

    $ svn diff ubuntu.cfg Index: ubuntu.cfg =================================================================== --- ubuntu.cfg (revision 1854) +++ ubuntu.cfg (working copy) @@ -19,38 +19,32 @@

    CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK FPPFLAGS = -traditional -# no -msse3 -CFLAGS = -g3 -march=native -std=gnu99 -rdynamic -CXXFLAGS = -g3 -march=native -std=gnu++0x -rdynamic +CFLAGS = -g3 -march=native -std=gnu99 +CXXFLAGS = -g3 -march=native -std=gnu++0x F77FLAGS = -g3 -march=native -fcray-pointer -ffixed-line-length-none -F90FLAGS = -g3 -march=native -fcray-pointer -ffixed-line-length-none -LDFLAGS = +F90FLAGS = -g3 -march=native -fcray-pointer -ffixed-line-length-none -ffree-line-length-none +LDFLAGS = -rdynamic

    -LIBDIRS =
    +LIBDIRS =

    C_LINE_DIRECTIVES = yes F_LINE_DIRECTIVES = yes

    -# -check-uninit fails for asm output operands DEBUG = no CPP_DEBUG_FLAGS = -DCARPET_DEBUG FPP_DEBUG_FLAGS = -DCARPET_DEBUG C_DEBUG_FLAGS = -O0 CXX_DEBUG_FLAGS = -O0 -F77_DEBUG_FLAGS = -O0 -ffixed-line-length-none -F90_DEBUG_FLAGS = -O0 -ffree-line-length-none +F77_DEBUG_FLAGS = -O0 +F90_DEBUG_FLAGS = -O0

    -# On Abe, the options -O3, -xT, and -ip lead to segmentation faults -# near MPI calls -# With Intel 9, using -ip prevents debug information for local variables -# With Intel 9, using -O3 leads to very long compile times (> 45 minutes) OPTIMISE = yes CPP_OPTIMISE_FLAGS = -DKRANC_VECTORS # -DCARPET_OPTIMISE -DNDEBUG FPP_OPTIMISE_FLAGS = # -DCARPET_OPTIMISE -DNDEBUG -C_OPTIMISE_FLAGS = -O2 -CXX_OPTIMISE_FLAGS = -O2 -F77_OPTIMISE_FLAGS = -O2 -F90_OPTIMISE_FLAGS = -O2 +C_OPTIMISE_FLAGS = -O2 -ffast-math +CXX_OPTIMISE_FLAGS = -O2 -ffast-math +F77_OPTIMISE_FLAGS = -O2 -ffast-math +F90_OPTIMISE_FLAGS = -O2 -ffast-math

    PROFILE = no CPP_PROFILE_FLAGS = @@ -62,21 +56,23 @@

    OPENMP = no CPP_OPENMP_FLAGS = -fopenmp -FPP_OPENMP_FLAGS = -D_OPENMP +FPP_OPENMP_FLAGS = -fopenmp C_OPENMP_FLAGS = -fopenmp CXX_OPENMP_FLAGS = -fopenmp F77_OPENMP_FLAGS = -fopenmp F90_OPENMP_FLAGS = -fopenmp

    WARN = yes -CPP_WARN_FLAGS = -FPP_WARN_FLAGS = -C_WARN_FLAGS = -CXX_WARN_FLAGS = -F77_WARN_FLAGS = -F90_WARN_FLAGS = +CPP_WARN_FLAGS = -Wall +FPP_WARN_FLAGS = -Wall +C_WARN_FLAGS = -Wall +CXX_WARN_FLAGS = -Wall +F77_WARN_FLAGS = -Wall +F90_WARN_FLAGS = -Wall

    -MPI_DIR = /usr + + +MPI_DIR = /usr MPI_INC_DIRS = /usr/include/mpich2 MPI_LIB_DIRS = /usr/lib MPI_LIBS = mpich fmpich mpl

Keyword:

Comments (11)

  1. Roland Haas
    • changed status to open
    • removed comment

    Changes look fine to me. Only change that might change output values seems to be adding -ffast-math (which is what we use for all intel compiler options though so should also be fine).

  2. Frank Löffler
    • removed comment

    Given that this list is close to the Debian options which I maintain: why is -ffast-math added? Is there a performance increase? How large is it? I am reluctanct to use it. I would rather have the default intel compiler options to be more accurate.

  3. Frank Löffler
    • removed comment

    In other words: I would rather have a more accurate than a faster default - and this is what ubuntu.cfg is. Options for specific machines might be more aggressive when they are tested to be ok and users can always overwrite it anyway.

  4. Erik Schnetter reporter
    • removed comment

    -ffast-math is only one of the changes. The other changes should be applied nevertheless. In particular:

    • the outdated comments should be removed
    • -rdynamic is a linker option, and should not be passed to the compiler
    • the OpenMP options should be corrected
    • Fortran line length specifications have nothing to do with debugging
    • -Wall should really be the default
  5. Ian Hinder
    • removed comment

    Enabling -ffast-math in something very similar to ubuntu.cfg gave several testsuite failures for me. This suggests that either the tolerances are too strict, or that GCC was enabling some optimisations which we haven't had to deal with before.

  6. Frank Löffler
    • changed status to resolved
    • removed comment

    We've worked quite a bit on this config since the last activity here. I believe it is good as it is now. If you disagree, please reopen the bug report.

  7. Log in to comment