[Patches] darwin known-architectures file for XLF
Steve White
steve.white at aei.mpg.de
Fri Apr 7 09:28:34 CDT 2006
Hi again,
Attached is a patch for the known-architectures file for Darwin for
the XLF compiler.
Primarily it is to improve the speed, by making the optimization
options to be
-O3 -qhot -qarch=auto -qtune=auto -qcache=auto
This gets quite good performance, but moves instructions. The various
"auto's" cause the compiler to generate optimal code for the platform
on which the compiler is running.
Also, I made it supress the congratulatory message ("Yay, I compiled").
Also, I test the compiler version major and minor numbers so that darned
"-no-cpp-precomp" option is included only when the version is less than
3.3.
Cheers!
--
Steve White : Programmer
Max-Planck-Institut für Gravitationsphysik Albert-Einstein-Institut
Am Mühlenberg 1, D-14476 Golm, Germany +49-331-567-7625
-------------- next part --------------
Index: darwin
===================================================================
RCS file: /cactusdevcvs/Cactus/lib/make/known-architectures/darwin,v
retrieving revision 1.14
diff -u -r1.14 darwin
--- darwin 2 Feb 2006 16:50:18 -0000 1.14
+++ darwin 7 Apr 2006 14:23:05 -0000
@@ -70,8 +70,12 @@
CXX_DEPEND='$(CXX) -M $(CPPFLAGS)'
elif test -e '/usr/lib/gcc/darwin/3.3' ; then
# This is dangerous -- it could pick up the wrong gcc
- C_DEPEND='gcc -M -no-cpp-precomp $(CPPFLAGS)'
- CXX_DEPEND='g++ -E -M $(CPPFLAGS)'
+ if MAC_C_VERSION_MAJOR < 4 && MAC_C_VERSION_MINOR < 3 ; then
+ C_DEPEND='gcc -M -no-cpp-precomp $(CPPFLAGS)'
+ else
+ C_DEPEND='gcc -M $(CPPFLAGS)'
+ fi
+ CXX_DEPEND='g++ -E -M $(CPPFLAGS)'a
else
C_DEPEND='$(PERL) $(CCTK_HOME)/lib/sbin/cpp.pl -M $(CPPFLAGS)'
CXX_DEPEND='$(PERL) $(CCTK_HOME)/lib/sbin/cpp.pl -M $(CPPFLAGS)'
@@ -125,7 +129,11 @@
case "$MAC_C_COMP" in
gcc)
CC_VERSION="`$CC --version 2>&1 | head -n 1`"
- : ${CFLAGS="-no-cpp-precomp -mlongcall"}
+ if MAC_C_VERSION_MAJOR < 4 && MAC_C_VERSION_MINOR < 3 ; then
+ : ${CFLAGS="-no-cpp-precomp -mlongcall"}
+ else
+ : ${CFLAGS="-mlongcall"}
+ fi
;;
*)
:
@@ -135,7 +143,11 @@
case "$MAC_CXX_COMP" in
gcc)
CXX_VERSION="`$CXX --version 2>&1 | head -n 1`"
- : ${CXXFLAGS="-no-cpp-precomp -mlongcall"}
+ if MAC_C_VERSION_MAJOR < 4 && MAC_C_VERSION_MINOR < 3 ; then
+ : ${CXXFLAGS="-no-cpp-precomp -mlongcall"}
+ else
+ : ${CXXFLAGS="-mlongcall"}
+ fi
;;
*)
:
@@ -161,7 +173,8 @@
absoft77)
: ${LIBS='fio f77math m'}
F90FLAGS='-f'
- # Test if it is a version of the absoft compiler which has the library in a custom place.
+ # Test if it is a version of the absoft compiler which has the library
+ # in a custom place.
if test -n "$ABSOFT" ; then
: ${LIBDIRS='$(ABSOFT)/lib'}
fi
@@ -186,10 +199,14 @@
fi
# : ${LIBDIRS='/opt/ibmcmp/lib'}
# : ${ARFLAGS='-rucs'}
- : ${F90FLAGS='-qspill=10000 -qmaxmem=-1 -qnullterm -qsuffix=f=f'}
- : ${F77FLAGS='-qmaxmem=-1 -qnullterm -qsuffix=f=f'}
- : ${F90_OPTIMISE_FLAGS='-O5'}
- : ${F77_OPTIMISE_FLAGS='-O5'}
+ # suppress congratulatory message on successful compilation
+ : ${F90FLAGS='-qnullterm -qsuffix=f=f -qsuppress=1501-510:cmpmsg'}
+ : ${F77FLAGS='-qnullterm -qsuffix=f=f -qsuppress=1501-510:cmpmsg'}
+ # -O3 -qhot moves some instructions...but improves speed
+ # -qarch etc optimises for the architecture on which code
+ # is compiled
+ : ${F90_OPTIMISE_FLAGS='-O3 -qhot -qarch=auto -qtune=auto -qcache=auto'}
+ : ${F77_OPTIMISE_FLAGS='-O3 -qhot -qarch=auto -qtune=auto -qcache=auto'}
: ${F90_SUFFIX='f'}
CCTK_WriteLine make.arch.defn 'F90FLAGS += $(DARWIN_$(subst .,,$(suffix $<))_FLAGS)'
More information about the Patches
mailing list