From 5f0d91bc848b193b3ed0fafec11b4acc887ec3b1 Mon Sep 17 00:00:00 2001 From: schnetter Date: Sat, 19 Jan 2008 13:43:41 +0000 Subject: Don't optimise for a particular processor architecture by default. Instead use just "-O2 -ip", which should work on every platform. Enable C99 language support by default. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4441 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/known-architectures/linux | 45 +++++++++++++------------------------- 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'lib/make/known-architectures/linux') diff --git a/lib/make/known-architectures/linux b/lib/make/known-architectures/linux index f9c437c8..3f3bd883 100644 --- a/lib/make/known-architectures/linux +++ b/lib/make/known-architectures/linux @@ -270,37 +270,19 @@ else i?86 | x86_64) # add the necessary libraries according to the compiler version if test "`$F90 -V 2>&1 | grep Version | sed 's/.*Version //' | sed 's/\..*//'`" -ge 8; then - if test "`$F90 -V 2>&1 | grep EM64T`"; then -# TR: '-xP' only works on Intel EMT64 processors, not on Opterons -# Since they cannot be distinguished, I commented out this -# optimization option for now. -# intel_p4_opt_flag='-xP' - intel_p4_opt_flag='' - else - intel_p4_opt_flag='-xN' - fi : ${LIBS='ifcore imf svml m'} else - intel_p4_opt_flag='-xW' : ${LIBS='intrins IEPCF90 F90 imf svml m irc cxa cprts cxa pthread'} fi - - # check if the processor is a Pentium4 (ie. supports SSE2 instructions) - default_intel_fopt_flags='-O3 -ip' - if test "`grep -w flags /proc/cpuinfo 2>&1 | grep -w sse2`"; then - default_intel_fopt_flags="-O2 $intel_p4_opt_flag -ip" - fi - - # add the libpath if the linker is not Intel + # add the libpath + : ${LIBDIRS="$intel_dir/lib"} + # add the linker script if the linker is not Intel if test `basename $LD` != 'icc' -a `basename $LD` != 'icpc' ; then - : ${LIBDIRS="$intel_dir/lib"} : ${LDFLAGS="-Qy $intel_dir/lib/icrt.link"} fi ;; ia64) - default_intel_fopt_flags='-O2 -ip' - # add the necessary libraries according to the compiler version if test "`$F90 -V 2>&1 | grep Version | sed 's/.*Version //' | sed 's/\..*//'`" -ge 8; then : ${LIBS='ifcore dl imf m'} @@ -317,8 +299,10 @@ else echo "Don't know compiler options for cpu $host_cpu" ;; esac - : ${F77_OPTIMISE_FLAGS="$default_intel_fopt_flags"} - : ${F90_OPTIMISE_FLAGS="$default_intel_fopt_flags"} + # Be conservative about the default optimisation options; the + # user can always override them + : ${F77_OPTIMISE_FLAGS="-O2 -ip"} + : ${F90_OPTIMISE_FLAGS="-O2 -ip"} F77_VERSION="`$F77 -V 2>&1 | grep -i version | head -n1`" F90_VERSION="`$F90 -V 2>&1 | grep -i version | head -n1`" ;; @@ -359,24 +343,25 @@ else case `basename $CC` in # GNU gcc | cc) - : ${CFLAGS='-pipe'} + : ${CFLAGS='-pipe -std=gnu99'} : ${C_OPTIMISE_FLAGS='-O3'} CC_VERSION="`$CC -v 2>&1 | grep -i version | head -n1`" ;; # Intel [ei]cc) + icc_version=`$CC -V 2>&1 | grep Version | sed 's/.*Version //' | cut -c1` if test "$OPTIMISE" = 'no'; then - : ${CFLAGS='-O0 -restrict'} + icc_opt='-O0' else - : ${CFLAGS='-restrict'} + icc_opt='' fi - if test "$host_cpu" = 'ia64' -o "$host_cpu" = 'x86_64'; then - : ${C_OPTIMISE_FLAGS='-O2 -ip'} + if test $icc_version -ge 8; then + icc_c99='-std=gnu99' else - : ${C_OPTIMISE_FLAGS='-O3 -ip'} + icc_c99='-c99' fi + : ${CFLAGS="$icc_opt $icc_c99"} : ${C_DEPEND='$(CC) -M $(CPPFLAGS)'} - icc_version=`$CC -V 2>&1 | grep Version | sed 's/.*Version //' | cut -c1` if test $icc_version -ge 8; then c_warn_flags='-Wall -w1 -Wcheck' else -- cgit v1.2.3