#!/bin/sh #**************************************************************************** #* TAU Portable Profiling Package ** #* http://www.cs.uoregon.edu/research/tau ** #**************************************************************************** #* Copyright 1997-2009 ** #* Department of Computer and Information Science, University of Oregon ** #* Advanced Computing Laboratory, Los Alamos National Laboratory ** #* Research Center Juelich, ZAM Germany ** #**************************************************************************** #* #* Permission to use, copy, modify, and distribute this software and its #* documentation for any purpose and without fee is hereby granted, #* provided that the above copyright notice appear in all copies and that #* both that copyright notice and this permission notice appear in #* supporting documentation, and that the name of University of Oregon (UO) #* and Los Alamos National Laboratory (LANL) not be #* used in advertising or publicity pertaining to distribution of #* the software without specific, written prior permission. The #* University of Oregon and LANL makes no representations about the #* suitability of this software for any purpose. It is provided "as is" #* without express or implied warranty. #* #* THE UNIVERSITY OF OREGON AND LANL DISCLAIMS ALL WARRANTIES WITH REGARD TO #* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND #* FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF OREGON OR LANL BE LIABLE FOR #* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER #* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF #* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN #* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #**************************************************************************** default=false for arg in "$@"; do case $arg in default) default=true ;; -help) echo "TAU Configuration Utility " echo "***********************************************************************" echo "Usage: configure [OPTIONS]" echo " where [OPTIONS] are:" echo "" echo "Compiler Options:" echo "-c++= ............................ specify the C++ compiler." echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|pgcpp|FCC|guidec++|aCC|c++|ecpc|" echo " g++4|icpc|scgcc|scpathCC|pathCC|orCC]." echo "-cc= ................................ specify the C compiler." echo " options [cc|gcc|gcc4|scgcc|KCC|pgcc|guidec|*xlc*|ecc|pathcc|orcc]." echo "-fortran= ..................... specify the Fortran compiler." echo " options [gnu|sgi|ibm|ibm64|hp|cray|pgi|absoft|fujitsu|sun|compaq|" echo " g95|open64|kai|nec|hitachi|intel|absoft|lahey|nagware|pathscale}" echo " gfortran|gfortran4]" echo "-pdt= ........ Specify location of PDT (Program Database Toolkit)." echo "-pdt_c++= ............ specify a different PDT C++ compiler." echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|pgcpp|FCC|guidec++|aCC|c++|ecpc|" echo " g++4|icpc|scgcc|pathCC|orCC]." echo "-useropt='' ....... arguments to compilers (defaults to -g -O2)." echo "" echo "Installation Options:" echo "-prefix= ................ Specify a target installation directory." echo "-exec-prefix= .......... Specify a target architecture directory." echo "-arch= ................... Specify a target architecture." echo " options [xt3|craycnl|bgp|bgl|ibm64|ibm64linux|sunx86_64" echo " crayxmt|solaris2-64|mips32|sgin32|sgi64|sgio32]" echo "" echo "MPI Options:" echo "-mpi .......................... Specify use of TAU MPI wrapper library." echo "-mpiinc= ............. Specify location of MPI include dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-mpilib= ............. Specify location of MPI library dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-mpilibrary= ................ Specify a different MPI library." echo " e.g., -mpilibrary=-lmpi_r " echo "" echo "OpenMP Options:" echo "-openmp ........................................... Use OpenMP threads." echo "-opari ..................................................... Use Opari." echo "-opari_region ......... Report performance data for all OpenMP regions." echo "-opari_construct ... Report performance data for all OpenMP constructs." echo "" echo "SHMEM Options:" echo "-shmem ...................... Specify use of TAU SHMEM wrapper library." echo "-shmeminc= ......... Specify location of SHMEM include dir and use" echo " the TAU SHMEM Profiling and Tracing Interface." echo "-shmemlib= ......... Specify location of SHMEM library dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-shmemlibrary= ............ Specify a different SHMEM library." echo " e.g., -shmemlibrary=-lsmac " echo "" echo "Other Options:" echo "-iowrapper .................................... Build POSIX IO Wrapper." echo "-pthread .................................. Use pthread thread package." echo "-papithread .................................. Use PAPI thread package." echo "-papi= ............... Specify location of PAPI (Performance API)." echo "-jdk= Build a library for profiling Java code with specified jdk." echo "-vtf= ......... Specify location of VTF3 Trace Generation Package." echo "-otf= ....... Specify location of Open Trace Format (OTF) Package." echo "-nocomm ........ Disable tracking communication events in MPI library." echo "-hpctoolkit-src-dir= .......... Specify patched HPCToolkit source." echo "-hpctoolkit-install-dir= . Specify patched HPCToolkit Install dir." echo "-scalasca= ................ Specify location of SCALASCA package." echo "-epilog= ............ Specify location of EPILOG Tracing package." echo "-epiloglib= ........... Specify full path to EPILOG lib directory." echo "-epilogbin= ........... Specify full path to EPILOG bin directory." echo "-epiloginc= ....... Specify full path to EPILOG include directory." echo "-vampirtrace= .. Specify location of VampirTrace Tracing package." echo "-scorep= ........................ Specify location of SCOREP package." echo "-python .. Automatically choose python options based on Python in path." echo "-pythoninc= ........ Specify location of Python include directory." echo "-pythonlib= ............ Specify location of Python lib directory." echo "-tag= ........ Specify a tag to identify the installation." echo "-TRACE ..................................... Generate TAU event traces." echo "-MPITRACE ... Generate event traces for MPI events and their ancestors." echo "-PROFILE ............ Generate profiles (summary statistics) (default)." echo "-PROFILECALLPATH ......................... Generate call path profiles." echo "-PROFILEPARAM .... Generate profiles with parameter mapped event data ." echo "-PROFILEPHASE .......................... Generate phase based profiles." echo "-DEPTHLIMIT ........... Disable instrumentation beyond a certain depth." echo "-PROFILEMEMORY .. Track heap memory utilization at each function entry." echo "-PROFILEHEADROOM .. Track memory free (or headroom) at each func entry." echo "-COMPENSATE ........ Compensate for profiling measurement perturbation." echo "-BGLTIMERS .... Use fast low-overhead timers on IBM BlueGene/L systems." echo "-BGPTIMERS .... Use fast low-overhead timers on IBM BlueGene/P systems." echo "-SGITIMERS .......... Use fast nanosecond timers on SGI R10000 systems." echo "-CRAYTIMERS ............ Use fast nanosecond timers on Cray X1 systems." echo "-LINUXTIMERS ......... Use low overhead TSC Counter for wallclock time." echo "-CPUTIME .......... Use usertime+system time instead of wallclock time." echo "-PAPIWALLCLOCK ........ Use PAPI to access wallclock time. Needs -papi." echo "-PAPIVIRTUAL .......... Use PAPI for virtual (user) time calculation." echo "-INTELCXXLIBICC ......... Use Intel -cxxlib-icc option for compiling." echo "-noex .................. Use no exceptions while compiling the library." echo "-DISABLESHARED .................. Do not build libTAU.so shared object." echo "-help ...................................... display this help message." echo "-fullhelp .............................. display the full help message." echo "" echo "More advanced options are available, use -fullhelp to see them." exit ;; -fullhelp) echo "TAU Configuration Utility " echo "***********************************************************************" echo "Usage: configure [OPTIONS]" echo " where [OPTIONS] are:" echo "-c++= ............................ specify the C++ compiler." echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|pgcpp|FCC|guidec++|aCC|c++|ecpc|" echo " g++4|icpc|scgcc|scpathCC|pathCC|orCC]." echo "-cc= ................................ specify the C compiler." echo " options [cc|gcc|gcc4|scgcc|KCC|pgcc|guidec|*xlc*|ecc|pathcc|orcc]." echo "-fortran= ..................... specify the Fortran compiler." echo " options [gnu|sgi|ibm|ibm64|hp|cray|pgi|absoft|fujitsu|sun|compaq|" echo " g95|open64|kai|nec|hitachi|intel|absoft|lahey|nagware|pathscale}" echo " gfortran|gfortran4]" echo "-pdt= ........ Specify location of PDT (Program Database Toolkit)." echo "-pdt_c++= ............ specify a different PDT C++ compiler." echo " options [CC|KCC|g++|*xlC*|cxx|pgCC|pgcpp|FCC|guidec++|aCC|c++|ecpc|" echo " g++4|icpc|scgcc|pathCC|orCC]." echo "-pdtcompdir= . specify a different PDT compiler directory." echo "-pdtarchdir= . specify a different PDT architecture directory." echo "-useropt='' ....... arguments to compilers (defaults to -g -O2)." echo "-extrashlibopts='' ...... arguments for building libTAU.so." echo "-prefix= ................ Specify a target installation directory." echo "-exec-prefix= .......... Specify a target architecture directory." echo "-arch= ................... Specify a target architecture." echo " options [xt3|craycnl|bgp|bgl|ibm64|ibm64linux|sunx86_64" echo " crayxmt|solaris2-64|mips32|sgin32|sgi64|sgio32]" echo "-iowrapper .................................... Build POSIX IO Wrapper." echo "-pthread .................................. Use pthread thread package." echo "-papithread .................................. Use PAPI thread package." echo "-charm= .............................. Use charm++ thread package." echo "-sproc .................................. Use SGI sproc thread package." echo "-openmp ........................................... Use OpenMP threads." echo "-opari ..................................................... Use Opari." echo "-opari_region ......... Report performance data for all OpenMP regions." echo "-opari_construct ... Report performance data for all OpenMP constructs." echo "-papi= ............... Specify location of PAPI (Performance API)." echo "-pdt= ........ Specify location of PDT (Program Database Toolkit)." echo "-jdk= Build a library for profiling Java code with specified jdk." echo "-dyninst= ................... Specify location of DynInst Package." echo "-dwarf= ................ Specify location of the libdwarf Package." echo "-vtf= ......... Specify location of VTF3 Trace Generation Package." echo "-otf= ....... Specify location of Open Trace Format (OTF) Package." echo "-mpi .......................... Specify use of TAU MPI wrapper library." echo "-mpiinc= ............. Specify location of MPI include dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-mpilib= ............. Specify location of MPI library dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-mpilibrary= ................ Specify a different MPI library." echo " e.g., -mpilibrary=-lmpi_r " echo "-shmem ...................... Specify use of TAU SHMEM wrapper library." echo "-shmeminc= ......... Specify location of SHMEM include dir and use" echo " the TAU SHMEM Profiling and Tracing Interface." echo "-shmemlib= ......... Specify location of SHMEM library dir and use" echo " the TAU MPI Profiling and Tracing Interface." echo "-shmemlibrary= ............ Specify a different SHMEM library." echo " e.g., -shmemlibrary=-lsmac " echo "-nocomm ........ Disable tracking communication events in MPI library." echo "-hpctoolkit-src-dir= .......... Specify patched HPCToolkit source." echo "-hpctoolkit-install-dir= . Specify patched HPCToolkit Install dir." echo "-scalasca= ................ Specify location of SCALASCA package." echo "-epilog= ............ Specify location of EPILOG Tracing package." echo "-epiloglib= ........... Specify full path to EPILOG lib directory." echo "-epilogbin= ........... Specify full path to EPILOG bin directory." echo "-epiloginc= ....... Specify full path to EPILOG include directory." echo "-vampirtrace= .. Specify location of VampirTrace Tracing package." echo "-scorep= ........................ Specify location of SCOREP package." echo "-upcnetwork= .. Specify network (mpi, udp,...) for Berkeley UPC." echo "-python .. Automatically choose python options based on Python in path." echo "-pythoninc= ........ Specify location of Python include directory." echo "-pythonlib= ............ Specify location of Python lib directory." echo "-tag= ........ Specify a tag to identify the installation." echo "-perfinc= ............. Specify a Perflib[LANL] include directory." echo "-perflib= ................. Specify a Perflib[LANL] lib directory." echo "-perflibrary= ... Specify a different perflib runtime library." echo "-ktau ........................................... Kernel TAU Profiling." echo "-ktau_shctr ........................ Kernel TAU Profiling with shared- " echo " OS counters support." echo "-ktauinc= ............... Specify location of Linux Kernel source." echo "-ktauincuser= ............... Specify location of KTAU user incls." echo "-ktaulib= ............ Specify location of KTAU library libktau.a." echo "-ktausym= ...... Specify location of Linux Kernel." echo " Symbol Table." echo "-stff= .... Location of RENCI Scalable Time-series filter library." echo "-sddf= ...... SDDF library location; Only required for RENCI STFF." echo "-TRACE ..................................... Generate TAU event traces." echo "-MPITRACE ... Generate event traces for MPI events and their ancestors." echo "-PROFILE ............ Generate profiles (summary statistics) (default)." echo "-PROFILECALLPATH ......................... Generate call path profiles." echo "-PROFILEPARAM .... Generate profiles with parameter mapped event data ." echo "-PROFILEPHASE .......................... Generate phase based profiles." echo "-DEPTHLIMIT ........... Disable instrumentation beyond a certain depth." echo "-PROFILEMEMORY .. Track heap memory utilization at each function entry." echo "-PROFILEHEADROOM .. Track memory free (or headroom) at each func entry." echo "-COMPENSATE ........ Compensate for profiling measurement perturbation." echo "-BGLTIMERS .... Use fast low-overhead timers on IBM BlueGene/L systems." echo "-BGPTIMERS .... Use fast low-overhead timers on IBM BlueGene/P systems." echo "-SGITIMERS .......... Use fast nanosecond timers on SGI R10000 systems." echo "-CRAYTIMERS ............ Use fast nanosecond timers on Cray X1 systems." echo "-LINUXTIMERS ......... Use low overhead TSC Counter for wallclock time." echo "-CPUTIME .......... Use usertime+system time instead of wallclock time." echo "-PAPIWALLCLOCK ........ Use PAPI to access wallclock time. Needs -papi." echo "-PAPIVIRTUAL .......... Use PAPI for virtual (user) time calculation." echo "-INTELCXXLIBICC ......... Use Intel -cxxlib-icc option for compiling." echo "-noex .................. Use no exceptions while compiling the library." echo "-DISABLESHARED .................. Do not build libTAU.so shared object." echo "-zeptodir= ............................. ZeptoOS install location." echo " See http://www-unix.mcs.anl.gov/zeptoos/." echo "-help ...................................... display this help message." echo "-fullhelp .............................. display the full help message." exit ;; esac done # this causes `make install` to clean, since configure has been run rm -f .clean if [ $default = false ] ; then rm -f .last_config fi # This method will escape spaces so that you can use ./configure `cat .last_config` when you've used them for arg in "$@"; do # Thanks to Bernd Mohr for the following that handles quotes and spaces # -e 's/^x//' removes the x at the start # -e 's/"/\\\"/g' replaces " with \" # -e s,\',%@%\',g replaces ' with %@%' # -e 's/%@%/\\\/g' replaces %@% \ # -e 's/ /\\\ /g' replaces space with \space modarg=`echo "x$arg" | sed -e 's/^x//' -e 's/"/\\\"/g' -e s,\',%@%\',g -e 's/%@%/\\\/g' -e 's/ /\\\ /g'` modargs="$modargs $modarg" done if [ $default = false ] ; then # echo "configured with:" # echo "" # echo "$modargs" # echo "" echo "$modargs" >> .all_configs echo "$modargs" > .last_config fi # test if we're using the bash shell usingbash=no readlink=`which readlink` if [ "x$readlink" != "x" ] ; then if [ -x "$readlink" ] ; then symlink=`readlink /bin/sh` if [ "x$symlink" = "xbash" ] ; then usingbash=yes fi fi fi # write tau_config.h that's used as meta-data containing the TAU configuration if [ "$usingbash" = "yes" ] ; then modmodargs=`echo "x$modargs" | sed -e 's/^x//' -e 's#\\\#\\\\\\\\#g'` else modmodargs=`echo "x$modargs" | sed -e 's/^x//' -e 's#\\\#\\\\\\\\\\\#g'` fi echo "#define TAU_CONFIG \"$modmodargs\"" > include/tau_config.h START_DIR=`pwd` # Default compilers and options c_compiler=default cxx_compiler=default pdt_cxx_compiler=default fixmakeargs="" useropt=-g#-O2 tag=no tautag= orig_useropt="-g -O2" mpi=no mpi2=no mpiio=no mpiinc= mpilib= mpilibrary=no mrnet=no mrnet_root= mrnet_lib= ibmmpi=no shmem=no shmeminc= shmemlib= shmemlibrary=no threadsafe=no additional_mpiincs= additional_mpilibs= extra_linker_args= pythoninc= pythonlib= python=no sicortex=no extradir= extrashlibopts= pthread=no papithread=no papipfm=no papiperfctr=no papisubdir= charm=no comm=yes sproc=no noex=no disableshared=no setnode0=no compensate=no smarts=no papi=no perfsuite=no perfsuitedir= bfd=no bfddir= perf=no perfincdir= perflibdir= perflibrary= tcltk=yes tcltkfile="/" kai=no pgi=no fujitsu=no guidef90=no stdcxxlib=no intelcxxlibicc=no intelifort=no intel=no gnu=no profile=no profilestats=no profilememory=no profileheadroom=no callpath=no profileparam=no depthlimit=no phase=no trace=no mpitrace=no debugprof=no bgltimers=no bgptimers=no sgitimers=no craytimers=no linuxtimers=no alphatimers=no cputime=no papiwallclock=no papivirtual=no use_ansic=no tauarch=unknown pdtcompdir=unknown pdtarchdir=unknown tauprefix=unknown execprefix=unknown taugcclibdir=unknown tautoplevel= tauoptions= pdt_root_dir="." pdt=no vtf=no otf=no opari=no epilog=no hpctoolkit=no hpctoolkit_src_dir= hpctoolkit_install_dir= scalasca=no scoreplibs= scorep=no epilogextralinkcmd= epiloglib=no epilogbin=no epiloginc=no epilogdir=no epiloglibdir=no epilogbindir=bin epilogincdir= vampirtrace=no vampirtraceshow=no upnetwork=unknown upc=no forceshared=no opari_region=no opari_construct=no dyninst=no dwarf=no java=no openmp=no ibmxlc=no ibmxlc_r=no fortran_compiler=no ktau=no ktau_merge=no ktau_shctr=no ktauinc= ktauincuser= ktaulib= ktausym= catamount=no gpshmem=no stff=no stffdir= sddf=no sddfdir= iowrapper=no zepto=no zeptodir= # Reset include/Makefile before starting anything else for i in include/Makefile ; do sed -f utils/FixMakefile.sed.default < ${i} > ${i}~~0 mv ${i}~~0 ${i} done ############################################################### # PARSE OPTIONS ############################################################### for arg in "$@"; do case $arg in -cc=*) myarg=`echo $arg | sed 's/-cc=//'` if [ $myarg = cc -o $myarg = gcc -o $myarg = gcc4 -o $myarg = KCC -o $myarg = pgcc -o $myarg = guidec -o $myarg = xlc -o $myarg = ecc -o $myarg = icc -o $myarg = powerpc64-linux-gcc -o $myarg = pathcc -o $myarg = fcc -o $myarg = orcc -o $myarg = qk-pgcc -o $myarg = scgcc -o $myarg = scpathcc -o $myarg = mips64el-gentoo-linux-gnu-gcc -o $myarg = powerpc-bgp-linux-gcc ] then c_compiler=$myarg else testxlc=`echo $myarg | sed -e 's/xlc//'` testmp=`echo $myarg | sed -e 's/^mp//'` if [ "y$testxlc" = "y$myarg" -a "y$testmp" = "y$myarg" ] then echo "WARNING: valid options for cc are 'cc', 'gcc', 'gcc4', 'KCC', 'guidec', '*xlc*', 'ecc', 'icc', 'pathcc', 'fcc', 'orcc', 'qk-pgcc', 'powerpc-bgp-linux-gcc', and 'pgcc' " # exit 1 else if [ "y$testxlc" != "y$myarg" ] then c_compiler=$myarg else c_compiler=`$myarg -show | awk '{ print $1; }'` fi fi fi shift ;; -c++=*) myarg=`echo $arg | sed 's/-c++=//'` if [ $myarg = CC -o $myarg = KCC -o $myarg = g++ -o $myarg = g++4 -o $myarg = cxx -o $myarg = NCC -o $myarg = pgCC -o $myarg = pgcpp -o $myarg = egcs -o $myarg = FCC -o $myarg = guidec++ -o $myarg = aCC -o $myarg = c++ -o $myarg = ecpc -o $myarg = icpc -o $myarg = powerpc64-linux-g++ -o $myarg = pathCC -o $myarg = orCC -o $myarg = qk-pgCC -o $myarg = scg++ -o $myarg = scpathCC -o $myarg = mips64el-gentoo-linux-gnu-g++ -o $myarg = powerpc-bgp-linux-g++ -o $myarg = mpicxx ] then cxx_compiler=$myarg else testxlc=`echo $myarg | sed -e 's/xl//'` testmp=`echo $myarg | sed -e 's/^mp//'` if [ "y$testxlc" = "y$myarg" -a "y$testmp" = "y$myarg" ] then echo "WARNING: valid options for c++ are 'CC', 'KCC', 'g++', 'g++4', '*xlC*', 'cxx' , 'NCC', 'egcs', 'pgCC', 'pgcpp', 'FCC', 'guidec++', 'aCC', 'ecpc', 'icpc', 'pathCC', 'c++', 'qk-pgCC', and 'orCC'" # exit 1 else if [ "y$testxlc" != "y$myarg" ] then cxx_compiler=$myarg else cxx_compiler=`$myarg -show | awk '{ print $1; }'` fi fi fi shift ;; -pdt_c++=*) pdt_cxx_full_path=`echo $arg | sed 's@-pdt_c++=@@g'` myarg=`echo $arg | echo $arg | sed 's@-pdt_c++=@@g' | sed 's@.*/@@g'` if [ $myarg = CC -o $myarg = KCC -o $myarg = g++ -o $myarg = g++4 -o $myarg = cxx -o $myarg = NCC -o $myarg = pgCC -o $myarg = pgcpp -o $myarg = egcs -o $myarg = FCC -o $myarg = guidec++ -o $myarg = aCC -o $myarg = c++ -o $myarg = ecpc -o $myarg = icpc -o $myarg = powerpc64-linux-g++ -o $myarg = pathCC -o $myarg = orCC -o $myarg = qk-pgCC -o $myarg = scg++ -o $myarg = scpathCC -o $myarg = mips64el-gentoo-linux-gnu-g++ -o $myarg = powerpc-bgp-linux-g++ ] then pdt_cxx_compiler=$myarg else testxlc=`echo $myarg | sed -e 's/xl//'` if [ "y$testxlc" = "y$myarg" ] then echo "WARNING: valid options for pdt_c++ are 'CC', 'KCC', 'g++', '*xlC*', 'cxx' , 'egcs', 'pgCC', 'pgcpp', 'FCC', 'guidec++', 'aCC', 'c++', and 'orCC'" # exit 1 else pdt_cxx_compiler=$myarg fi fi shift ;; -fortran=*) myarg=`echo $arg | sed 's/-fortran=//'` if [ $myarg = gnu -o $myarg = sgi -o $myarg = ibm -o $myarg = ibm64 -o $myarg = hp -o $myarg = cray -o $myarg = pgi -o $myarg = absoft -o $myarg = fujitsu -o $myarg = sun -o $myarg = compaq -o $myarg = kai -o $myarg = hitachi -o $myarg = intel -o $myarg = nec -o $myarg = absoft -o $myarg = lahey -o $myarg = nagware -o $myarg = pathscale -o $myarg = gfortran -o $myarg = gfortran4 -o $myarg = g95 -o $myarg = open64 ] ; then if [ $myarg = gnu ] ; then fortran_compiler=gfortran else fortran_compiler=$myarg fi else echo "WARNING: valid options for fortran are 'gnu', 'sgi', 'ibm', 'ibm64', 'hp', 'cray', 'pgi', 'absoft', 'fujitsu', 'sun', 'compaq', 'kai', 'hitachi', 'intel', 'nec' , 'absoft', 'lahey', 'nagware', 'pathscale', 'gfortran', 'g95', and 'open64'" exit 1 fi shift ;; -gnu) c_compiler=gcc cxx_compiler=g++ shift ;; -dec) c_compiler=cc cxx_compiler=g++ shift ;; -ibm) c_compiler=xlc_r cxx_compiler=xlC_r shift ;; -cfront) c_compiler=cc cxx_compiler=CC shift ;; -sgi) c_compiler=cc cxx_compiler=CC shift ;; -tag=*) tag=yes tautag=`echo $arg | sed -e 's/-tag=//'` shift ;; -pthread=*) pthread=yes ptdir=`echo $arg | sed -e 's/-pthread=//'` shift ;; -pthread) pthread=yes shift ;; -papithread) papithread=yes shift ;; -iowrapper) iowrapper=yes shift ;; -charm=*) pthread=yes charm=yes charmdir=`echo $arg | sed -e 's/-charm=//'` shift ;; -COMPENSATE) compensate=yes shift ;; -forceshared) forceshared=yes fixmakeargs="$fixmakeargs FORCESHARED" shift ;; -ktau) ktau=yes shift ;; -ktau_merge) ktau_merge=no shift ;; -ktau_shctr) ktau_shctr=yes shift ;; -ktauinc=*) ktauinc=`echo $arg | sed -e 's/-ktauinc=//' -e 's/ /#/g'` if [ ! -d $ktauinc ] then echo "Error: Cannot access KTAU include directory $ktauinc" exit 1 fi shift ;; -ktauincuser=*) ktauincuser=`echo $arg | sed -e 's/-ktauincuser=//' -e 's/ /#/g'` if [ ! -d $ktauincuser ] then echo "Error: Cannot access KTAU user include directory $ktauincuser" exit 1 fi shift ;; -ktaulib=*) ktaulib=`echo $arg | sed -e 's/-ktaulib=//' -e 's/ /#/g'` if [ ! -d $ktaulib ] then echo "Error: Cannot access KTAU user lib $ktaulib" exit 1 fi shift ;; -ktausym=*) ktausym=`echo $arg | sed -e 's/-ktausym=//' -e 's/ /#/g'` if [ ! -e $ktausym ] then echo "Warning: Cannot access KTAU Linux Kernel Symbol Table $ktausym locally (Does it exist on the compute nodes?). Continuing." fi shift ;; -mrnet=*) mrnet=yes mrnet_root=`echo $arg | sed -e 's/-mrnet=//' -e 's/ /#/g'` if [ ! -e $mrnet_root ] then echo "Error: Cannot access MRNet root directory $mrnet_root" exit 1 fi shift ;; -mrnetlib=*) mrnet=yes mrnet_lib=`echo $arg | sed -e 's/-mrnetlib=//' -e 's/ /#/g'` if [ ! -e $mrnet_lib ] then echo "Error: Cannot access MRNet library directory $mrnet_lib" exit 1 fi shift ;; -nocomm) comm=no shift ;; -sproc) sproc=yes shift ;; -papi=*) papi=yes papidir=`echo $arg | sed -e 's/-papi=//'` if [ ! -d $papidir ] ; then echo "Error: Cannot access PAPI directory $papidir" exit 1 fi shift ;; -perfsuite=*) perfsuite=yes perfsuitedir=`echo $arg | sed -e 's/-perfsuite=//'` fixmakeargs="$fixmakeargs TAU_PERFSUITE" fixmakeargs="$fixmakeargs perfsuitelink=-L$perfsuitedir/lib#-lpshwpc" fixmakeargs="$fixmakeargs perfsuiteinclude=-I$perfsuitedir/include" if [ ! -d $perfsuitedir ] ; then echo "Error: Cannot access PerfSuite directory $perfsuitedir" exit 1 fi shift ;; -bfd=*) bfd=yes bfddir=`echo $arg | sed -e 's/-bfd=//'` shift ;; -perfinc=*) perf=yes perfincdir=`echo $arg | sed -e 's/-perfinc=//'` if [ ! -d $perfincdir ] then echo "Error: Cannot access PERF include directory $perfincdir" exit 1 fi shift ;; -perflib=*) perf=yes perflibdir=`echo $arg | sed -e 's/-perflib=//'` if [ ! -d $perflibdir ] ; then echo "Error: Cannot access PERF lib directory $perflibdir" exit 1 fi shift ;; -perflibrary=*) perf=yes perflibrary=`echo $arg | sed -e 's/-perflibrary=//' -e 's/ /#/g'` shift ;; -opari) opari=yes openmp=yes shift ;; -opari=*) opari=yes openmp=yes shift ;; -opari_region) opari_region=yes shift ;; -opari_construct) opari_construct=yes shift ;; -vampirtrace=*) vampirtrace=yes trace=yes vampirtracedir=`echo $arg | sed -e 's/-vampirtrace=//'` if [ ! -d $vampirtracedir ] ; then echo "Error: Cannot access VAMPIRTRACE directory $vampirtracedir" exit 1 fi shift ;; -upcnetwork=*) upc=yes upcnetwork=`echo $arg | sed -e 's/-upcnetwork=//'` shift ;; -epilog=*) epilog=yes trace=yes epilogdir=`echo $arg | sed -e 's/-epilog=//'` if [ ! -d $epilogdir ] ; then echo "Error: Cannot access EPILOG directory $epilogdir" exit 1 fi shift ;; -scalasca=*) epilog=yes trace=yes epilogdir=`echo $arg | sed -e 's/-scalasca=//'` if [ ! -d $epilogdir ] ; then echo "Error: Cannot access SCALASCA directory $epilogdir" exit 1 fi shift ;; -hpctoolkit-src-dir=*) hpctoolkit=yes hpctoolkit_src_dir=`echo $arg | sed -e 's/-hpctoolkit-src-dir=//'` if [ ! -d $hpctoolkit_src_dir ] ; then echo "Error: Cannot access HPCTOOLKIT directory $hpctoolkit_src_dir" exit 1 fi shift ;; -hpctoolkit-install-dir=*) hpctoolkit=yes hpctoolkit_install_dir=`echo $arg | sed -e 's/-hpctoolkit-install-dir=//'` if [ ! -d $hpctoolkit_install_dir ] ; then echo "Error: Cannot access HPCTOOLKIT directory $hpctoolkit_install_dir" exit 1 fi shift ;; -scorep=*) scorep=yes scorepdir=`echo $arg | sed -e 's/-scorep=//'` if [ ! -d $scorepdir ] ; then echo "Error: Cannot access SCOREP directory $scorepdir" exit 1 fi shift ;; -epiloglib=*) epilog=yes epiloglib=yes trace=yes epiloglibdir=`echo $arg | sed -e 's/-epiloglib=//'` shift ;; -epilogbin=*) epilog=yes epilogbin=yes trace=yes epilogbindir=`echo $arg | sed -e 's/-epilogbin=//'` shift ;; -epiloginc=*) epilog=yes epiloginc=yes trace=yes epilogincdir=`echo $arg | sed -e 's/-epiloginc=//'` shift ;; -pdt=*) pdt=yes pdtdir=`echo $arg | sed -e 's/-pdt=//'` if [ ! -d $pdtdir ] ; then echo "Error: Cannot access PDT directory $pdtdir" exit 1 fi shift ;; -vtf=*) vtf=yes trace=yes vtfdir=`echo $arg | sed -e 's/-vtf=//'` if [ ! -d $vtfdir ] then echo "Error: Cannot access VTF3 directory $vtfdir" exit 1 fi shift ;; -otf=*) otf=yes trace=yes otfdir=`echo $arg | sed -e 's/-otf=//'` if [ ! -d $otfdir ] then echo "Error: Cannot access OTF directory $otfdir" exit 1 fi shift ;; -dyninst=*) dyninst=yes dyninstdir=`echo $arg | sed -e 's/-dyninst=//'` if [ ! -d $dyninstdir ] then echo "Error: Cannot access DyninstAPI directory $dyninstdir" exit 1 fi shift ;; -dwarf=*) dwarf=yes dwarfdir=`echo $arg | sed -e 's/-dwarf=//'` if [ ! -d $dwarfdir ] then echo "Error: Cannot access libdwarf directory $dwarfdir" exit 1 fi shift ;; -openmp) openmp=yes shift ;; -jdk=*) java=yes jdkdir=`echo $arg | sed -e 's/-jdk=//'` if [ ! -d $jdkdir ] then echo "Error: Cannot access JDK directory $jdkdir" exit 1 fi jv=`$jdkdir/bin/java -version 2>&1 | grep version | awk '{ print $3; }'| sed -e s/\"//g` if [ `echo $jv | sed -e s/1.6\.*// | wc -c` -eq 1 ] || [ `echo $jv | sed -e s/1.7\.*// | wc -c` -eq 1 ] then echo "Error: Specify a JDK of version 1.5 or earlier" exit 1 fi shift ;; -slog2=*) trace=yes shift ;; -slog2) trace=yes shift ;; -zeptodir=*) zeptodir=`echo $arg | sed -e 's/-zeptodir=//' -e 's/ /#/g'` if [ ! -e $zeptodir ] then echo "ERROR: Cannot access the Zepto directory provided [$zeptodir]. Aborting." exit 1 fi zepto=yes disableshared=yes c_compiler=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-gcc cxx_compiler=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-g++ fortran_compiler=yes fixmakeargs="$fixmakeargs ZEPTO_GFORTRAN" shift ;; -useropt=*) # Note you might be passed -g#-O3 which becomes -g -O3 orig_useropt=`echo $arg | sed -e 's/-useropt=//' -e 's/#/ /g'` # Note you might be passed -g -O3 which becomes -g#-O3 here useropt=`echo $arg | sed -e 's/-useropt=//' -e 's/ /#/g'` shift ;; -extrashlibopts=*) # Note you might be passed -g#-O3 which becomes -g -O3 extrashlibopts=`echo $arg | sed -e 's/-extrashlibopts=//' -e 's/ /#/g'` # Note you might be passed -g -O3 which becomes -g#-O3 here shift ;; -mpi) mpi=yes shift ;; -mpiinc=*) mpi=yes mpiinc=`echo $arg | sed -e 's/-mpiinc=//' -e 's/ /#/g'` if [ ! -d $mpiinc ] ; then echo "Error: Cannot access MPI include directory $mpiinc" exit 1 fi shift ;; -mpilib=*) mpi=yes mpilib=`echo $arg | sed -e 's/-mpilib=//' -e 's/ /#/g'` if [ ! -d $mpilib ] ; then echo "Error: Cannot access MPI lib directory $mpilib" exit 1 fi shift ;; -mpilibrary=*) # you may be passed -lmpich#-L/usr/opt/gm#-lgm#-lpthread#-ldl by installtau mpilibrary=`echo $arg | sed -e 's/-mpilibrary=//' -e 's/#/ /g'` shift ;; -shmem) shmem=yes shift ;; -shmeminc=*) shmeminc=`echo $arg | sed -e 's/-shmeminc=//' -e 's/ /#/g'` if [ ! -d $shmeminc ] then echo "Error: Cannot access SHMEM include directory $shmeminc" exit 1 fi shmem=yes shift ;; -shmemlib=*) shmemlib=`echo $arg | sed -e 's/-shmemlib=//' -e 's/ /#/g'` if [ ! -d $shmemlib ] then echo "Error: Cannot access SHMEM lib directory $shmemlib" exit 1 fi shmem=yes shift ;; -shmemlibrary=*) shmemlibrary=`echo $arg | sed -e 's/-shmemlibrary=//' -e 's/ /#/g'` shmem=yes shift ;; -stff=*) stffdir=`echo $arg | sed -e 's/-stff=//' -e 's/ /#/g'` if [ ! -d $stffdir ] ; then echo "Error: couldn't find RENCI STFF library in $stffdir" exit 1 fi stff=yes shift ;; -sddf=*) sddfdir=`echo $arg | sed -e 's/-sddf=//' -e 's/ /#/g'` if [ ! -d $sddfdir ] ; then echo "Error: couldn't find sddf library in $sddfdir" exit 1 fi sddf=yes shift ;; -python) pythonbin=`which python | sed 's,[^/]*$,,'` pythoninc=`echo ${pythonbin}../include/python*` pythonlib=`echo ${pythonbin}../lib/python*` if [ ! -d $pythoninc ] ; then echo "Error: Cannot access Python include directory $pythoninc" exit 1 fi if [ ! -d $pythonlib ] ; then echo "Error: Cannot access Python lib directory $pythonlib" exit 1 fi python=yes shift ;; -pythoninc=*) pythoninc=`echo $arg | sed -e 's/-pythoninc=//' -e 's/ /#/g'` if [ ! -d $pythoninc ] then echo "Error: Cannot access Python include directory $pythoninc" exit 1 fi python=yes shift ;; -pythonlib=*) pythonlib=`echo $arg | sed -e 's/-pythonlib=//' -e 's/ /#/g'` if [ ! -d $pythonlib ] then echo "Error: Cannot access Python lib directory $pythonlib" exit 1 fi python=yes shift ;; -opt=*) useropt=`echo $arg | sed -e 's/-opt=//' -e 's/ /_/g'` shift ;; -ansic) use_ansic=yes shift ;; -PROFILE) profile=yes shift ;; -MULTIPLECOUNTERS) echo "-MULTIPLECOUNTERS is no longer necessary, all builds support multiple counters" shift ;; -PROFILECALLS) echo "-PROFILECALLS is no longer supported, try downgrading to TAU 2.18.1" exit 0 ;; -PROFILEPHASE) phase=yes shift ;; -PROFILECALLPATH) profile=yes callpath=yes shift ;; -PROFILEPARAM) profile=yes profileparam=yes shift ;; -DEPTHLIMIT) depthlimit=yes shift ;; -PROFILESTATS) echo "-PROFILESTATS is no longer supported, try downgrading to TAU 2.18.1" exit 0 ;; -PROFILEMEMORY) profile=yes profilememory=yes shift ;; -PROFILEHEADROOM) profile=yes profileheadroom=yes shift ;; -PROFILECALLSTACK) echo "-PROFILECALLSTACK is no longer supported, try downgrading to TAU 2.18.1" exit 0 ;; -TRACE) trace=yes shift ;; -MPITRACE) mpitrace=yes shift ;; -DEBUGPROF) debugprof=yes shift ;; -BGLTIMERS) bgltimers=yes shift ;; -BGPTIMERS) bgptimers=yes shift ;; -SGITIMERS) sgitimers=yes shift ;; -CRAYTIMERS) craytimers=yes shift ;; -LINUXTIMERS) linuxtimers=yes shift ;; -ALPHATIMERS) alphatimers=yes shift ;; -CPUTIME) cputime=yes shift ;; -PAPIWALLCLOCK) papiwallclock=yes shift ;; -PAPIVIRTUAL) papivirtual=yes shift ;; -INTELCXXLIBICC) intelcxxlibicc=yes shift ;; -noex) # NO exceptions to be used while building the lib. noex=yes shift ;; -DISABLESHARED) # Disable shared library creation disableshared=yes shift ;; -setnode0) # When this option is invoked, TAU sets the default node no to 0 instead # of using -1. So, profile.0.0.0 is created even if TAU_PROFILE_SET_NODE(0) # is not called in the application. Do not use with tracing setnode0=yes shift ;; -arch=*) tauarch=`echo $arg | sed -e 's/-arch=//' -e 's/ /_/g'` shift ;; -pdtcompdir=*) pdtcompdir=`echo $arg | sed -e 's/-pdtcompdir=//' -e 's/ /_/g'` shift ;; -pdtarchdir=*) pdtarchdir=`echo $arg | sed -e 's/-pdtarchdir=//' -e 's/ /_/g'` shift ;; -prefix=*) tauprefix=`echo $arg | sed -e 's/-prefix=//' -e 's/ /_/g'` fixmakeargs="$fixmakeargs tauprefix=$tauprefix" shift ;; -exec-prefix=*) execprefix=`echo $arg | sed -e 's/-exec-prefix=//' -e 's/ /_/g'` fixmakeargs="$fixmakeargs execprefix=$execprefix" shift ;; default) echo "Fixing Makefiles" ;; '') #echo "NULL switch!" # Required for HP/Compaq Tru64 machines. ;; *) echo "ERROR: Command line switch \`$arg' not recognized" 1>&2 echo "Run configure with -help to see a list of options" 1>&2 exit 1 ;; esac done # -- some functions configure_java () { taushell=sh if [ $machine = solaris2* -o $machine = alpha ] ; then taushell=ksh fi } configure_perfexplorer () { cat ${tauroot}/tools/src/perfdmf/bin/configure.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/perfdmf_configure chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_configure cat ${tauroot}/tools/src/perfdmf/bin/createapp.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/perfdmf_createapp chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_createapp cat ${tauroot}/tools/src/perfdmf/bin/createexp.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/perfdmf_createexp chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_createexp cat ${tauroot}/tools/src/perfdmf/bin/loadtrial.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/perfdmf_loadtrial chmod a+rx ${targetdir}/${architecture}/bin/perfdmf_loadtrial cat ${tauroot}/tools/src/perfdmf/bin/phaseconvert.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/phaseconvert chmod a+rx ${targetdir}/${architecture}/bin/phaseconvert cat ${tauroot}/tools/src/tau_user_setup.sh.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/tau_user_setup.sh chmod a+rx ${targetdir}/${architecture}/bin/tau_user_setup.sh # copy these files to the etc directory for tau_user_setup.sh to find and use mkdir -p ${targetdir}/etc cp ${tauroot}/tools/src/perfdmf/bin/derby.properties.skel ${targetdir}/etc cp ${tauroot}/tools/src/contrib/jython.registry ${targetdir}/etc cat ${tauroot}/tools/src/perfexplorer/bin/configure.skel | sed -e 's,@TAUROOTDIR@,'$tauroot',' \ -e 's,@SHELL@,'$taushell',' \ -e 's,@ARCH@,'$architecture',' \ -e 's,@TARGETDIR@,'$targetdir',' \ > ${tauroot}/tools/src/perfexplorer/configure chmod a+rx ${tauroot}/tools/src/perfexplorer/configure cat ${tauroot}/tools/src/perfexplorer/bin/perfexplorer_configure.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' \ -e 's,@SHELL@,'$taushell',' \ -e 's,@ARCH@,'$architecture',' \ -e 's,@TARGETDIR@,'$targetdir',' \ > ${targetdir}/${architecture}/bin/perfexplorer_configure chmod a+rx ${targetdir}/${architecture}/bin/perfexplorer_configure if [ ! -d ${targetdir}/etc ] ; then mkdir -p ${targetdir}/etc fi cp ${tauroot}/tools/src/perfexplorer/bin/perfexplorer.skel ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.derby ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.mysql ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.oracle ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.postgresql ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/dbschema.db2 ${targetdir}/etc/. cp ${tauroot}/tools/src/perfexplorer/etc/java.policy ${targetdir}/etc/. # copy PerfDMF schema files cp ${tauroot}/tools/src/perfdmf/etc/* ${targetdir}/etc/. if [ ! -d ${targetdir}/tools/src/perfdmf/etc ] ; then mkdir -p ${targetdir}/tools/src/perfdmf/etc fi cp ${tauroot}/tools/src/perfdmf/etc/dbschema*.txt ${targetdir}/tools/src/perfdmf/etc/. 2>/dev/null BINTARGET=${targetdir}/${architecture}/bin JARTARGET=${targetdir}/${architecture}/lib # install paraprof cat ${tauroot}/tools/src/paraprof/bin/paraprof.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > $BINTARGET/paraprof chmod a+rx $BINTARGET/paraprof # install ppscript cat ${tauroot}/tools/src/ppscript.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > $BINTARGET/ppscript chmod a+rx $BINTARGET/ppscript # install portal utils cat ${tauroot}/tools/src/tau_portal/bin/perfdmfdb.py.skel | sed -e 's,@BINDIR@,'$BINTARGET',' > $BINTARGET/perfdmfdb.py cat ${tauroot}/tools/src/tau_portal/bin/portal.py.skel | sed -e 's,@BINDIR@,'$BINTARGET',' > $BINTARGET/portal.py cp ${tauroot}/tools/src/tau_portal/bin/tau_portal.py $BINTARGET chmod a+rx $BINTARGET/tau_portal.py $BINTARGET/portal.py $BINTARGET/perfdmfdb.py cat ${tauroot}/tools/src/perfexplorer/bin/perfexplorer.skel | sed -e 's,@TAUROOT@,'$targetdir',' \ -e 's,@TAUSHELL@,'$taushell',' \ -e 's,@TAUARCH@,'$architecture',' \ -e 's,@RROOT@,'$rroot',' \ -e 's,@ANALYSIS_ENGINE@,'weka',' \ -e 's,@SERVER_HOSTNAME@,'$serverhostname',' \ -e 's,@SERVER_OBJECT_PORT@,'$objectport',' \ -e 's,@SERVER_RMIREGISTRY_PORT@,'$registryport',' \ -e 's,@CONFIGFILE@,'$configfile',' \ > $BINTARGET/perfexplorer chmod a+rx $BINTARGET/perfexplorer if [ ! -f $BINTARGET/jracy ] ; then cd $BINTARGET/; ln -s paraprof jracy; cd ${tauroot}; fi cp ${tauroot}/tools/src/paraprof/bin/paraprof.jar $JARTARGET cp ${tauroot}/tools/src/perfdmf/bin/perfdmf.jar $JARTARGET cp ${tauroot}/tools/src/perfexplorer/perfexplorer.jar $JARTARGET cp ${tauroot}/src/Profile/TAU.jar $JARTARGET cp ${tauroot}/tools/src/perfexplorer/perfexplorer-1.4.jar $JARTARGET cp ${tauroot}/tools/src/vis/bin/vis.jar $JARTARGET cp ${tauroot}/tools/src/common/bin/tau-common.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jargs.jar $JARTARGET cp ${tauroot}/tools/src/contrib/batik-combined.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jfreechart-1.0.12.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jcommon-1.0.15.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jgraph.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jython.jar $JARTARGET cp ${tauroot}/tools/src/contrib/jogl/jogl.jar $JARTARGET cp ${tauroot}/tools/src/contrib/derby.jar $JARTARGET cp ${tauroot}/tools/src/contrib/mysql.jar $JARTARGET cp ${tauroot}/tools/src/contrib/postgresql.jar $JARTARGET cp ${tauroot}/tools/src/contrib/xerces.jar $JARTARGET cp ${tauroot}/tools/src/common/resources/tau16x16.gif $JARTARGET case $machine in apple) gunzip -c tools/src/contrib/jogl/apple/libjogl.jnilib.gz > $JARTARGET/libjogl.jnilib gunzip -c tools/src/contrib/jogl/apple/libjogl_awt.jnilib.gz > $JARTARGET/libjogl_awt.jnilib gunzip -c tools/src/contrib/jogl/apple/libjogl_cg.jnilib.gz > $JARTARGET/libjogl_cg.jnilib ;; i386_linux) gunzip -c tools/src/contrib/jogl/i386_linux/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so gunzip -c tools/src/contrib/jogl/i386_linux/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; crayxmt) gunzip -c tools/src/contrib/jogl/x86_64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so ;; craycnl) gunzip -c tools/src/contrib/jogl/x86_64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so ;; xt3) gunzip -c tools/src/contrib/jogl/x86_64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so ;; x86_64) gunzip -c tools/src/contrib/jogl/x86_64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so gunzip -c tools/src/contrib/jogl/x86_64/libjogl_cg.so.gz > $JARTARGET/libjogl_cg.so ;; ia64) gunzip -c tools/src/contrib/jogl/ia64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/ia64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/ia64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; solaris2) gunzip -c tools/src/contrib/jogl/solaris2/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/solaris2/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/solaris2/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; solaris2-64) gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/solaris2-64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; sun386i) gunzip -c tools/src/contrib/jogl/sun386i/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/sun386i/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/sun386i/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; sunx86_64) gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/sunx86_64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; ppc64) gunzip -c tools/src/contrib/jogl/ppc64/jogl.jar.gz > $JARTARGET/jogl.jar gunzip -c tools/src/contrib/jogl/ppc64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/ppc64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/ppc64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; bgp) gunzip -c tools/src/contrib/jogl/ppc64/jogl.jar.gz > $JARTARGET/jogl.jar gunzip -c tools/src/contrib/jogl/ppc64/libjogl.so.gz > $JARTARGET/libjogl.so gunzip -c tools/src/contrib/jogl/ppc64/libjogl_awt.so.gz > $JARTARGET/libjogl_awt.so gunzip -c tools/src/contrib/jogl/ppc64/libjogl_drihack.so.gz > $JARTARGET/libjogl_drihack.so ;; *) echo "Platform does not support JOGL, no 3d displays will be available in ParaProf" ;; esac } make_directories () { if [ $tauprefix = unknown ] ; then fixmakeargs="$fixmakeargs tauprefix=$tauroot" fi # make bin dir if it does not exist if [ ! -d $tautoplevel/$architecture ] ; then mkdir -p $tautoplevel/$architecture fi if [ ! -d $tautoplevel/$architecture/bin ] ; then mkdir -p $tautoplevel/$architecture/bin fi # make lib dir if it does not exist if [ ! -d $tautoplevel/$architecture/lib ] ; then mkdir -p $tautoplevel/$architecture/lib fi } # -- set up portable echo command case "`echo 'x\c'`" in 'x\c') echo="echo -n" nnl= ;; #BSD x) echo="echo" nnl="\c";; #SysV *) echo 'Cannot setup echo. What weird machine do you have?' 1>2& echo="echo" nnl="\c" ;; esac # lth@cs.uoregon.edu: don't mess with the compiler if it is 'default'. # The user may define TAU_CCOM as an environment variable or let it be blank; # if blank, it is defaulted in archfind. if [ "$c_compiler" != "" -a "$c_compiler" != "default" ]; then TAU_CCOM="$c_compiler" # for 'archfind' export TAU_CCOM fi echo "-------------------- TAU configure script ------------------" tauroot=`pwd | sed -e 's,^/tmp_mnt/nfs,,' -e 's,^/tmp_mnt,,'` if [ ${tauprefix} = unknown ] ; then targetdir=${tauroot} tautoplevel=$tauroot else targetdir=${tauprefix} tautoplevel=$tauprefix fi echo \#define TAUROOT \"$tauroot\" > include/tauroot.h if [ $tauprefix != unknown ] ; then echo \#define TAUROOT \"$tauprefix\" > include/tauroot.h fi echo " The TAU source code has just been configured to use the" echo " tau root directory $tauroot." echo " If you move the Tau distribution, you must run configure" echo " again and recompile" echo "------------------------------------------------------------" fixmakeargs="$fixmakeargs tauroot=$tauroot" # Try and figure out architecture detectarch=unknown cd utils detectarch=`./archfind` detectxdev=`./archfind -x` cd .. if [ "x$detectarch" = "x" ] ; then detectarch=unknown fi ############################################################### # if there are no arguments, GUESS at system configuration if [ $tauarch = unknown -o $tauarch = none ] then if [ $# = 1 ] then if [ $1 = default ] then machine=$1 fi else echo Attempting to auto-configure system, determining architecture... machine=$detectarch if [ $machine = unknown ] then echo I could not determine the architecture of this host echo You must give me a hint. echo Perhaps, the C compiler is not working. echo Please check the licenses. exit 0 fi echo I think this is a $machine... fi else machine=$tauarch if [ $detectarch != unknown -a $machine != unknown ] ; then detectxdev=$machine if [ $detectarch != $machine ] ; then echo WARNING\!\! Auto-detect:$detectarch overridden with $machine fi fi fi # use -m32 when specifying 32 bit on an Opteron/EM64T if [ "x$detectarch" = "xx86_64" -a "x$machine" = "xi386_linux" ] ; then fixmakeargs="$fixmakeargs FORCEIA32" fi if [ $machine = mips ] ; then sicortex=yes fi if [ $machine = mips32 ] ; then sicortex=yes fi if [ $sicortex = yes ] ; then sicortexlink="" sicortexmpi="" if [ $epilog = yes ] ; then epiloglibdir=$epilogdir/lib elglibrary="-lelg" if [ $mpi = yes -a $openmp = yes ] ; then # hybrid sicortexlink="-L$epiloglibdir#-Wl,-whole-archive#-lfmpi#-lelg.ompi#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" elif [ $mpi = yes ] ; then # mpi sicortexlink="-L$epiloglibdir#-lfmpi#-lelg.mpi#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" elif [ $openmp = yes ] ; then # openmp sicortexlink="-L$epiloglibdir#-Wl,-whole-archive#-lelg.omp#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" else # serial sicortexlink="-L$epiloglibdir#-lelg#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" fi fi if [ $vampirtrace = yes ] ; then vampirtracelibdir=lib if [ $mpi = yes -a $openmp = yes ] ; then # hybrid sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.fmpi#-lvt.ompi#-lotf#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" elif [ $mpi = yes ] ; then # mpi sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-lvt.fmpi#-lvt.mpi#-lotf#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" elif [ $openmp = yes ] ; then # openmp sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.omp#-lotf#-Wl,-no-whole-archive#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" else # serial sicortexlink="-L$vampirtracedir/$vampirtracelibdir#-lvt#-lotf#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-lscmpi" fi fi fixmakeargs="$fixmakeargs SICORTEX sicortexlink=${sicortexlink}" fi ###################################################################### # If the default gcc/g++ is not used, Modify the Makefiles... # Choose the c++ and cc compiler case $machine in tc2000 | ksr1 | c90 | cray | t3e | crayx1 | craysv1) if [ $cxx_compiler = default ] then cxx_compiler=CC fi if [ $c_compiler = default ] then c_compiler=cc fi ;; nec) if [ $cxx_compiler = default ] then cxx_compiler=c++ fi if [ $c_compiler = default ] then c_compiler=cc fi ;; apple) if [ $cxx_compiler = default ] then cxx_compiler=g++ fi # To fix the make install clash with INSTALL file in file systems # that are case insensitive. Move INSTALL file to INSTALL.txt if [ -f INSTALL ] then mv INSTALL INSTALL.txt fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; cygwin) if [ $cxx_compiler = default ] then cxx_compiler=g++ fi # To fix the make install clash with INSTALL file in file systems # that are case insensitive. Move INSTALL file to INSTALL.txt if [ -f INSTALL ] then mv INSTALL INSTALL.txt fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; alpha) if [ $cxx_compiler = default ] then # If it has the HP/Compaq cxx compiler, use it if [ -d /lib/cmplrs/cxx ] then cxx_compiler=cxx else cxx_compiler=g++ fi c_compiler=cc fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; rs6000 | ibm64) if [ $cxx_compiler = default ] then # If it has the IBM xlC compiler, use it if [ -f /usr/bin/xlC -o -f /usr/vacpp/bin/xlC ] then cxx_compiler=xlC_r c_compiler=xlc_r else cxx_compiler=g++ fi fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; bgl) if [ $cxx_compiler = default ] then cxx_compiler=blrts_xlC c_compiler=blrts_xlc fi ;; bgp) if [ $cxx_compiler = default ] ; then cxx_compiler=mpixlcxx_r c_compiler=mpixlc_r # test compiler version for 09.00.0000.0006 PMR bug fix $echo "Checking version of IBM Compilers... ${nnl}" version=`mpixlc -qversion | tail -n 1 | awk '{ print $2;}'` echo "$version" eval v1=${version/./;v2=} eval v2=${v2/./;v3=} eval v3=${v3/./;v4=} pmr0006=no if [ $v1 -gt 9 ] ; then pmr0006=yes ; fi if [ $v1 -ge 9 -a $v2 -gt 0 ] ; then pmr0006=yes ; fi if [ $v1 -ge 9 -a $v2 -ge 0 -a $v3 -gt 0 ] ; then pmr0006=yes ; fi if [ $v1 -ge 9 -a $v2 -ge 0 -a $v3 -ge 0 -a $v4 -ge 6 ] ; then pmr0006=yes ; fi if [ $pmr0006 = yes ] ; then echo "new" else echo "old" fi elif [ $cxx_compiler = mpicxx ] ; then cxx_compiler=mpicxx c_compiler=mpicc gnu=yes fixmakeargs="$fixmakeargs GNU BGP_GFORTRAN COMPINST_GNU" fi # default to this BFD installation # disabling for now, the BFD on BGP causes problems for the # shared library version of TAU (gpaw python) # if [ $bfd = no ] ; then # bfd=yes # bfddir=/bgsys/drivers/ppcfloor/gnu-linux # fi ;; crayxmt) cxx_compiler=c++ c_compiler=cc fixmakeargs="$fixmakeargs CRAYXMT" if [ $pdt_cxx_compiler = default ] ; then pdt_cxx_full_path=/usr/bin/g++ pdt_cxx_compiler=/usr/bin/g++ fi ;; xt3) catamount=yes cxx_compiler=CC c_compiler=cc default_fortran=pgi if [ "x$PE_ENV" = xPGI ] ; then #tauoptions="${tauoptions}-pgi" pgi=yes default_fortran=pgi fixmakeargs="$fixmakeargs COMPINST_PGI" elif [ "x$PE_ENV" = xGNU ] ; then gnu=yes tauoptions="${tauoptions}-gnu" default_fortran=gfortran fixmakeargs="$fixmakeargs COMPINST_GNU" elif [ "x$PE_ENV" = xPATHSCALE ] ; then tauoptions="${tauoptions}-pathscale" default_fortran=pathscale fixmakeargs="$fixmakeargs COMPINST_GNU" fi if [ $fortran_compiler = no ] ; then fortran_compiler=$default_fortran fi # unless specified, use g++ if [ $pdt_cxx_compiler = default ] ; then pdt_cxx_full_path=/usr/bin/g++ pdt_cxx_compiler=/usr/bin/g++ fi ;; craycnl) cxx_compiler=CC c_compiler=cc default_fortran=pgi if [ "x$PE_ENV" = xPGI ] ; then #tauoptions="${tauoptions}-pgi" pgi=yes default_fortran=pgi fixmakeargs="$fixmakeargs COMPINST_PGI" elif [ "x$PE_ENV" = xGNU ] ; then gnu=yes tauoptions="${tauoptions}-gnu" default_fortran=gfortran fixmakeargs="$fixmakeargs COMPINST_GNU" elif [ "x$PE_ENV" = xPATHSCALE ] ; then tauoptions="${tauoptions}-pathscale" default_fortran=pathscale fixmakeargs="$fixmakeargs COMPINST_GNU" elif [ "x$PE_ENV" = xINTEL ] ; then tauoptions="${tauoptions}-intel" default_fortran=intel fixmakeargs="$fixmakeargs COMPINST_GNU" elif [ "x$PE_ENV" = xCRAY ] ; then tauoptions="${tauoptions}-cray" default_fortran=cray fixmakeargs="$fixmakeargs CRAYCC" touch conf_test.c extradir=`CC -v conf_test.c 2>&1 | grep cray-c++ | sed -e 's/ /\n/g' | grep "/opt/cray/cce" | grep "lib/x86-64$" | uniq` rm -f conf_test.c # not implemented yet # fixmakeargs="$fixmakeargs COMPINST_CRAY" fi if [ $fortran_compiler = no ] ; then fortran_compiler=$default_fortran fi # unless specified, use g++ if [ $pdt_cxx_compiler = default ] ; then pdt_cxx_full_path=/usr/bin/g++ pdt_cxx_compiler=/usr/bin/g++ fi ;; hitachi) if [ $cxx_compiler = default ] then cxx_compiler=KCC c_compiler=cc fi if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs HITACHI_FORTRAN" fortran_compiler=yes fi ;; sgi4k | sgi8k | sgin32 | sgi64) if [ $cxx_compiler = default ] then # SGI has no 64 bit C++ compiler except "CC", so if we are an # R8K, we have to use "CC" if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ] then cxx_compiler=CC c_compiler=cc else # We are an SGI R4K-based machine, use NCC if available if [ -f /bin/NCC ] then cxx_compiler=NCC c_compiler=cc else cxx_compiler=g++ fi fi fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; *) if [ $cxx_compiler = default ] then cxx_compiler=g++ if [ $fortran_compiler = no ] ; then fortran_compiler=gfortran fi fi if [ $c_compiler = default ] then c_compiler=gcc fi ;; esac if [ "$machine" = "apple" ] ; then mkdir -p apple/lib cp tools/src/common/resources/tau-medium.png apple/lib/ compiler_name=`which $cxx_compiler | awk '{print $1;}'` if [ "$compiler_name" = "no" -o "$compiler_name" = "" ]; then echo "NOTE: No compilers found, please use option '-c++=' if you have a C++ compiler" architecture=$machine make_directories configure_java configure_perfexplorer exit 0 fi fi if [ $machine = craycnl ] ; then cat < conftest_shared.c void foo() { } EOF $echo "Checking for CrayCNL shared library compatibility... ${nnl}" shared_opt="-shared -fPIC" if $c_compiler $orig_useropt $shared_opt -o conftest_shared.so conftest_shared.c -fPIC 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs CRAYCNL_SHARED" else echo "no" fixmakeargs="$fixmakeargs NOSHARED" fi /bin/rm -f conftest_shared.o conftest_shared.c conftest_shared.so fi ###################################################################### # For template instantiations in the library -ptused for CC compilers if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ] then if [ $cxx_compiler = CC ] then fixmakeargs="$fixmakeargs SGICC" if [ $pdt = yes -a $pdt_cxx_compiler = default ] then fixmakeargs="$fixmakeargs PDTSGICC" fi fi fi if [ $machine = hitachi ] then fixmakeargs="$fixmakeargs HITACHI" fi if [ $machine = t3e -a $cxx_compiler = CC ] then fixmakeargs="$fixmakeargs CRAYCC" fi if [ $machine = crayx1 -o $machine = craysv1 -a $cxx_compiler = CC ] then fixmakeargs="$fixmakeargs CRAYX1CC" fi ###################################################################### # Set default Profiling Options in Makefiles if [ $profile = no -a $trace = no -a $mpitrace = no -a $machine != default ] ; then profile=yes fi if [ $profile = yes ] ; then fixmakeargs="$fixmakeargs PROFILE" fi if [ $java = yes ] ; then tauoptions="${tauoptions}-jdk" fi if [ $profilestats = yes ] ; then fixmakeargs="$fixmakeargs PROFILESTATS" fi if [ $profilememory = yes ] ; then fixmakeargs="$fixmakeargs PROFILEMEMORY" tauoptions="${tauoptions}-memory" fi if [ $profileheadroom = yes ] ; then fixmakeargs="$fixmakeargs PROFILEHEADROOM" tauoptions="${tauoptions}-headroom" fi if [ $tag = yes ] ; then tauoptions="${tauoptions}-${tautag}" fi if [ $callpath = yes ] ; then fixmakeargs="$fixmakeargs PROFILECALLPATH" tauoptions="${tauoptions}-callpath" fi if [ $profileparam = yes ] ; then fixmakeargs="$fixmakeargs PROFILEPARAM" tauoptions="${tauoptions}-param" fi if [ $depthlimit = yes ] ; then fixmakeargs="$fixmakeargs DEPTHLIMIT" tauoptions="${tauoptions}-depthlimit" fi if [ $phase = yes ] ; then fixmakeargs="$fixmakeargs PROFILECALLPATH PROFILEPHASE" tauoptions="${tauoptions}-phase" if [ $callpath = yes ] ; then echo "ERROR: Incompatible options specified." echo "You must choose between -PROFILECALLPATH and -PROFILEPHASE. You cannot choose both!!" exit 1 fi fi if [ $setnode0 = yes -a $trace = no ] ; then fixmakeargs="$fixmakeargs SETNODE0" tauoptions="${tauoptions}-setnode" fi if [ $comm = no ] ; then fixmakeargs="$fixmakeargs NOCOMM" tauoptions="${tauoptions}-nocomm" fi if [ $iowrapper = yes ] ; then fixmakeargs="$fixmakeargs IOWRAPPER" fi if [ $stff = yes ] ; then fixmakeargs="$fixmakeargs RENCI_STFF stffdir=${stffdir} sddfdir=${sddfdir}" tauoptions="${tauoptions}-stff" if [ $sddf = no -o "x$sddfdir" = "x" ]; then echo "Error: Must specify -sddf=/path/to/sddflib along with -stff=/path/to/stfflib!" fi fi if [ $trace = yes ] ; then cat < tau_type_test.c #include int main(int argc, char **argv) { if (sizeof(x_int8) != 1 || sizeof(x_int16) != 2 || sizeof(x_int32) != 4 || sizeof(x_int64) != 8) { return -1; } return 0; } EOF if [ $catamount = no -a ! $machine = bgl -a ! $machine = bgp -a ! $machine = mips -a ! $machine = mips32 ] ; then $echo "Checking type sizes... ${nnl}" if $c_compiler -I. $orig_useropt tau_type_test.c -o tau_type_test 1> /dev/null 2>&1 ; then if ./tau_type_test 1> /dev/null 2>&1 ; then echo "ok" else echo "" echo "" echo "Warning: couldn't find correct type sizes!" echo "Please contact tau-bugs@cs.uoregon.edu with your system details" echo "" fi else echo "" echo "" echo "Warning: couldn't find correct type sizes!" echo "Please contact tau-bugs@cs.uoregon.edu with your system details" echo "" fi rm -f tau_type_test.c tau_type_test fi fixmakeargs="$fixmakeargs TRACE" fi if [ $mpitrace = yes ] ; then fixmakeargs="$fixmakeargs MPITRACE" fi if [ $alphatimers = yes ] ; then fixmakeargs="$fixmakeargs ALPHATIMERS" tauoptions="${tauoptions}-alphatimers" fi if [ $bgltimers = yes ] ; then fixmakeargs="$fixmakeargs BGLTIMERS" tauoptions="${tauoptions}-bgltimers" fi if [ $bgptimers = yes ] ; then fixmakeargs="$fixmakeargs BGPTIMERS" tauoptions="${tauoptions}-bgptimers" fi if [ $craytimers = yes ] ; then fixmakeargs="$fixmakeargs CRAYTIMERS" tauoptions="${tauoptions}-craytimers" fi if [ $cputime = yes ] ; then fixmakeargs="$fixmakeargs CPUTIME" fi if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ] ; then if [ $cxx_compiler = g++ ] ; then fixmakeargs="$fixmakeargs SGIGNU" fi fi if [ $machine = freebsd ] ; then fixmakeargs="$fixmakeargs FREEBSD" fi if [ $machine = apple ] ; then if [ $cxx_compiler = g++ -o $cxx_compiler = c++ -o $cxx_compiler = icpc ] ; then fixmakeargs="$fixmakeargs APPLECXX" fi if [ $cxx_compiler = pgCC -o $cxx_compiler = pgcpp ] ; then fixmakeargs="$fixmakeargs APPLEPGI" fi if [ $fortran_compiler = ibm -o $fortran_compiler = ibm64 ] ; then fixmakeargs="$fixmakeargs IBMXLFAPPLE" extradir=`which xlf90 | sed s/xlf90/../` fortran_compiler=yes fi # xlc++ doesn't like include/Memory. Move this directory if [ -d include/Memory -a ! -d include/MemoryWrapper ] ; then mv include/Memory include/MemoryWrapper else if [ -d include/Memory -a -d include/MemoryWrapper ] ; then /bin/rm -rf include/Memory fi fi fi if [ $machine = ppc64 -o $machine = bgl -o $machine = bgp ] ; then if [ $cxx_compiler = g++ ] ; then if [ $fortran_compiler = no ] ; then extradir=`which xlf90 | sed s/xlf90/../` fixmakeargs="$fixmakeargs IBM_FORTRAN" fi fi fi if [ $machine = ibm64 -o $machine = ibm64linux ] ; then if [ $cxx_compiler = g++ -o $cxx_compiler = powerpc64-linux-g++ ] ; then if [ $fortran_compiler = no ] ; then extradir=`which xlf90 | sed s/xlf90/../` fixmakeargs="$fixmakeargs IBM64_FORTRAN" fi fi fi if [ $machine = t3e -a $cxx_compiler = KCC ] ; then fixmakeargs="$fixmakeargs CRAYKAI" if [ $fortran_compiler = no ] ; then fixmakeargs="$fixmakeargs CRAY_FORTRAN" fortran_compiler=yes fi fi if [ $machine = crayx1 -o $machine = craysv1 ] ; then if [ $fortran_compiler = no ] ; then fixmakeargs="$fixmakeargs CRAY_X1_FORTRAN" fortran_compiler=yes fi fi if [ $debugprof = yes ] ; then fixmakeargs="$fixmakeargs DEBUGPROF" fi ###################################################################### # Set default C++ compiler in all Makefiles case $cxx_compiler in CC) echo "Default C++ compiler will be CC" fixmakeargs="$fixmakeargs USE_CFRONT" ;; *g++) echo "Default C++ compiler will be " \ `gcc -v 2>&1 | tail -1 | sed 's/gcc/g++/g'` gnu=yes # No fixmakeargs needed because it is the default ;; g++4) echo "Default C++ compiler will be " \ `gcc4 -v 2>&1 | tail -1 | sed 's/gcc4/g++4/g'` gnu=yes # No fixmakeargs needed because it is the default ;; egcs) echo "Default C++ compiler will be " \ `egcs -v 2>&1 | tail -1 | sed 's/gcc/egcs/g'` # No fixmakeargs needed because it is the default ;; cxx) echo "Default C++ compiler will be the HP Tru64 cxx C++ compiler" fixmakeargs="$fixmakeargs USE_DECCXX" if [ $fortran_compiler = no ] then f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"` if [ "x$f90loaded" = "x" ] then # f90 module has been loaded and which f90 returns a path extradir="`which f90 | sed s/f90/../`" echo "Found f90 in `which f90`" fi fixmakeargs="$fixmakeargs COMPAQ_FORTRAN" fortran_compiler=yes fi ;; *xl*) echo "Default C++ compiler will be IBMs xlC C++ compiler" fixmakeargs="$fixmakeargs USE_IBMXLC COMPINST_XL" if [ "$machine" = "apple" ] then fixmakeargs="$fixmakeargs IBMXLCAPPLE" if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs IBMXLFAPPLE" fi fi ibmxlc=yes if [ "$machine" = "bgp" ] ; then ibm_compiler=gxlc++ else ibm_compiler=$cxx_compiler fi compilerLocation=`which $ibm_compiler` if [ "x$compilerLocation" = "x/usr/bin/$ibm_compiler" ] ; then # if xlc or blrts_xlc is found in /usr/bin, it is likely a # symlink. Since we use ../lib to locate the libraries # we will dereference the symlink once. Don't do it more # than once, or you'll end up with the wrong thing # check for readlink first readlink=`which readlink` if [ "x$readlink" != "x" ] ; then if [ -x "$readlink" ] ; then if [ -h $compilerLocation ] ; then compilerLocation=`readlink $compilerLocation` fi fi fi fi if [ "x$compilerLocation" = "x/usr/local/tools/check_compile_line/bgxlc++" ] ; then compilerLocation=`grep bgxlc++ /usr/local/tools/check_compile_line/bgxlc++ | awk '{ print $3;}'` fi extradircxx=`echo $compilerLocation | sed s/$ibm_compiler/../` extradir=`which xlf90 | sed s/xlf90/../` if [ $fortran_compiler = no ] then if [ "$machine" = "ibm64" -o "$machine" = "ibm64linux" ] then fixmakeargs="$fixmakeargs IBM64_FORTRAN" else fixmakeargs="$fixmakeargs IBM_FORTRAN" fi fortran_compiler=yes fi threadtest=`echo $ibm_compiler | sed -e 's/_r//'` if [ "y$threadtest" = "y$ibm_compiler" ] then echo "Not using the thread-safe version of the IBM compiler" else ibmxlc_r=yes fixmakeargs="$fixmakeargs THREADSAFE_COMPILERS" echo "Using thread-safe version of the IBM compiler" threadsafe=yes fi ;; NCC) echo "Default C++ compiler will be SGI's Delta C++ compiler" fixmakeargs="$fixmakeargs USE_SGINCC" ;; KCC) echo "Default C++ compiler will be KAI KCC C++ Compiler" kai=yes fixmakeargs="$fixmakeargs KAI" ;; pgCC|pgcpp) echo "Default C++ compiler will be PGI pgCC C++ Compiler" pgi=yes pgiflag=`pgcc -help | head -1 | grep 1.7 | wc -l` fixmakeargs="$fixmakeargs COMPINST_PGI" if [ $pgiflag = 1 ] then echo "Using PGI ver 1.7 Compiler" fixmakeargs="$fixmakeargs PGI PGI1.7" else fixmakeargs="$fixmakeargs PGI PGICC" fi if [ $fortran_compiler = no ] then extradir=`which pgcc | sed s/pgcc/../` fixmakeargs="$fixmakeargs PGI_FORTRAN" fortran_compiler=yes fi ;; FCC) echo "Default C++ compiler will be Fujitsu C++ Compiler" fujitsu=yes fixmakeargs="$fixmakeargs FUJITSU" if [ $fortran_compiler = no ] then extradir=`which FCC | sed s/FCC/../` fixmakeargs="$fixmakeargs FUJITSU_FORTRAN" fortran_compiler=yes fi if [ $machine = solaris2 -o $machine = solaris2-64 ] then extradir=`which FCC | sed s/FCC/../` fixmakeargs="$fixmakeargs FUJITSU_SOLARIS" fortran_compiler=yes fi ;; guidec++) echo "Default C++ compiler will be KAI KAP/Pro OpenMP guidec++ Compiler" kai=yes fixmakeargs="$fixmakeargs KAI GUIDE OPENMP" openmp=yes tauoptions="${tauoptions}-guide" if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs KAI_FORTRAN" guidef90=yes fortran_compiler=yes fi ;; aCC) echo "Default C++ compiler will be HP aCC Compiler" fixmakeargs="$fixmakeargs ACC" tauoptions="${tauoptions}-acc" if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs HP_FORTRAN" fortran_compiler=yes fi ;; orCC) echo "Default C++ compiler will ORC Open64 orCC compiler" fixmakeargs="$fixmakeargs OPEN64ORC" tauoptions="${tauoptions}-orcc" if [ $c_compiler = default ] then c_compiler=orcc fi if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs OPEN64ORC_FORTRAN" fortran_compiler=yes fi if [ $openmp = yes ] then fixmakeargs="$fixmakeargs OPEN64_OPENMP" fi ;; c++) if [ $machine = nec ] then echo "Default C++ compiler will be NEC c++ compiler" fixmakeargs="$fixmakeargs USE_NECCXX" tauoptions="${tauoptions}-cxx" if [ $fortran_compiler = no ] then extradir=`which f90 | sed s/f90/../` fixmakeargs="$fixmakeargs NEC_FORTRAN" fortran_compiler=yes fi else if [ $machine = crayxmt ] then echo "Default C++ compiler will be Cray c++ compiler" else echo "Default C++ compiler will be Apple c++ compiler" fixmakeargs="$fixmakeargs APPLECXX" tauoptions="${tauoptions}-cxx" fi fi ;; ecpc) echo "Default C++ compiler will be Intel ecpc C++ compiler" fixmakeargs="$fixmakeargs USE_INTELCXX" tauoptions="${tauoptions}-ecpc" intel=yes if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs INTEL_FORTRAN" fortran_compiler=intel extradir=`which efc | sed s/efc/../` fi if [ $intelcxxlibicc = yes ] then fixmakeargs="$fixmakeargs INTELCXXLIBICC" fi ;; icpc) echo "Default C++ compiler will be Intel icpc C++ compiler" fixmakeargs="$fixmakeargs USE_INTELCXX COMPINST_INTEL9" tauoptions="${tauoptions}-icpc" intel=yes if [ $fortran_compiler = no ] then intelifort=`which ifort 2>/dev/null` if [ "y$intelifort" != "y" -a -x "$intelifort" ] ; then fixmakeargs="$fixmakeargs INTEL32_FORTRAN" fortran_compiler=intel extradir=`which ifort | sed -e 's/\/bin\/ifort$//'` fi fi if [ $intelcxxlibicc = yes ] then fixmakeargs="$fixmakeargs INTELCXXLIBICC" fi ;; pathCC|scpathCC) echo "Default C++ compiler will be PathScale pathCC C++ compiler" fixmakeargs="$fixmakeargs USE_PATHCC COMPINST_GNU" tauoptions="${tauoptions}-pathcc" pathscale=yes if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs PATHSCALE_FORTRAN" fortran_compiler=pathscale fi ;; qk-pgCC) echo "Default C++ compiler will be PGI pgCC C++ Compiler" pgi=yes fixmakeargs="$fixmakeargs PGI PGICC COMPINST_PGI" fixmakeargs="$fixmakeargs PGINOPRELINK" if [ $fortran_compiler = no ] then extradir=`which pgCC | sed s/pgCC/../` fixmakeargs="$fixmakeargs PGI_FORTRAN PGI_CATAMOUNT" fortran_compiler=yes fi ;; mpicxx) if [ $machine = bgp ] ; then echo "Using GNU Compilers for BGP" tauoptions="${tauoptions}-gnu" else echo "ERROR Unknown C++ compiler: $cxx_compiler" exit 1 fi ;; *) echo "ERROR Unknown C++ compiler: $cxx_compiler" exit 1 ;; esac ###################################################################### # Set default F90 compiler in all Makefiles case $fortran_compiler in gnu) echo "Default Fortran compiler will be GNU" fixmakeargs="$fixmakeargs GNU_FORTRAN" ;; gfortran) echo "Default Fortran compiler will be GNU gfortran" if [ $cxx_compiler = scg++ ] ; then fixmakeargs="$fixmakeargs SC_GFORTRAN" else gfortran=`which gfortran 2>&1` if [ "x$gfortran" != "x" ] ; then if [ -x $gfortran ] ; then taugfortranlibdir=`gfortran -print-libgcc-file-name | sed s/libgcc.a//` fi fixmakeargs="$fixmakeargs taugfortranlibdir=$taugfortranlibdir" fixmakeargs="$fixmakeargs GNU_GFORTRAN" fi fi ;; gfortran4) echo "Default Fortran compiler will be GNU gfortran4" gfortran4=`which gfortran4 2>&1` if [ "x$gfortran4" != "x" ] ; then if [ -x $gfortran4 ] ; then taugfortranlibdir=`gfortran4 -print-libgcc-file-name | sed s/libgcc.a//` fi fixmakeargs="$fixmakeargs taugfortranlibdir=$taugfortranlibdir" fixmakeargs="$fixmakeargs GNU_GFORTRAN4" fi ;; g95) echo "Default Fortran compiler will be G95" fixmakeargs="$fixmakeargs G95_FORTRAN" extradir=`g95 -print-libgcc-file-name | sed s/libgcc.a//` echo extra=$extradir ;; sgi) echo "Default Fortran compiler will be SGI f90" fixmakeargs="$fixmakeargs SGI_FORTRAN" ;; ibm) echo "Default Fortran compiler will be IBM xlf90" extradir=`which xlf90 | sed s/xlf90/../` fixmakeargs="$fixmakeargs IBM_FORTRAN" ;; ibm64) echo "Default Fortran compiler will be IBM xlf90 (64 bits)" extradir=`which xlf90 | sed s/xlf90/../` fixmakeargs="$fixmakeargs IBM64_FORTRAN" ;; hp) echo "Default Fortran compiler will be HP f90" extradir=`which f90 | sed s/f90/../` fixmakeargs="$fixmakeargs HP_FORTRAN" ;; cray) echo "Default Fortran compiler will be Cray f90" if [ $machine = crayx1 -o $machine = craysv1 ] then fixmakeargs="$fixmakeargs CRAY_X1_FORTRAN" else fixmakeargs="$fixmakeargs CRAY_FORTRAN" fi ;; pgi) echo "Default Fortran compiler will be PGI" extradir=`which pgcc | sed s/pgcc/../` fixmakeargs="$fixmakeargs PGI_FORTRAN" ;; absoft) echo "Default Fortran compiler will be Absoft f90" extradir="`which f90 | sed s/f90/../`" fixmakeargs="$fixmakeargs ABSOFT_FORTRAN" ;; fujitsu) echo "Default Fortran compiler will be Fujitsu F90" extradir=`which FCC | sed s/FCC/../` fixmakeargs="$fixmakeargs FUJITSU_FORTRAN" ;; nec) echo "Default Fortran compiler will be NEC f90" extradir=`which f90 | sed s/f90/../` fixmakeargs="$fixmakeargs NEC_FORTRAN" ;; lahey) echo "Default Fortran compiler will be Lahey lf95" extradir=`which lf95 | sed s/lf95/../` if [ -d $extradir/lib64 ] then fixmakeargs="$fixmakeargs LAHEY64_FORTRAN" else fixmakeargs="$fixmakeargs LAHEY_FORTRAN" fi ;; nagware) echo "Default Fortran compiler will be Nagware f95" extradir=`which f95 | sed s@\/f95@\/..@` fixmakeargs="$fixmakeargs NAGWARE_FORTRAN" ;; pathscale) echo "Default Fortran compiler will be Pathscale pathf95" if [ $cxx_compiler = scpathCC -o $cxx_compiler = scg++ ] then extradir=`which scpathf95 | sed s@\/scpathf95@\/..@` fixmakeargs="$fixmakeargs SC_PATHSCALE" else extradir=`which pathf95 | sed s@\/pathf95@\/..@` fixmakeargs="$fixmakeargs PATHSCALE_FORTRAN" fi ;; sun) echo "Default Fortran compiler will be SUN f90" fixmakeargs="$fixmakeargs SUN_FORTRAN" ;; compaq) echo "Default Fortran compiler will be HP Tru64 f90" f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"` if [ "x$f90loaded" = "x" ] then # f90 module has been loaded and which f90 returns a path extradir="`which f90 | sed s/f90/../`" echo "Found f90 in `which f90`" fi fixmakeargs="$fixmakeargs COMPAQ_FORTRAN" ;; kai) echo "Default Fortran compiler will be KAI guidef90" fixmakeargs="$fixmakeargs KAI_FORTRAN" guidef90=yes ;; open64) echo "Default Fortran compiler will be ORC Open64 orf90" fixmakeargs="$fixmakeargs OPEN64ORC_FORTRAN" ;; intel) if [ $cxx_compiler = ecpc ] then echo "Default Fortran compiler will be Intel efc" fixmakeargs="$fixmakeargs INTEL_FORTRAN" else echo "Default Fortran compiler will be Intel ifort" fixmakeargs="$fixmakeargs INTEL32_FORTRAN" intelifort=`which ifort 2>/dev/null` if [ "y$intelifort" != "y" -a -x "$intelifort" ] then extradir=`which ifort | sed -e 's/\/bin\/ifort$//'` fi fi ;; no) ;; *) ;; esac # Encode the full path of the C++/C compiler in the stub Makefile full_cxx_compiler=`which $cxx_compiler` full_cc_compiler=`which $c_compiler` fixmakeargs="$fixmakeargs fullcxx=$full_cxx_compiler fullcc=$full_cc_compiler" ###################################################################### # Set MPI options. First set the include dir if it is not specified if [ $mpi = yes -a $machine = ibm64 ] then ibmxlc_r=yes echo "Enabling threaded MPI libraries for IBM64" if [ $threadsafe = no ] then fixmakeargs="$fixmakeargs THREADSAFE_COMPILERS" threadsafe=yes fi fi if [ $mpi = yes -a "x$mpiinc" = "x" ] then case $machine in ppc64|ibm64linux) if [ -r /opt/ibmhpc/ppe.poe/include/mpi.h ] then mpiinc=/opt/ibmhpc/ppe.poe/include mpiincf90dir='-I/opt/ibmhpc/ppe.poe/include/thread' if [ $machine = ibm64linux ] then mpiincf90dir='-I/opt/ibmhpc/ppe.poe/include/thread64' fi additional_mpiincs="$additional_mpiincs $mpiincf90dir" fi ;; rs6000|ibm64) mpiinc=/usr/lpp/ppe.poe/include mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread' if [ $machine = ibm64 ] then mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread64' fi if [ $ibmxlc_r = yes ] then additional_mpiincs='-I/usr/lpp/ssp/css/include' fi additional_mpiincs="$additional_mpiincs $mpiincf90dir" ;; bgl) mpiinc=/bgl/BlueLight/ppcfloor/bglsys/include ;; bgp) mpiinc=/bgsys/drivers/ppcfloor/comm/include ;; t3e|crayx1|craysv1) mpiinc=/opt/ctl/mpt/mpt/include ;; xt3) mpiinc=/opt/xt-mpt/default/mpich2-64/P2/include ;; craycnl) mpiinc=/opt/xt-mpt/default/mpich2-64/P/include if [ ! -r $mpiinc ] ; then if [ $default_fortran = gfortran ] ; then mpiinc=/opt/mpt/$MPT_VERSION/xt/mpich2-gnu/include else mpiinc=/opt/mpt/$MPT_VERSION/xt/mpich2-$default_fortran/include fi if [ ! -r $mpiinc ] ; then mpiinc=/opt/mpt/default/xt/mpich2-pgi/include fi fi ;; solaris2*) mpiinc=/opt/SUNWhpc/include ;; ppc) if [ $zepto = yes ] then mpiinc=$zeptodir/include if [ ! -e $mpiinc ] then echo "ERROR: Cannot access Zepto MPI include directory [$mpiinc]. Aborting." exit 1 fi additional_mpiincs="$additional_mpiincs -DUSE_MPI -D__ZCL__ -DZCL_AD_HOC -I$zeptodir/include/ " fi ;; *) mpiinc=`which mpirun | sed -e 's/\/bin\/mpirun$//'`/include if [ -d $mpiinc ] then echo "Using MPI include directory $mpiinc" fi ;; esac fi # Add threaded include dir to the MPI include dir for IBM if [ "x$mpiinc" != "x" ] then case $machine in rs6000) if [ -d /usr/lpp/ppe.poe/include/thread ] then mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread' fi if [ $ibmxlc_r = yes ] then additional_mpiincs='-I/usr/lpp/ssp/css/include' fi additional_mpiincs="$additional_mpiincs $mpiincf90dir" ;; ibm64) if [ -d /usr/lpp/ppe.poe/include/thread64 ] then mpiincf90dir='-I/usr/lpp/ppe.poe/include/thread64' fi if [ $ibmxlc_r = yes ] then additional_mpiincs='-I/usr/lpp/ssp/css/include' fi additional_mpiincs="$additional_mpiincs $mpiincf90dir" ;; *) ;; esac fi if [ $mpi = yes -a "x$mpilib" = "x" ] then case $machine in ppc64) if [ -r /opt/ibmhpc/ppe.poe/lib/libmpi/libmpi_ibm.so ] then additional_mpilibs='-lpoe -llapi' mpilib=/opt/ibmhpc/ppe.poe/lib/libmpi mpilibrary="-lmpi_ibm $additional_mpilibs" fi ;; ibm64linux) if [ -r /opt/ibmhpc/ppe.poe/lib/libmpi64/libmpi_ibm.so ] then mpilib=/opt/ibmhpc/ppe.poe/lib/libmpi64 additional_mpilibs='-lpoe -llapi' mpilibrary="-lmpi_ibm $additional_mpilibs" fi ;; rs6000|ibm64) mpilib=/usr/lpp/ppe.poe/lib if [ $ibmxlc_r = yes ] then additional_mpilibs='-L/usr/lpp/ppe.poe/lib/threads -L/usr/lpp/ssp/css/lib -llapi_r' fi ;; bgl) mpilib=/bgl/BlueLight/ppcfloor/bglsys/lib additional_mpilibs='-lmsglayer.rts -ldevices.rts -lrts.rts -ldevices.rts' ;; bgp) mpilib=/bgsys/drivers/ppcfloor/comm/lib additional_mpilibs='-ldcmfcoll.cnk -ldcmf.cnk -lpthread -L/bgsys/drivers/ppcfloor/runtime/SPI -lSPI.cna' ;; t3e|crayx1|craysv1) mpilib=/opt/ctl/mpt/mpt/lib/ ;; xt3) mpilib=/opt/xt-mpt/default/mpich2-64/P2/lib ;; craycnl) mpilib= ;; solaris2*) mpilib=/opt/SUNWhpc/lib ;; ppc) if [ $zepto = yes ] then mpilib=$zeptodir/lib if [ ! -e $mpilib ] then echo "ERROR: Cannot access Zepto MPI lib directory [$mpilib]. Aborting" exit 1 fi additional_mpilibs="-L$zeptodir/lib -lmpich.zcl -ldcmfcoll.zcl -ldcmf.zcl -lpthread -lSPI.zcl -lzcl -lzoid_cn -lpthread -lrt -lm" mpilibrary="$additional_mpilibs" fi ;; *) mpilib=`which mpirun | sed -e 's/\/bin\/mpirun$//'`/lib if [ -d $mpilib ] ; then echo "Using MPI lib directory $mpilib" fi ;; esac fi if [ "x$mpiinc" != "x" ] ; then # Check for OpenMPI and add additional include directory if [ -d $mpiinc/openmpi ] ; then echo "NOTE: Using OpenMPI" additional_mpiincs="-I$mpiinc/openmpi -I$mpiinc/openmpi/ompi" fi if [ -d $mpiinc ] ; then #echo "Include dir found. adding -I$mpiinc to INC" mpiincargs="$mpiincargs -I$mpiinc $additional_mpiincs" mpiincargs=`echo $mpiincargs | sed -e 's/ /#/g'` fixmakeargs="$fixmakeargs mpiincargs=$mpiincargs" fi fi if [ $perf = yes ] ; then fixmakeargs="$fixmakeargs PERFLIB" tauoptions="${tauoptions}-perf" if [ "x$perfincdir" != "x" ] ; then fixmakeargs="$fixmakeargs perfincdir=$perfincdir" fi if [ "x$perflibdir" != "x" ] ; then fixmakeargs="$fixmakeargs perflibdir=$perflibdir" fi if [ "x$perflibrary" != "x" ] ; then fixmakeargs="$fixmakeargs perflibrary=$perflibrary" else if [ -f $perflibdir/libpapi.a ] ; then perflibrary="-lperfrt#-lpapi" else perflibrary="-lperfrt" fi fixmakeargs="$fixmakeargs perflibrary=$perflibrary" fi fi if [ $epilog = yes -a $epiloginc = no -a $epilogdir != no ] ; then if [ -f $epilogdir/include/elg_rw.h ] ; then epilogincdir=$epilogdir/include else epilogincdir=$epilogdir/src fi fi if [ $epilog = yes -a $epilogbin = no -a $epilogdir != no ] ; then if [ -f $epilogdir/bin/opari ] ; then epilogbindir=$epilogdir/bin else epilogbindir=$epilogdir/src fi fi if [ $epilog = yes -a -f $epilogbindir/skin ] ; then fixmakeargs="$fixmakeargs SCALASCA" scalasca=yes fi if [ $epilog = yes -a $epiloglib = no -a $epilogdir != no ] ; then if [ -f $epilogdir/lib/libelg.base.a ] ; then epiloglibdir=$epilogdir/lib elif [ -f $epilogdir/src/libelg.base.a ] ; then epiloglibdir=$epilogdir/src elif [ -f $epilogdir/lib/be/libelg.base.a ] ; then epiloglibdir=$epilogdir/lib/be elif [ -f $epilogdir/lib/fe/libelg.base.a ] ; then epiloglibdir=$epilogdir/lib/fe elif [ -f $epilogdir/lib64/libelg.base.a ] ; then epiloglibdir=$epilogdir/lib64 elif [ -f $epilogdir/lib32/libelg.base.a ] ; then epiloglibdir=$epilogdir/lib32 else echo "ERROR: PLEASE SPECIFY A VALID -epiloglib= option." fi fi if [ $vampirtrace = yes ] ; then # use vtcc/vtf90 -vt:show to get -I's and -L/-l's # prefer vtf90 over vtcc vtshow="no" if [ -f "$vampirtracedir/bin/vtcc" ] ; then vtshow="$vampirtracedir/bin/vtcc" fi if [ -f "$vampirtracedir/bin/vtf90" ] ; then vtshow="$vampirtracedir/bin/vtf90" fi if [ $vtshow != "no" ] ; then # test VampirTrace version $echo "Checking version of VampirTrace... ${nnl}" version=`$vampirtracedir/bin/vtcc -vt:version 2>&1` echo "$version" eval major=${version/./;minor=} minor=`echo $minor | sed 's/\([0-9]*\).*/\1/g'` # check if 5.7 or later if [ $major -eq 5 -a $minor -eq 7 ] ; then fixmakeargs="$fixmakeargs VAMPIRTRACE_5_7_API" fi vtserchk="seq" vtparchk="mpi" if [ $openmp = yes ] ; then vtserchk="mt" vtparchk="hyb" fi tmp=`$vtshow -vt:mpi -vt:show 2>&1` if [[ "$elements" == vtf90:\ unknown\ option* ]] ; then if [ $openmp = yes ] ; then vtserchk="omp" fi fi # first, find MPI libs elements=`$vtshow -vt:$vtparchk -vt:show 2>&1` if [[ "$elements" == vtf90:\ unknown\ option* ]] ; then elements=`$vtshow -vt:$vtparchk -vt:showme 2>&1` fi vampirtraceincs="" vampirtracempilibs="" for arg in $elements ; do case $arg in -I*) vampirtraceincs="$vampirtraceincs#$arg" ;; -L*) vampirtracempilibs="$vampirtracempilibs#$arg" ;; -l*) vampirtracempilibs="$vampirtracempilibs#$arg" ;; esac done # now, find serial libs elements=`$vtshow -vt:show -vt:$vtserchk 2>&1` if [[ "$elements" == vtf90:\ unknown\ option* ]] ; then elements=`$vtshow -vt:showme -vt:$vtserchk 2>&1` fi vampirtracelibs="" for arg in $elements ; do case $arg in -L*) vampirtracelibs="$vampirtracelibs#$arg" ;; -l*) vampirtracelibs="$vampirtracelibs#$arg" ;; esac done fixmakeargs="$fixmakeargs vampirtraceincs=$vampirtraceincs" fixmakeargs="$fixmakeargs vampirtracelibs=$vampirtracelibs" fixmakeargs="$fixmakeargs vampirtracempilibs=$vampirtracempilibs" vampirtraceshow=yes fi if [ -f $vampirtracedir/lib/libvt.a ] ; then vampirtracelibdir=lib else vampirtracelibdir=vtlib fi fi if [ $papi = yes ] ; then fixmakeargs="$fixmakeargs PAPI papidir=$papidir" tauoptions="${tauoptions}-papi" p=$papidir/lib papisubdir=lib if [ $machine = "mips32" ] ; then papisubdir=lib32 fixmakeargs="$fixmakeargs papisubdir=lib32" else if [ -f $p/libpapi.so -o -f $p/libpapi.a -o -f $p/libpapi64.so -o -f $p/libpapi64.a -o -f $p/libpapi.rts.a ] ; then papisubdir=lib fixmakeargs="$fixmakeargs papisubdir=lib" else if [ -f $p/cnos64/libpapi.so ] ; then papisubdir=lib/cnos64 fixmakeargs="$fixmakeargs papisubdir=lib/cnos64" else if [ -f $p/xt-cnl/lib/libpapi.so ] ; then papisubdir=xt-cnl/lib fixmakeargs="$fixmakeargs papisubdir=xt-cnl/lib" else if [ -f $papidir/lib64/libpapi.so ] ; then papisubdir=lib64 fixmakeargs="$fixmakeargs papisubdir=lib64" else papisubdir=src fixmakeargs="$fixmakeargs papisubdir=src" fi fi fi fi fi if [ -f $papidir/lib/libpfm.a ] ; then cat < tau_papi_test.c #include int main (int argc, char **argv) { int papi_ver; papi_ver = PAPI_library_init(PAPI_VER_CURRENT); } EOF if $c_compiler $orig_useropt tau_papi_test.c -I$papidir/include -L$papidir/$papisubdir -lpfm -lpapi -lpfm -o tau_papi_test 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs PAPIPFM" papipfm=yes papiperfctr=no fi if $c_compiler $orig_useropt tau_papi_test.c -I$papidir/include -L$papidir/$papisubdir -lpfm -lpapi -lpfm -lperfctr -o tau_papi_test 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs PAPIPFMPERFCTR" papipfm=yes papiperfctr=yes fi /bin/rm -f tau_papi_test.c tau_papi_test fi fi ###################################################################### # Set default CC compiler in all Makefiles if [ "$mpi" = "yes" -a "$ibmxlc_r" = "no" -a "$ibmxlc" = "yes" -a "$machine" = "ibm64" ] then echo "WARNING: PLEASE use xlC_r instead of xlC with MPI in 64 bit mode!! Reconfigure." echo "----------------------------------------------------------------" fi # Now check for SHMEM options if [ $shmem = yes ] then if [ "x$shmeminc" != "x" ] then if [ -d $shmeminc ] then #echo "Include dir found. adding -I$mpiinc to INC" shmemincargs="-I$shmeminc" gpshmem=no if [ -r $shmeminc/gpshmem.h ] then fixmakeargs="$fixmakeargs GPSHMEM" gpshmem=yes fi fi else if [ $catamount = yes ] then shmemincargs="-I/opt/xt-mpt/default/include/mpp" fi if [ $machine = craycnl ] then shmemincargs="-I/opt/mpt/default/xt/sma64/include/mpp" fi fi if [ $shmemlibrary = no ] then shmemlibrary=-lsma if [ $gpshmem = yes ] then shmemlibrary=-lgpshmem fi fi if [ "x$shmemlib" != "x" ] then if [ -d $shmemlib ] then #echo "Lib dir found. adding -L$shmemlib to LIB" shmemlibargs="$shmemlibargs -L$shmemlib" fi else if [ $catamount = yes ] then shmemlibargs="$shmemlibargs -L/opt/xt-mpt/default/lib/cnos64" fi if [ $machine = craycnl ] then shmemlibargs="$shmemlibargs -L/opt/mpt/default/xt/sma64/lib" fi fi shmemlibargs="$shmemlibargs $shmemlibrary" shmemlibargs=`echo $shmemlibargs | sed -e 's/ /#/g'` fixmakeargs="$fixmakeargs SHMEM" tauoptions="${tauoptions}-shmem" fixmakeargs="$fixmakeargs shmemlibargs=$shmemlibargs shmemincargs=$shmemincargs" fi gcclibdir=unknown if [ $c_compiler != gcc ] then echo Default C compiler will be $c_compiler fixmakeargs="$fixmakeargs USE_CC" else echo "Default C compiler will be " `gcc -v 2>&1 | tail -1` # I must set the gcclibdir in the Makefiles if we combine gcc, cc, and CC gcclibdir=`gcc -v 2>&1 | awk '{print $4;}' | \ awk -F/ '{for (i=2; i&1 | tail -1` # I must set the gcclibdir in the Makefiles if we combine gcc, cc, and CC gcclibdir=`gcc4 -v 2>&1 | awk '{print $4;}' | \ awk -F/ '{for (i=2; i get_stdinc.C #include #include EOF cat << EOF > find_stdinc.awk BEGIN {cinc=""; cppinc="";} /^#[0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$2, 2, length(\$2)-11);} /^#line [0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$3, 2, length(\$3)-11);} /^# [0123456789]+ ".+\/stddef.h"/ {cinc = substr(\$3, 2, length(\$3)-11);} /^#[0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$2, 2, length(\$2)-13);} /^#line [0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$3, 2, length(\$3)-13);} /^# [0123456789]+ ".+\/iostream.h"/ {cppinc = substr(\$3, 2, length(\$3)-13);} END {printf("-I%s -I%s\n", cinc, cppinc);} EOF if [ $machine = hitachi ] then stdinc="-I/usr/include" else stdinc=`$cxx_compiler -E get_stdinc.C | awk -f find_stdinc.awk` fi rm -f get_stdinc.C find_stdinc.awk ###################################################################### if [ $cxx_compiler = pgCC -o $cxx_compiler = pgcpp ] then cat < pgitest.C int foo(int x) { return x; } EOF if $cxx_compiler $orig_useropt -c pgitest.C 1> /dev/null 2>&1 then if $cxx_compiler $orig_useropt --prelink_objects pgitest.o 1> /dev/null 2>&1 then echo "PGI compiler supports the --prelink_objects option" else echo "PGI compiler should not use --prelink_objects option for making libs" fixmakeargs="$fixmakeargs PGINOPRELINK" fi else echo "ERROR: Your PGI compiler is not working! Please check the license file" fi rm -f pgitest.o pgitest.C libpgitest.a fi ###################################################################### # If epilog is used, check and see if it supports v2.1s write interface if [ $epilog = yes ] then echo "Checking epilog write interface:" cat << EOF > elgtest.C #include int foo(ElgOut *out, elg_ui4 eventc) { return ElgOut_write_NUM_EVENTS(out, eventc); } EOF if $cxx_compiler $orig_useropt -I$epilogincdir -c elgtest.C 1> /dev/null 2>&1 then fixmakeargs="$fixmakeargs TAU2EPILOG" fi rm -f elgtest.C elgtest.o fi ###################################################################### # Set some more Profiling options if [ $stdcxxlib = yes ] then fixmakeargs="$fixmakeargs STDCXXLIB" fi ###################################################################### if [ $machine = craycnl ] then #echo "This looks like a Cray Compute Node Linux (CNL) system..." fixmakeargs="$fixmakeargs CRAYCNL" fi ###################################################################### if [ $catamount = yes ] then #echo "This looks like a CATAMOUNT Cray RS system..." fixmakeargs="$fixmakeargs CATAMOUNT" if [ $fortran_compiler = pgi ] then fixmakeargs="$fixmakeargs PGI_CATAMOUNT" fi fi ###################################################################### if [ $cxx_compiler = g++ -o $cxx_compiler = g++4 -o $cxx_compiler = egcs -o $cxx_compiler = powerpc64-linux-g++ -o $cxx_compiler = c++ -o $cxx_compiler = scg++ -o $cxx_compiler = mips64el-gentoo-linux-gnu-g++ -o $cxx_compiler = powerpc-bgp-linux-g++ ] then if [ $machine != crayxmt ] then fixmakeargs="$fixmakeargs GNU COMPINST_GNU" fi if [ $machine = ibm64 -o $machine = rs6000 -o $machine = ppc64 -o $machine = bgl -o $machine = bgp -o $machine = ibm64linux ] then tauoptions="${tauoptions}-gnu" fi taugcclibdir=`$c_compiler -print-libgcc-file-name | sed -e 's,[^/]*$,,'` echo "Using GNU lib dir as $taugcclibdir" fixmakeargs="$fixmakeargs taugcclibdir=$taugcclibdir" fi ###################################################################### # TEST FOR ALL MACHINE TYPES case $machine in hp9000s700 | hp9000s800) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine NO_RANLIB HP $fixmakeargs" # HP-ALLOCA HP_CFLAGS if [ `/bin/uname -r | cut -d. -f2` = 10 ] ; then echo This machine uses HPUX Version 10 fixmakeargs="HPUX10 $fixmakeargs" fi if [ $c_compiler = cc ] ; then fixmakeargs="HP_CFLAGS HP-ALLOCA $fixmakeargs" fi if [ $cxx_compiler = g++ ] ; then fixmakeargs="HPGNU $fixmakeargs" fi if [ $pdt_cxx_compiler = aCC ] ; then fixmakeargs="PDTHPACC $fixmakeargs" fi ;; decstation) echo Found a \"$machine\" configuration definition # fixmakeargs="arch=$machine MIPS_CC $fixmakeargs" # with gcc, there are no changes needed... fixmakeargs="arch=$machine $fixmakeargs" ;; ppc64) echo "Found an IBM PPC-64 Linux configuration definition" fixmakeargs="arch=$machine PPC64 $fixmakeargs" linuxtimers=yes if [ $papi = yes ] ; then fixmakeargs="$fixmakeargs PPC64PAPI" fi if [ $c_compiler = xlc ] ; then fixmakeargs="$fixmakeargs PPC64XLC" fi if [ $fortran_compiler = ibm -o $fortran_compiler = ibm64 ] ; then fixmakeargs="$fixmakeargs PPC64XLF" fi ;; bgp) echo "Found an IBM PPC-64 BG/P Linux configuration definition" fixmakeargs="arch=$machine BGP $fixmakeargs" if [ $papi = yes ] ; then p=$papidir/lib if [ -f $p/libpapi.a ] ; then fixmakeargs="$fixmakeargs BGPPAPI" fi fi ;; bgl) echo "Found an IBM PPC-64 BGL Linux configuration definition" fixmakeargs="arch=$machine BGL $fixmakeargs" if [ $papi = yes ] ; then p=$papidir/lib if [ -f $p/libpapi.a ] ; then fixmakeargs="$fixmakeargs BGLPAPI" else fixmakeargs="$fixmakeargs BGLPAPI_RTS" fi fi ;; ia64) echo "Found an IA-64 configuration definition" fixmakeargs="arch=$machine $fixmakeargs" linuxtimers=yes if [ $papi = yes ] ; then fixmakeargs="$fixmakeargs IA64PAPI" fi ;; i386_linux) echo "Found a 32-bit x86 linux machine" linuxtimers=yes fixmakeargs="arch=$machine $fixmakeargs" ;; crayxmt) echo "Found a Cray XMT configuration" fixmakeargs="arch=$machine $fixmakeargs" ;; x86_64|xt3|craycnl) echo "Found an x86_64 configuration definition" fixmakeargs="arch=$machine $fixmakeargs" linuxtimers=yes if [ $papi = yes ] ; then if [ $papiperfctr = yes ] ; then fixmakeargs="$fixmakeargs X86_64PAPI" else fixmakeargs="$fixmakeargs X86_64PAPI_NEW" fi fi ;; ibm64) echo Found a \"$machine\" configuration definition if [ `uname -s` = AIX ] then fixmakeargs="arch=$machine $fixmakeargs SP1 IBM64" else if [ `uname -s ` = Linux ] then fixmakeargs="arch=$machine $fixmakeargs PPC64 IBM64" else fixmakeargs="arch=$machine $fixmakeargs IBM64" fi fi if [ $papi = yes ] then fixmakeargs="$fixmakeargs IBM64PAPI" fi ;; ibm64linux) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs PPC64 IBM64LINUX" linuxtimers=yes if [ $papi = yes ] ; then fixmakeargs="$fixmakeargs IBM64PAPILINUX" fi if [ $c_compiler = xlc ] ; then fixmakeargs="$fixmakeargs IBM64LINUX_XLC" fi if [ $fortran_compiler = ibm -o $fortran_compiler = ibm64 ] ; then fixmakeargs="$fixmakeargs IBM64LINUX_XLF" fi ;; mips32) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs MIPS32 MIPS32LINUX" sicortex=yes if [ $papi = yes ] then fixmakeargs="$fixmakeargs MIPS32PAPI" fi ;; mips) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs MIPS64 MIPS64LINUX" sicortex=yes if [ $papi = yes ] then fixmakeargs="$fixmakeargs MIPS64PAPI" fi ;; rs6000) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs SP1" if [ $papi = yes ] then fixmakeargs="$fixmakeargs IBMPAPI" fi ;; alpha) if [ $papi = yes ] then fixmakeargs="$fixmakeargs ALPHAPAPI" fi echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs" fixmakeargs="COMPAQ_ALPHA $fixmakeargs" if [ $pdt_cxx_compiler = cxx ] then fixmakeargs="$fixmakeargs PDTALPHACXX" fi if [ $guidef90 = yes ] then f90loaded=`which f90 | sed -e 's/f90/../g' | grep "^no"` if [ "x$f90loaded" = "x" ] then # f90 module has been loaded and which f90 returns a path extradir="`which f90 | sed s/f90/../`" echo "Found f90 in `which f90`" fi fixmakeargs="$fixmakeargs extradir=$extradir COMPAQ_GUIDEF90" fi ;; sgi4k | sgi8k | sgi32 | sgin32 | sgi64) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs" if [ $c_compiler = cc ] then # Check CPU type for compiler optimization flags... (-mips2) (-mips4) if [ $machine = sgi4k ] then fixmakeargs="$fixmakeargs MIPS_CC" fixmakeargs="$fixmakeargs MIPSR4K" echo "NOTE: *** This is an SGI Challenge (R4K) ***" else fixmakeargs="$fixmakeargs MIPSR8K" echo "NOTE: *** This is an SGI POWER Challenge/Origin (R8K, R10K) ***" fi fi if [ $machine = sgin32 ] then fixmakeargs="$fixmakeargs ENABLEN32BIT" fi if [ $machine = sgi64 ] then fixmakeargs="$fixmakeargs ENABLE64BIT" if [ $papi = yes ] then if [ -f $papidir/lib/libpapi64.so -o -f $papidir/src/libpapi64.so ] then fixmakeargs="$fixmakeargs SGI64PAPI" fi fi fi if [ $machine = sgi32 ] then fixmakeargs="$fixmakeargs ENABLE32BIT" fi # Check for sgimp xdev enviroment if [ $detectxdev = sgimp -o $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ] then fixmakeargs="$fixmakeargs SGIMP" if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs SGI_FORTRAN" fortran_compiler=yes fi fi ;; solaris2*) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine SOL2 $fixmakeargs" if [ "$tauarch" = "solaris2-64" ] then fixmakeargs="$fixmakeargs SOLARIS64" fi if [ $papi = yes ] then fixmakeargs="$fixmakeargs SOL2PAPI" fi if [ $cxx_compiler = CC ] then fixmakeargs="$fixmakeargs SOL2CC" if [ $openmp = yes ] then fixmakeargs="$fixmakeargs SOL2CC_OPENMP" fi if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs SUN_FORTRAN" fortran_compiler=yes fi fi ;; sun386i) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine SUN386I $fixmakeargs" if [ $cxx_compiler = CC ] then fixmakeargs="$fixmakeargs SOL2CC" if [ $openmp = yes ] then fixmakeargs="$fixmakeargs SOL2CC_OPENMP" fi if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs SUN_FORTRAN" fortran_compiler=yes fi fi ;; sunx86_64) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs SUNX86_64" if [ $cxx_compiler = CC ] ; then fixmakeargs="$fixmakeargs SOL2CC" if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs SOL2CC_OPENMP" fi if [ $fortran_compiler = no ] ; then fixmakeargs="$fixmakeargs SUN_FORTRAN" fortran_compiler=yes fi fi ;; sun4) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine $fixmakeargs" ;; c90) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine C90 CRAY-ALLOCA $fixmakeargs" # Check for T3D xdev enviroment if [ $detectxdev = t3d ] then fixmakeargs="$fixmakeargs T3D" fi ;; t3e) echo Found a \"$machine\" configuration definition fixmakeargs="arch=$machine T3E CRAY-ALLOCA $fixmakeargs" if [ $fortran_compiler = no ] then fixmakeargs="$fixmakeargs CRAY_FORTRAN" fortran_compiler=yes fi ;; unknown) echo unknown architecture. fixmakeargs="arch=$machine $fixmakeargs" ;; default) fixmakeargs="arch=$machine $fixmakeargs" ;; -*) echo "Invalid option \`$1'" 1>&2 exit 1 ;; *) echo No special modifications found for architecture \"$machine\" fixmakeargs="arch=$machine $fixmakeargs" ;; esac if [ $machine = x86_64 -o $machine = i386_linux -o $machine = ia64 ] ; then if [ $cxx_compiler = CC ] ; then fixmakeargs="$fixmakeargs SUNCC" if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs SUNCC_OPENMP" fi if [ $fortran_compiler = no ] ; then fixmakeargs="$fixmakeargs SUN_FORTRAN" fortran_compiler=yes fi fi fi if [ $tauarch = none ] ; then architecture= fixmakeargs="$fixmakeargs arch= " else if [ "x$execprefix" = "xunknown" ] ; then architecture=$machine else architecture=$execprefix fi fi # write out .h file to define this architecture __easily__ echo \#define TAU_$machine > ./include/tauarch.h echo \#define TAU_ARCH \"$machine\" >> ./include/tauarch.h make_directories ##################################################################### # Is LINUXTIMERS available? ##################################################################### if [ $linuxtimers = yes ] ; then echo "LINUX_TIMERS enabled" fixmakeargs="$fixmakeargs LINUXTIMERS" fi echo "***********************************************************************" ##################################################################### # Compile/Link/Run checks ##################################################################### ##################################################################### # MPI Checks ##################################################################### # Next, check the properties of the MPI implementation. if [ "x$mpiinc" != "x" -o "x$mpilib" != "x" -o $mpi = yes ] ; then #echo "MPI is specified" mpi=yes fixmakeargs="$fixmakeargs MPI" tauoptions="${tauoptions}-mpi" mpicompiler=$cxx_compiler msuf=C if [ $machine = t3e ] then mpicompiler=$c_compiler msuf=c fi cat < mpi_thread_test.$msuf #include int main(int argc, char **argv) { int ret, req, provided; ret = PMPI_Init_thread(&argc, &argv, req, &provided); return ret; } EOF if [ "x$mpiinc" != "x" ] then # echo "mpiinc is specified" mpi_include=-I$mpiinc fi mpi_include="$mpi_include $mpiincargs" mpi_include=`echo $mpi_include | sed -e 's/#/ /g'` cat < mpi2.$msuf #include int foo(MPI_Win win) { int ret; ret = MPI_Win_fence(MPI_MODE_NOPRECEDE, win); return ret; } EOF cat < mpi2iorequest.$msuf #include int foo (MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPIO_Request *request) { return MPI_File_iread_shared (fh, buf, count, datatype, request); } EOF cat < mpi2attr.$msuf #include int foo(MPI_Win_copy_attr_function *f1, MPI_Type_copy_attr_function *f2, MPI_Comm_copy_attr_function *f3) { return 0; } int MPI_Type_get_attr(MPI_Datatype type, int type_keyval, void *attribute, int *flag) { return PMPI_Type_get_attr(type, type_keyval, attribute, flag); } EOF cat < mpi2typeex.$msuf #include int f1( void * sendbuf, void * recvbuf, int count, MPI_Datatype datatype , MPI_Op op, MPI_Comm comm) { return MPI_Exscan( sendbuf, recvbuf, count, datatype, op, comm) ; } int f2( MPI_Datatype type, MPI_Datatype * newtype) { return MPI_Type_dup( type, newtype) ; } int f3( int p, int r, MPI_Datatype * newtype) { return MPI_Type_create_f90_real( p, r, newtype) ; } int f4( int p, int r, MPI_Datatype * newtype) { return MPI_Type_create_f90_complex( p, r, newtype) ; } EOF cat < mpi2add.$msuf #include int f1( int * errorclass) { return MPI_Add_error_class( errorclass) ; } int f2( char * datarep, int incount, MPI_Datatype datatype, MPI_Aint * size) { return MPI_Pack_external_size( datarep, incount, datatype, size) ; } EOF cat < mpi2file.$msuf #include #include int main( int argc, char *argv[] ) { MPI_Fint handleA, handleB; int rc; int errs = 0; int rank; MPI_File cFile; MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); rc = MPI_File_open( MPI_COMM_WORLD, "temp", MPI_MODE_RDWR | MPI_MODE_DELETE_ON_CLOSE | MPI_MODE_CREATE, MPI_INFO_NULL, &cFile ); if (rc) { printf( "Unable to open file \"temp\"\n" );fflush(stdout); } else { MPI_File_close( &cFile ); } MPI_Finalize(); return 0; } EOF cat < mpi2grequest.$msuf #include int foo(MPI_Grequest_query_function *grequest_query_fn, MPI_Grequest_free_function *grequest_free_fn, MPI_Grequest_cancel_function *grequest_cancel_fn, void *extra_state, MPI_Request *request) { return MPI_Grequest_start(grequest_query_fn, grequest_free_fn, grequest_cancel_fn, extra_state, request); } int bar(MPI_Request request) { return MPI_Grequest_complete(request); } EOF cat < mpi2datarep.$msuf #include int foo( char * datarep, MPI_Datarep_conversion_function * read_conversion_fn, MPI_Datarep_conversion_function * write_conversion_fn, MPI_Datarep_extent_function * dtype_file_extent_fn, void * extra_state) { return MPI_Register_datarep( datarep, read_conversion_fn, write_conversion_fn, dtype_file_extent_fn, extra_state); } EOF cat < mpi2errhandler.$msuf #include int foo (MPI_Comm_errhandler_fn *a, MPI_Errhandler *b) { return MPI_Comm_create_errhandler(a,b); } int bar (MPI_File_errhandler_fn * function, MPI_Errhandler * errhandler) { return MPI_File_create_errhandler(function, errhandler); } EOF cat < mpi2hpconst.$msuf #include /* HP MPI uses const char * instead of char * in the prototypes of the following routines */ int foo(MPI_Info Info, const char *key, const char *value) { return PMPI_Info_set(Info, key, value); } int f1(MPI_Info a, const char * b, int c, char * d, int *e) { return PMPI_Info_get(a,b,c,d,e); } int f2(MPI_Info a, const char *b) { return PMPI_Info_delete(a,b); } int MPI_Info_get_valuelen(MPI_Info a, const char * b, int * c, int * d) { /* above decl triggers an error on T3E */ return PMPI_Info_get_valuelen(a,b,c,d); } EOF cat << EOF > mpistatus.$msuf #include #include int foo(MPI_Fint *status) { MPI_Status s; return MPI_Status_f2c(status, &s); } EOF if [ $machine = sgi64 -a $cxx_compiler = CC ] then orig_useropt="$orig_useropt -64" fi $echo "Checking for thread-safe MPI interface... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi_thread_test.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPI_THREADED" else echo "no" fi if [ -d "$mpiinc/ulm" ] ; then echo "LA-MPI detected, working around broken MPI_Request_c2f()" fixmakeargs="$fixmakeargs LAMPI" fi $echo "Checking for MPI-2 interface... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi2.$msuf 1> /dev/null 2>&1 ; then echo "yes" if [ -r $mpilib/libmpi.so -a -r $mpilib/libmpi++.so -a -r $mpilib/libsma.so -a -r $mpilib/libxmpi.so ] ; then # Don't enable this for SGI Altix. Their MPI2 is not complete echo "SGI MPI detected. Disabling MPI2 wrappers for SGI MPI" elif [ -r $mpilib/libfmpi.so -a -r $mpilib/libmpio.so -a -r $mpilib/libtvscampi.so ] ; then # Scali does not use MPI2 PMPI interface properly. echo "Scali MPI detected. Disabling MPI2 wrappers for Scali MPI" elif [ -r $mpilib/liblam.a -o -r $mpilib/liblam.la ] ; then # LAM MPI's MPI2 PMPI interface is broken. echo "LAM MPI detected. Disabling MPI2 wrappers for LAM MPI" elif [ "$mpilibrary" = "-lscmpi" ] ; then # SiCortex's MPI2 interface is broken. echo "SiCortex detected. Disabling MPI2 wrappers" fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK" elif [ "$tauarch" = "bgp" ] ; then echo "BGP MPI detected. Disabling MPI2 wrappers" fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK" else fixmakeargs="$fixmakeargs MPI2" mpi2=yes fi else echo "no" fi if [ $mpi2 = yes ] ; then $echo "Checking for MPI-2 Grequest interface... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi2grequest.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPIGREQUEST" else echo "no" fi $echo "Checking for MPI-2 MPIO_Request interface... ${nnl}" if [ -f $mpilib/liblam.a -o -f $mpilib/liblammpi++.a ] ; then if $mpicompiler $orig_useropt $mpi_include -c mpi2iorequest.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPIOREQUEST" mpiio=yes else echo "no" fi else echo "no" fi $echo "Checking for MPI_Datarep_conversion_function interface... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi2datarep.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPIDATAREP" else echo "no" fi $echo "Checking for Comm_create_errhandler interface... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi2errhandler.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPIERRHANDLER" else echo "no" fi $echo "Checking if MPI_Info_set takes const char * instead of char * args... ${nnl}" if $mpicompiler $orig_useropt $mpi_include -c mpi2hpconst.$msuf 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs MPICONSTCHAR" else echo "no" fi fi if $mpicompiler $orig_useropt $mpi_include -c mpi2attr.$msuf 1> /dev/null 2>&1 ; then echo "MPI-2 MPI*attr_functions are defined..." fixmakeargs="$fixmakeargs MPIATTR" fi if $mpicompiler $orig_useropt $mpi_include -c mpi2file.$msuf 1> /dev/null 2>&1 ; then echo "MPI-2 MPI_File functions are defined..." fixmakeargs="$fixmakeargs MPIFILE" else echo "MPI-2 MPI_File functions are NOT defined..." echo $mpicompiler $orig_useropt $mpi_include -c mpi2file.$msuf fi if $mpicompiler $orig_useropt $mpi_include -c mpi2typeex.$msuf 1> /dev/null 2>&1 ; then echo "MPI-2 MPI_Type_dup and MPI_Exscan are defined..." fixmakeargs="$fixmakeargs MPITYPEEX" fi if $mpicompiler $orig_useropt $mpi_include -c mpi2add.$msuf 1> /dev/null 2>&1 ; then echo "MPI-2 MPI_Add_error* functions are defined..." fixmakeargs="$fixmakeargs MPIADDERROR" fi if $mpicompiler $orig_useropt $mpi_include -c mpistatus.$msuf 1> /dev/null 2>&1 ; then echo "MPI_Status f2c/c2f found..." else echo "MPI_Status c2f/f2c functions are needed" fixmakeargs="$fixmakeargs MPINEEDSTATUSCONV" fi /bin/rm -rf mpi_thread_test.$msuf mpi_thread_test.o mpi2.$msuf mpi2.o mpi2iorequest.o mpi2iorequest.$msuf mpi2grequest.o mpi2grequest.$msuf mpi2datarep.$msuf mpi2datarep.o mpi2errhandler.o mpi2errhandler.$msuf mpi2hpconst.o mpi2hpconst.$msuf mpi2attr.o mpi2attr.$msuf mpi2typeex.o mpi2typeex.$msuf mpi2add.o mpi2add.$msuf mpistatus.o mpistatus.$msuf mpi2file.$msuf mpi2file.o else fixmakeargs="$fixmakeargs mpiincargs=$mpiincargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs mpilib=$mpilib" fi if [ $mpi = yes ] ; then wrapperlib="-L$tautoplevel/$machine/lib -lTauMpi\$(TAU_CONFIG)" # Epilog if [ $epilog = yes -a $mpi = yes ] ; then if [ $sicortex = yes ] ; then wrapperlib="-L$epiloglibdir -Wl,-whole-archive -lelg.mpi -Wl,-no-whole-archive" else wrapperlib="-L$epiloglibdir -lelg.mpi" fi if [ $openmp = yes ] ; then if [ $sicortex = yes ] ; then wrapperlib="-L$epiloglibdir -Wl,-whole-archive -lelg.ompi -Wl,-no-whole-archive -Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic" else wrapperlib="-L$epiloglibdir -lelg.ompi" fi fi fi # VampirTrace if [ $vampirtrace = yes ] ; then if [ $vampirtraceshow = yes ] ; then wrapperlib="\$(VAMPIRTRACEMPILIBS)" else vtfortranwrapper="" if [ -f $vampirtracedir/$vampirtracelibdir/libvt.fmpi.a ] ; then vtfortranwrapper="-lvt.fmpi" fi if [ -f $vampirtracedir/$vampirtracelibdir/libvt-fmpi.a ] ; then vtfortranwrapper="-lvt-fmpi" fi vtmpilib="-lvt.mpi" if [ -f "$vampirtracedir/$vampirtracelibdir/libvt-mpi.a" ] ; then vtmpilib="-lvt-mpi" fi vtompilib="-lvt.ompi" if [ -f "$vampirtracedir/$vampirtracelibdir/libvt-ompi.a" ] ; then vtompilib="-lvt-ompi" fi wrapperlib="-L$tautoplevel/$machine/lib -ltau\$(TAU_CONFIG) -L$vampirtracedir/$vampirtracelibdir $vtfortranwrapper $vtmpilib -lotf -lz" if [ $openmp = yes ] ; then # should we have a -lvt.fmpi here? fixmakeargs="useropt=$useropt extrashlibopts=$extrashlibopts $fixmakeargs" if [ $sicortex = yes ] ; then wrapperlib="$sicortexlink" else wrapperlib="-L$tautoplevel/$machine/lib -ltau\$(TAU_CONFIG) -L$vampirtracedir/$vampirtracelibdir -Wl,-whole-archive $vtfortranwrapper $vtompilib -lotf -Wl,-no-whole-archive -lz" fi fi fi fi if [ $scorep = yes ] ; then wrapperlib="\$(SCOREPMPILIBS)" fi if [ $perf = yes ] ; then wrapperlib="-L$\(PERFLIBDIR) \$(PERFLIBRARY)" fi mpilibargs=$wrapperlib wrapperC=$wrapperlib if [ "x$mpilib" != "x" ] ; then if [ -d $mpilib ] ; then #echo "Lib dir found. adding -L$mpilib to LIB" mpilibargs="$mpilibargs -L$mpilib" if [ -r $mpilib/libmpi_r.a -a -r $mpilib/libmpi.a ] ; then fixmakeargs="$fixmakeargs IBMMPI" ibmmpi=yes fi if [ -f $mpilib/libfmpi.a -o -f $mpilib/libfmpi.so ] ; then #echo "Fortran fmpi.* found" mpiflibargs="-L$mpilib -lfmpi $wrapperlib" else if [ $epilog = yes -a -f $epiloglibdir/libfmpi.a ] ; then mpiflibargs="-lfmpi" wrapperlib="$wrapperlib -lfmpi" fi if [ $epilog = yes -a -f $epiloglibdir/libelgfmpi.a ] ; then mpiflibargs="-lelgfmpi" wrapperlib="$wrapperlib -lelgfmpi" fi if [ $epilog = yes -a -f $epiloglibdir/libepk.ad.fmpi.a ] ; then mpiflibargs="-lepk.ad.fmpi" wrapperlib="$wrapperlib -lepk.ad.fmpi" fi if [ $epilog = yes -a -f $epiloglibdir/libcubew3.a ] ; then wrapperlib="$wrapperlib -lcubew3" fi if [ -f $mpilib/libfmpich.cnk.a -o -f $mpilib/libfmpich.cnk.so ] ; then mpiflibargs="-lfmpich.cnk" # wrapperlib="$wrapperlib -lfmpich.cnk" fi if [ -f $mpilib/libfmpich.a -o -f $mpilib/libfmpich.so ] ; then #echo "Fortran fmpich.* found" if [ $mpi2 = "yes" ] ; then #mpich2, must not use -lfmpich if [ -f /usr/lib/librt.a -a $catamount = no ] ; then # mpich2 uses librt for aio_* routines mpiflibargs="-L$mpilib $wrapperlib -lpthread -lrt" mpilibargs="$mpilibargs -lpthread -lrt" else mpiflibargs="-L$mpilib $wrapperlib" fi else #mpich1, must use -lfmpich mpiflibargs="-L$mpilib -lfmpich $wrapperlib" fi # Does MPI_Init have weak bindings for Fortran (Infiniband MPI) weakmpi=T # by default it has a T for defined symbol in nm output */ weakmpi=`nm $mpilib/libfmpich.a | grep mpi_init | awk '{ print $2 ; }' | head -n 1 ` if [ "x$weakmpi" = "xW" ] then echo "MPI has weak bindings for mpi_init Fortran bindings..." fixmakeargs="$fixmakeargs WEAKMPIINIT" fi else if [ -f $mpilib/liblamf77mpi.a -o -f $mpilib/liblamf77mpi.so ] ; then #echo "Fortran liblamf77mpi.* found" mpiflibargs="-L$mpilib -llamf77mpi $wrapperlib" else if [ -f $mpilib/libmpi_f77.so ] ; then #echo "Fortran libmpi_f77.* found" mpiflibargs="-L$mpilib -lmpi_f77 $wrapperlib" else #echo "No Fortran interface found" mpiflibargs="$mpiflibargs $wrapperlib -L$mpilib" fi fi fi fi # Cases if [ -r $mpilib/libmpi.a -o -r $mpilib/libmpi.so -o -r $mpilib/libmpi.dylib ] ; then #echo "libmpi.* found!!" if [ "x$mpilibrary" = "xno" ] ; then mpilibrary=-lmpi if [ -r $mpilib/libmpi++.so ] ; then mpilibrary='-lmpi -lmpi++' # SGI MPT fi # OpenMPI if [ -r $mpilib/libmpi_cxx.so -o -r $mpilib/libmpi_cxx.dylib ] ; then mpilibrary='-lmpi -lmpi_cxx' fi if [ -r $mpilib/libmpi_f90.so -o -r $mpilib/libmpi_f90.dylib ] ; then mpilibrary="$mpilibrary -lmpi_f90" fi if [ -r $mpilib/libmpi_f77.so -o -r $mpilib/libmpi_f77.dylib ] ; then mpilibrary="$mpilibrary -lmpi_f77" fi if [ -r $mpilib/libopen-pal.a -a ! -r $mpilib/libmpi_cxx.so ]; then echo "NOTE: OpenMPI configured with --disable_shared" mpilibrary='-lmpi_cxx -lmpi -lopen-rte -lopen-pal -lrt -ldl -lpthread -lutil' # check for -libverbs, sometimes necessary with OpenMPI if [ -r /usr/lib64/libibverbs.a -o -r /usr/lib64/libibverbs.so ] ; then mpilibrary="$mpilibrary -libverbs" fi # check for -libverbs, sometimes necessary with OpenMPI if [ -r /usr/lib64/libnuma.a -o -r /usr/lib64/libnuma.so ] ; then mpilibrary="$mpilibrary -lnuma" fi if [ -r $mpilib/libmpi_f90.a ] ; then mpilibrary="$mpilibrary -lmpi_f90" fi if [ -r $mpilib/libmpi_f77.a ] ; then mpilibrary="$mpilibrary -lmpi_f77" fi fi # See if threaded MPI should be used on AIX if [ $ibmxlc_r = yes -a -r $mpilib/libmpi_r.a ] ; then mpilibrary="-lmpi_r $additional_mpilibs" fi fi if [ -r $mpilib/libpmpi.a -o -r $mpilib/libpmpi.so ] ; then #echo "libpmpi.* found " mpilibargs="$mpilibargs -lpmpi $mpilibrary" mpiflibargs="$mpiflibargs -lpmpi $mpilibrary" else #echo "libpmpi.* not found -lmpi probably contains PMPI routines" mpilibargs="$mpilibargs $mpilibrary" mpiflibargs="$mpiflibargs $mpilibrary" fi else #echo "libmpi.* not found!! Checking for mpich.*..." if [ -r $mpilib/libmpich.a -o -r $mpilib/libpmpich.so -o -r $mpilib/libmpich.rts.a -o -r $mpilib/libmpich.cnk.a ] ; then fixmakeargs="$fixmakeargs MPICH_IGNORE_CXX_SEEK" if [ $mpi2 = yes ] ; then fixmakeargs="$fixmakeargs MPICH2_MPI_INPLACE" fi #echo "MPICH found " if [ "x$mpilibrary" = "xno" ] ; then if [ -r $mpilib/libmpich.rts.a ] ; then # For BG/L mpilibrary="-lmpich.rts $additional_mpilibs" else if [ -r $mpilib/libmpich.cnk.a ]; then # For BG/P mpilibrary="-lmpich.cnk $additional_mpilibs" else mpilibrary=-lmpich fi fi fi if [ -r $mpilib/libpmpich++.a -o -r $mpilib/libpmpich++.so ] ; then #echo "pmpich++ found" mpilibrary="-lpmpich++ $mpilibrary" fi if [ -r $mpilib/libmpichcxx.a -o -r $mpilib/libmpichcxx.so ] ; then #echo "mpichcxx found" mpilibrary="-lmpichcxx $mpilibrary" fi if [ -r $mpilib/libpmpich.a -o -r $mpilib/libpmpich.so ] ; then #echo "pmpich found" mpilibargs="$mpilibargs -lpmpich $mpilibrary" mpiflibargs="$mpiflibargs -lpmpich $mpilibrary" else #echo "pmpich not found" mpilibargs="$mpilibargs $mpilibrary" mpiflibargs="$mpiflibargs $mpilibrary" fi if [ -r /usr/lib/librt.a -o -r /usr/lib/librt.so ] ; then #echo "librt found" mpilibargs="$mpilibargs -lrt" mpiflibargs="$mpiflibargs -lrt" fi if [ -r /usr/lib64/libibverbs.a -o -r /usr/lib64/libibverbs.so ] ; then #echo "libibverbs found" mpilibargs="$mpilibargs -libverbs" mpiflibargs="$mpiflibargs -libverbs" fi if [ -r $mpilib/libscdma.a -a -r $mpilib/libpmi.a ] ; then # echo "add -lscdma -lpmi to the SiCortex link line" mpilibargs="$mpilibargs -lscdma -lpmi" mpiflibargs="$mpiflibargs -lscdma -lpmi" fi else if [ "x$mpilibrary" != "xno" ] ; then mpilibargs="$mpilibargs $mpilibrary" mpiflibargs="$mpiflibargs $mpilibrary" fi fi fi # libmpi.* found. But libpmpi* not found. # both found. # libmpi.* not found - look for libmpich.* # For fortran libfmpich.* look for libpmpi # Check for libmpio.a if [ -r $mpilib/libmpio.a ] then mpilibargs="$mpilibargs -lmpio" mpiflibargs="$mpiflibargs -lmpio" fi # Special check for LAM MPI if [ -r $mpilib/liblam.a ] then echo "This looks like a LAM MPI installation. Adding -llam to link command line" if [ -r $mpilib/liblammpi++.a ] ; then mpilibargs="$mpilibargs -llammpi++ -lmpi" mpiflibargs="$mpiflibargs -llammpi++ -lmpi" fi mpilibargs="$mpilibargs -llam" mpiflibargs="$mpiflibargs -llam" if [ -f /usr/lib/libutil.a ] then # This is a Linux box, add -lutil to the mpi libraries echo "Adding -lutil to link command line for LAM MPI" mpilibargs="$mpilibargs -lutil -ldl -lpthread" mpiflibargs="$mpiflibargs -lutil -ldl -lpthread" fi fi # Special check for Intel MPI if [ -r $mpilib/libmpiif.a ] then echo "This looks like an Intel MPI installation." mpilibargs="$mpilibargs -lmpiif -ldl -lrt" mpiflibargs="$mpiflibargs -lmpiif -ldl -lrt" fi # Special check for HPMPI if [ -r $mpilib/libmpi_hmp.a ] ; then echo "This looks like an HP/MPI installation." mpilibargs="$mpilibargs -ldl" mpiflibargs="$mpiflibargs -ldl" fi # Special check for ChaMPIon/Pro if [ -r $mpilib/libcmpi.a ] ; then echo "This looks like a ChaMPIon/Pro installation." mpiextraargs=`cmpicc -v -echo | cut -c8- ` mpilibargs="$mpilibargs $mpiextraargs" mpiflibargs="$mpiflibargs $mpiextraargs -lcmpi_fort" fi # Special check for VMI [NCSA] MPICH if [ -r $mpilib/libvmi.a ] ; then echo "This looks like a VMI MPICH installation. Adding -lvmi -lpthread -ldl to link command line" mpilibargs="$mpilibargs -lvmi -lpthread -ldl" mpiflibargs="$mpiflibargs -lvmi -lpthread -ldl" fi mpilibargs=`echo $mpilibargs | sed -e 's/ /#/g'` mpiflibargs=`echo $mpiflibargs | sed -e 's/ /#/g'` if [ $papipfm = yes -a "x$mpilib" = "x/usr/lib" ] ; then echo "NOTE: Adding -L before -L to use PAPI's libpfm" mpilibargs="-L$papidir/$\(PAPISUBDIR\)#$mpilibargs" mpiflibargs="-L$papidir/$\(PAPISUBDIR\)#$mpiflibargs" fi fixmakeargs="$fixmakeargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs mpilib=$mpilib" # now throw in non-wrapped MPI library lines wrapperF=$wrapperlib nowrapC=`echo $wrapperC | sed -e 's/ /#/g'` nowrapF=`echo $wrapperF | sed -e 's/ /#/g'` notaumpilibargs=`echo $mpilibargs | sed -e "s@$nowrapC@@"` notaumpiflibargs=`echo $mpiflibargs | sed -e "s@$nowrapF@@"` fixmakeargs="$fixmakeargs mpinowraplibargs=$notaumpilibargs mpinowrapflibargs=$notaumpiflibargs mpilib=$mpilib" # Check to see if the MPI library contains a _r mpithreadtest=`echo $mpilibrary | sed -e 's/_r//'` if [ "y$mpithreadtest" = "y$mpilibrary" ] ; then echo "NOTE: MPI library does not have a threaded _r suffix " else echo "NOTE: MPI library has a threaded _r suffix " fixmakeargs="$fixmakeargs MPI_R_SUFFIX" fi # mpi _r check fi # If -d mpilib fi else # if mpilib is specified if [ $openmp = yes ] ; then if [ $epilog = yes ] ; then wrapperlib="-L$epiloglibdir#-lelg.omp#-ldl" if [ -f $epiloglibdir/libcubew3.a ] ; then wrapperlib="$wrapperlib#-lcubew3" fi fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs" elif [ $vampirtrace = yes ] ; then wrapperlib="-L$vampirtracedir/$vampirtracelibdir#-Wl,-whole-archive#-lvt.omp#-lotf#-Wl,-no-whole-archive#-lz#-ldl" fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs" fi else if [ $epilog = yes ] ; then wrapperlib="-L$epiloglibdir#-lelg.ser#-ldl" if [ -f $epiloglibdir/libcubew3.a ] ; then wrapperlib="$wrapperlib#-lcubew3" fi fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs" elif [ $vampirtrace = yes ] ; then wrapperlib="-L$vampirtracedir/$vampirtracelibdir#-lvt#-lotf#-lz#-Wl,-Bstatic#-lbfd#-liberty#-Wl,-Bdynamic#-ldl" fixmakeargs="extrashlibopts=$wrapperlib $fixmakeargs" fi fi fi # Special magic for xt3 and craycnl if [ $mpi = yes ] ; then if [ "x$machine" = "xxt3" -o "x$machine" = "xcraycnl" ] ; then if [ $epilog = no -a $vampirtrace = no ] ; then mpilibargs="-L$tautoplevel/$machine/lib#-lTauMpi\$(TAU_CONFIG)" mpiflibargs=$mpilibargs fixmakeargs="$fixmakeargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs" else mpilibargs="" mpiflibargs=$mpilibargs fixmakeargs="$fixmakeargs mpilibargs=$mpilibargs mpiflibargs=$mpiflibargs" fi fi fi ##################################################################### # Test for C++ string library ##################################################################### $echo "Checking for standard C++ library ... ${nnl}" cat < /tmp/tau$$.C #include #include #include #include using std::string; using std::vector; using std::pair; using std::list; using std::map; void foo(void) { string s1; return; } EOF if $cxx_compiler -c /tmp/tau$$.C 1> /dev/null 2>&1 ; then echo "yes" stdcxxlib=yes else echo "no (using instead)" fi rm -f /tmp/tau$$.C tau$$.o ##################################################################### # Check Runtime type info ##################################################################### cat < get_typeinfo1.C #include using std::type_info; #ifdef __GNUC__ #include using namespace std; #endif /* GNUC */ EOF $echo "Checking if C++ compiler supports Std Runtime Type Information... ${nnl}" if $cxx_compiler $orig_useropt -c get_typeinfo1.C 1> /dev/null 2>&1 ; then echo "yes" else echo "no" cat < get_typeinfo2.C #include EOF $echo "Checking if C++ compiler supports Runtime Type Information (RTTI)... ${nnl}" if $cxx_compiler $orig_useropt -c get_typeinfo2.C 1> /dev/null 2>&1 ; then echo "yes" fixmakeargs="$fixmakeargs RTTI" else echo "no" fixmakeargs="$fixmakeargs NORTTI" fi fi rm -f get_typeinfo1.C get_typeinfo2.C get_typeinfo*.o *.ti *.ii ##################################################################### # Check if the open call accepts O_LARGEFILE ##################################################################### cat << EOF > f1.c #define _LARGEFILE64_SOURCE 1 #include #include #include int main(int argc, char** argv) { int file = open ("asdf", O_LARGEFILE, 0600); } EOF $echo "Checking if open takes O_LARGEFILE... ${nnl}" if $c_compiler $orig_useropt -c f1.c 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs TAU_LARGEFILE" echo "yes" else echo "no" fi /bin/rm -f f1.o f1.c ########################################################################## # Check if weak symbols are supported ########################################################################## cat < tau_weak_test.c #pragma weak omp_get_thread_num=tau_omp_get_thread_num int tau_omp_get_thread_num() { return 0; } EOF $echo "Checking for weak symbols... ${nnl}" if $c_compiler $orig_useropt tau_weak_test.c -c 1> /dev/null 2>&1 ; then weakfound=`nm tau_weak_test.o | awk '{ print $2 ; }' | head -n 1` if [ "x$weakfound" = "xW" ] ; then echo "yes" fixmakeargs="$fixmakeargs TAU_WEAK_SUPPORTED" else echo "no" fi else echo "no" fi /bin/rm -f tau_weak_test.o tau_weak_test.c ########################################################################## ###################################################################### # Install BFD if requested ###################################################################### if [ "x$bfd" = "xyes" ] ; then if [ "x$bfddir" = xdownload ] ; then bfddir=${targetdir}/${architecture}/binutils-2.20 if [ -r "$bfddir/lib/libbfd.a" ] ; then echo "BFD download already found, skipping" else tempdir=".tmp_bfdbuild_$$" mkdir $tempdir cd $tempdir if [ "$machine" = "apple" ] ; then curl http://www.cs.uoregon.edu/research/paracomp/tau/tauprofile/dist/binutils-2.20.tar.gz > binutils-2.20.tar.gz else wget http://www.cs.uoregon.edu/research/paracomp/tau/tauprofile/dist/binutils-2.20.tar.gz fi tar -xzf binutils-2.20.tar.gz cd binutils-2.20 if [ $machine = "bgp" ] ; then ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --prefix=$bfddir CC=powerpc-bgp-linux-gcc CXX=powerpc-bgp-linux-g++ --disable-nls --disable-werror # have to run make twice, first one dies with illegal instruction make make make install else ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --prefix=$bfddir --disable-nls --disable-werror make && make install fi cp include/demangle.h $bfddir/include cp include/libiberty.h $bfddir/include # snow leopard if [ -r "$bfddir/lib/x86_64/libiberty.a" ] ; then mv $bfddir/lib/x86_64/libiberty.a $bfddir/lib/libiberty.a fi cd .. cd .. rm -rf $tempdir fi fi bfdinclude="-I$bfddir/include" bfdlink="-L$bfddir/lib -L$bfddir/lib64" fixmakeargs="$fixmakeargs bfdinclude=$bfdinclude" fixmakeargs="$fixmakeargs bfdlink=-L$bfddir/lib#-L$bfddir/lib64" if [ ! -d $bfddir ] ; then echo "Error: Cannot access BFD directory $bfddir" exit 1 fi else fixmakeargs="$fixmakeargs bfdinclude= bfdlink= " fi ###################################################################### # Check for BFD ###################################################################### cat < conftest_bfd.c #include void foo() { bfd_init(); bfd *BfdImage = bfd_openr("/proc/self/exe", 0); return; } EOF $echo "Checking for bfd.h... ${nnl}" if $c_compiler $orig_useropt -c conftest_bfd.c $bfdinclude 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs TAU_BFD" echo "yes" else echo "no" fi /bin/rm -f conftest_bfd.o conftest_bfd.c ###################################################################### ###################################################################### # Check what is needed for linking with BFD ###################################################################### cat < conftest_bfd.c #include int main(int argc, char **argv) { bfd_init(); bfd *BfdImage = bfd_openr("/proc/self/exe", 0); return; } EOF $echo "Checking for linking dependencies for libbfd... ${nnl}" BFDLIBS="-lbfd" bfd_worked="no" if $c_compiler $orig_useropt -o conftest_bfd conftest_bfd.c -fPIC $bfdinclude $bfdlink $BFDLIBS 1> /dev/null 2>&1 ; then bfd_worked="yes" else BFDLIBS="-lbfd -liberty" if $c_compiler $orig_useropt -o conftest_bfd conftest_bfd.c -fPIC $bfdinclude $bfdlink $BFDLIBS 1> /dev/null 2>&1 ; then bfd_worked="yes" else BFDLIBS="-lbfd -liberty -lz" if $c_compiler $orig_useropt -o conftest_bfd conftest_bfd.c -fPIC $bfdinclude $bfdlink $BFDLIBS 1> /dev/null 2>&1 ; then bfd_worked="yes" fi fi fi if [ $bfd_worked = "no" ] ; then echo "failed" BFDLIBS="-lbfd -liberty" else echo $BFDLIBS fi BFDLIBS=`echo $BFDLIBS | sed -e 's/ /#/g'` fixmakeargs="$fixmakeargs bfdlibs=$BFDLIBS" /bin/rm -f conftest_bfd.o conftest_bfd.c conftest_bfd ###################################################################### ###################################################################### # Check for demangle.h ###################################################################### cat < conftest_demangle.c #include void foo() { char *bar; bar = cplus_demangle(0, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE | DMGL_TYPES); return; } EOF $echo "Checking for demangle.h... ${nnl}" demangle="" if $c_compiler $orig_useropt -c conftest_demangle.c $bfdinclude 1> /dev/null 2>&1 ; then demangle="-DHAVE_GNU_DEMANGLE" fixmakeargs="$fixmakeargs TAU_DEMANGLE" echo "yes" else echo "no" fi /bin/rm -f conftest_demangle.o conftest_demangle.c ###################################################################### # Check if BFD can be linked into a shared library ###################################################################### cat < conftest_bfd.c #include # if defined(HAVE_GNU_DEMANGLE) && HAVE_GNU_DEMANGLE # include # endif /* HAVE_GNU_DEMANGLE */ void foo() { bfd_init(); bfd *BfdImage = bfd_openr("/proc/self/exe", 0); #if defined(HAVE_GNU_DEMANGLE) && HAVE_GNU_DEMANGLE cplus_demangle(NULL, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE | DMGL_TYPES); #endif /* HAVE_GNU_DEMANGLE */ return; } EOF $echo "Checking for shared library compatible libbfd... ${nnl}" shared_opt="-shared -fPIC" bfdlibs=`echo $BFDLIBS | sed -e 's/#/ /g'` if $c_compiler $demangle $orig_useropt $shared_opt -o conftest_bfd.so conftest_bfd.c -fPIC $bfdinclude $bfdlink $bfdlibs 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs TAU_BFDSHAREDLINK" echo "yes" else echo "no" fi /bin/rm -f conftest_bfd.o conftest_bfd.c conftest_bfd.so ###################################################################### ###################################################################### # Check for tr1/unordered_map ###################################################################### cat < conftest_hash_map.cc #include int main() { std::tr1::unordered_map theMap; theMap[5] = 6; std::tr1::unordered_map::const_iterator it; } EOF $echo "Checking for tr1/unordered_map... ${nnl}" if $cxx_compiler $orig_useropt -c conftest_hash_map.cc 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs TAU_TR1_HASH_MAP" echo "yes" else echo "no" fi /bin/rm -f conftest_hash_map.o conftest_hash_map.cc ###################################################################### # Check for pthread wrappable routines ###################################################################### if [ $pthread = yes ] ; then cat < conftest_pthread.c #include void foo() { int rc; pthread_mutexattr_t mta; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_spinlock_t spinlock; pthread_barrier_t barrier; pthread_cond_t cond; rc = pthread_mutexattr_init(&mta); rc = pthread_mutex_init(&mutex, NULL); rc = pthread_mutex_lock(&mutex); rc = pthread_mutex_unlock(&mutex); rc = pthread_mutex_destroy(&mutex); rc = pthread_spin_init(&spinlock, PTHREAD_PROCESS_SHARED); rc = pthread_spin_lock(&spinlock); rc = pthread_spin_unlock(&spinlock); rc = pthread_spin_destroy(&spinlock); rc = pthread_cond_init(&cond, NULL); rc = pthread_cond_broadcast(&cond); rc = pthread_cond_wait(&cond, &mutex); rc = pthread_cond_signal(&cond); rc = pthread_cond_destroy(&cond); rc = pthread_barrier_init(&barrier, NULL, 0); rc = pthread_barrier_wait(&barrier); } EOF $echo "Checking for pthread wrappable routines... ${nnl}" if $c_compiler $orig_useropt -c conftest_pthread.c $bfdinclude 1> /dev/null 2>&1 ; then fixmakeargs="$fixmakeargs TAU_PTHREAD_WRAP" echo "yes" else echo "no" fi /bin/rm -f conftest_pthread.o conftest_pthread.c fi ###################################################################### if [ $pthread = yes ] ; then fixmakeargs="$fixmakeargs PTHREAD_AVAILABLE ptdir=$ptdir" tauoptions="${tauoptions}-pthread" fi if [ $papithread = yes ] ; then if [ $papi = no ] ; then echo "" echo "Error: To use the PAPI thread layer, you must specify -papi=" echo "" exit fi if [ ! `uname -s ` = Linux ] ; then echo "" echo "Error: The PAPI thread layer only works on Linux" echo "" exit fi fixmakeargs="$fixmakeargs TAU_PAPI_THREADS" tauoptions="${tauoptions}-papithread" fi if [ $charm = yes ] ; then fixmakeargs="$fixmakeargs TAU_CHARM charmdir=$charmdir" tauoptions="${tauoptions}-charm" fi if [ $compensate = yes ] ; then fixmakeargs="$fixmakeargs COMPENSATE" tauoptions="${tauoptions}-compensate" fi if [ $sproc = yes ] ; then fixmakeargs="$fixmakeargs TAU_SPROC" tauoptions="${tauoptions}-sproc" fi if [ $python = yes ] ; then fixmakeargs="$fixmakeargs PYTHON pythoninc=$pythoninc pythonlib=$pythonlib" tauoptions="${tauoptions}-python" if [ $machine = rs6000 -a "x$pythonlib" = "x" ] ; then echo "ERROR: For IBM systems, please specify the -pythonlib= flag where *.py files and the config directory are located!" exit 1 fi fi if [ $zepto = yes ] ; then tauoptions="${tauoptions}-zepto" fi if [ $ktau = yes ] ; then fixmakeargs="$fixmakeargs KTAU ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym" tauoptions="${tauoptions}-ktau" fi if [ $ktau_merge = yes ] ; then fixmakeargs="$fixmakeargs KTAU_MERGE ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym" tauoptions="${tauoptions}-ktau_merge" fi if [ $ktau_shctr = yes ] ; then fixmakeargs="$fixmakeargs KTAU_SHCTR ktauinc=$ktauinc ktauincuser=$ktauincuser ktaulib=$ktaulib ktausym=$ktausym" tauoptions="${tauoptions}-ktau_shctr" fi if [ $vtf = yes ] ; then fixmakeargs="$fixmakeargs VTF vtfdir=$vtfdir" fi if [ $otf = yes ] ; then fixmakeargs="$fixmakeargs OTF otfdir=$otfdir" if [ ! -d $otfdir/${architecture} ] ; then fixmakeargs="$fixmakeargs OTFSRC" fi fi if [ $pdt_cxx_compiler != default ] ; then # Check if they specified -pdt_c++=/usr/bin/g++ instead of just g++ if [ "x$pdt_cxx_full_path" != "x$pdt_cxx_compiler" ] ; then pdt_cxx_used=$pdt_cxx_full_path else pdt_cxx_used=$pdt_cxx_compiler fi fixmakeargs="$fixmakeargs PDTCXX pdtcxx=$pdt_cxx_used" if [ $machine = sgi8k -o $machine = sgin32 -o $machine = sgi64 ] ; then if [ $pdt_cxx_compiler = CC ] ; then fixmakeargs="$fixmakeargs PDTSGICC" fi fi fi if [ $pdt = yes ] ; then fixmakeargs="$fixmakeargs PDT pdtdir=$pdtdir" tauoptions="${tauoptions}-pdt" if [ $pdtcompdir != unknown ] ; then fixmakeargs="$fixmakeargs PDTARCH pdtcompdir=$pdtcompdir" fi if [ $pdtarchdir != unknown ] ; then fixmakeargs="$fixmakeargs PDTARCHITECTURE pdtarchdir=$pdtarchdir" fi # Check if PDT has Fortran statement level information cat < checkpdt.cpp #include int IsFortranDoStatement(pdbStmt::stmt_t k) { if (k == pdbStmt::ST_FDO) return 1; else return 0; } EOF if [ $machine = alpha -a $cxx_compiler = cxx ]; then orig_useropt="$orig_useropt -x c++ -D__USE_STD_IOSTREAM" fi if $cxx_compiler $orig_useropt -I$pdtdir/include -c checkpdt.cpp 1> /dev/null 2>&1 ; then echo "PDT supports Fortran Loop Level information" else echo "IMPORTANT NOTE: Your PDT does not support Fortran Loop Level information." echo "***************You may want to upgrade to a newer release." echo "See http://www.cs.uoregon.edu/research/pdt" fixmakeargs="$fixmakeargs PDTNOFSTMTS" fi /bin/rm -f checkpdt.o checkpdt.cpp fi if [ $vampirtrace = yes ]; then cat <vttest.cpp #include "Profile/Profiler.h" #include "Profile/TauVampirTrace.h" int foo(void) { uint64_t x; return 0; } EOF if $cxx_compiler $orig_useropt -Iinclude -I$vampirtracedir/include -c vttest.cpp -DTRACING_ON -DTAU_DOT_H_LESS_HEADERS 1> /dev/null 2>&1 ; then echo "VampirTrace check successful" else echo "Using VampirTrace options for compiling" fixmakeargs="$fixmakeargs VAMPIRTRACEINTS" fi /bin/rm -f vttest.cpp vttest.o fi if [ $java = yes ] ; then fixmakeargs="$fixmakeargs JAVA jdkdir=$jdkdir" fi if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs OPENMP" tauoptions="${tauoptions}-openmp" fi if [ $opari = yes ] ; then fixmakeargs="$fixmakeargs KOJAKOPARI" fixmakeargs="$fixmakeargs OPARI oparidir=$oparidir" tauoptions="${tauoptions}-opari" fi if [ $vampirtrace = yes ] ; then fixmakeargs="$fixmakeargs VAMPIRTRACE vampirtracedir=$vampirtracedir" tauoptions="${tauoptions}-vampirtrace" if [ $mpi = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs VAMPIRTRACEOMPI" else fixmakeargs="$fixmakeargs VAMPIRTRACEMPI" fi else if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs VAMPIRTRACEOMP" fi fi fi if [ $scorep = yes ] ; then fixmakeargs="$fixmakeargs SCOREP scorepdir=$scorepdir" tauoptions="${tauoptions}-scorep" scorepCommonLibs="-lbfd#-liberty#-lotf2#-lsilc_utilities" if [ $mpi = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs SCOREPOMPI" scorepLibs="-L${scorepdir}/lib#-lsilc_mpi#$scorepCommonLibs" else fixmakeargs="$fixmakeargs SCOREPMPI" scorepLibs="-L${scorepdir}/lib#-lsilc_mpi#$scorepCommonLibs" fi else if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs SCOREPOMP" scorepLibs="-L${scorepdir}/lib#-lsilc_serial#$scorepCommonLibs" else scorepLibs="-L${scorepdir}/lib#-lsilc_serial#$scorepCommonLibs" fi fi fixmakeargs="$fixmakeargs scorepmpilibs=$scorepLibs" fixmakeargs="$fixmakeargs scoreplibs=$scorepLibs" fixmakeargs="$fixmakeargs scorepincs=-I$scorepdir/include" fi if [ $epilog = yes ] ; then if [ -f $epiloglibdir/libcubew3.a ] ; then epilogextralinkcmd="$epilogextralinkcmd#-lcubew3" fi if [ -f $epiloglibdir/libepk.util.a ] ; then epilogextralinkcmd="$epilogextralinkcmd#-lepk.util" fi if [ $scalasca = yes -a -f /usr/lib/libswclock.a ] ; then epilogextralinkcmd="$epilogextralinkcmd#-lswclock" fi if [ -f $epiloglibdir/libsz.a ] ; then epilogextralinkcmd="$epilogextralinkcmd#-lsz" fi if [ -f $epiloglibdir/libsc.z.a ] ; then epilogextralinkcmd="$epilogextralinkcmd#-lsc.z" fi fixmakeargs="$fixmakeargs EPILOG epilogdir=$epilogdir epiloglibdir=$epiloglibdir epilogbindir=$epilogbindir epilogextralinkcmd=$epilogextralinkcmd epilogincdir=$epilogincdir" tauoptions="${tauoptions}-epilog" if [ $scalasca = yes ] ; then tauoptions="${tauoptions}-scalasca" fi if [ $mpi = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs EPILOGOMPI" else fixmakeargs="$fixmakeargs EPILOGMPI" fi else if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs EPILOGOMP" fi fi fi if [ $dyninst = yes ] ; then fixmakeargs="$fixmakeargs DYNINST dyninstdir=$dyninstdir" if [ ! -d $dyninstdir/lib ] ; then fixmakeargs="$fixmakeargs DYNINST41" fi if [ ! -d $dyninstdir/$PLATFORM/lib/libcommon.so ] ; then fixmakeargs="$fixmakeargs DYNINST6" fi if [ `grep isStaticExecutable $dyninstdir/include/* | wc -l` = 0 ]; then fixmakeargs="$fixmakeargs DYNINST_STATIC_REWRITING_UNSUPPORTED" fi if [ ! -d $dyninstdir/src/include -o ! -d $dyninstdir/include ] ; then fixmakeargs="$fixmakeargs DYNINST5.2" fi fi if [ $dwarf = yes ] ; then if [ ! -r $dwarfdir/lib/libdwarf.a ] ; then echo "ERROR: $dwarfdir/lib/libdwarf.a not found" else fixmakeargs="$fixmakeargs dwarfopts=-L$dwarfdir/lib" fi fi if [ $papi = yes ] ; then if [ $pthread = yes -o $openmp = yes ] ; then fixmakeargs="$fixmakeargs PAPIPTHREAD" fi fi if [ $opari = yes ] ; then if [ $pthread = yes -o $smarts = yes -o $java = yes ] ; then echo "ERROR: -opari option requires OpenMP threads package." echo "*****************************************************" exit 1 fi if [ $opari_construct = yes -a $opari_region = no ] ; then fixmakeargs="$fixmakeargs OPARI_CONSTRUCT" fi if [ $opari_construct = no -a $opari_region = yes ] ; then fixmakeargs="$fixmakeargs OPARI_REGION" fi fi if [ $upc = yes ]; then tauoptions="${tauoptions}-upc" # If MPI is used -mpi already appears in the name. If it is not, add it if [ "x$upcnetwork" != "xmpi" ]; then tauoptions="${tauoptions}-$upcnetwork" fi fixmakeargs="$fixmakeargs UPCC upcnetwork=$upcnetwork" fi if [ $trace = yes ] ; then if [ $profile = yes ] ; then tauoptions="${tauoptions}-profile" fi if [ $profilestats = yes ] ; then tauoptions="${tauoptions}-profilestats" fi tauoptions="${tauoptions}-trace" fi if [ $mpitrace = yes ] ; then tauoptions="${tauoptions}-mpitrace" fi if [ $kai = yes ] ; then tauoptions="${tauoptions}-kcc" fi if [ $pgi = yes ] ; then tauoptions="${tauoptions}-pgi" if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs PGIOPENMP" fi fi if [ $intel = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs INTELOPENMP" fi fi if [ $gnu = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs GNUOPENMP" fi fi if [ $fortran_compiler = intel ] ; then intelifort=`which ifort 2>/dev/null` if [ "y$intelifort" != "y" ] ; then if [ -x $intelifort ] then echo "Using Intel ifort as the Fortran Compiler" fixmakeargs="$fixmakeargs INTELIFORT" fi fi fi # CHECK if Intel 8.0 compilers are available. if [ $cxx_compiler = icpc ] ; then echo "Checking version (8.0/8.1+) of Intel compilers" # Intel compilers changed from -cxxlib-icc to -cxxlib-gcc (default) in 8.1 cat << EOF > f1.cpp #include using namespace std; extern "C" { void foo(int *x) { cout << "x = "<<*x< f2.c int foo(); int main(int argc, char **argv) { return foo(); } EOF $cxx_compiler -c f1.cpp icc -c f2.c if icc f1.o f2.o -o foo -lcprts 1>/dev/null 2>&1 ; then echo "Intel v8.0 compilers used" else $cxx_compiler -c -cxxlib-icc f1.cpp 1>/dev/null 2>&1 $cxx_compiler -c f1.cpp tau_opt_bits= if [ `uname -m` = x86_64 -a $machine = i386_linux ]; then # if someone is using the 32-bit intel compilers on an x86_64 # then we need to use -m32 with g++ to get the 32-bit libstdc++ tau_opt_bits=-m32 fixmakeargs="$fixmakeargs INTEL32_ON_64" fi taugcclibdir=`g++ $tau_opt_bits -print-libgcc-file-name | sed -e 's,[^/]*$,,'` taugcclib=`g++ $tau_opt_bits -print-libgcc-file-name ` taugcclib2dir=`which g++ | sed s/g++/../` if icc f1.o f2.o -o foo -L$taugcclib2dir/lib -L$taugcclibdir -lstdc++ $taugcclib 1>/dev/null 2>&1 ; then # echo "Confirmed - links with gcc libs" echo "Intel v8.1+ compilers used" if [ "x$taugcclib2dir" != "x/usr/bin/../lib" ] ; then if [ "x$machine" = "xx86_64" ] ; then tauextralibopts="taugcclibopts=-L$taugcclib2dir/lib64" else tauextralibopts="taugcclibopts=-L$taugcclib2dir/lib" fi # Here a different version of gcc is used (other than the one installed in /usr/bin) fi fixmakeargs="$fixmakeargs $tauextralibopts taugcclibdir=$taugcclibdir INTEL81FIX" fi fi /bin/rm -f f1.o f2.o f1.cpp f2.c foo # Check over! fi if [ $cxx_compiler = icpc ] ; then echo "Checking version (10.0+) of Intel compilers" version=`icpc -v 2>&1` t="Version 1" testarg=${version#$t} if [ "y$testarg" != "y$version" ] ; then echo "Intel v10.0+ compilers found" fixmakeargs="$fixmakeargs INTEL10FIX COMPINST_GNU" else echo "Intel v10.0+ compilers NOT found" fi var=`which ifort | sed 's/\/bin\/ifort$//'` libdir="$var/lib" if [ ! -d "$var" ] ; then var=`which ifort | sed 's/\/bin\/intel64\/ifort$//'` libdir="$var/lib/intel64" fi if [ ! -d "$var" ] ; then var=`which ifort | sed 's/\/bin\/ia32\/ifort$//'` libdir="$var/lib/ia32" fi if [ ! -d "$var" ] ; then var=`which ifort | sed 's/\/bin\/ia64\/ifort$//'` libdir="$var/lib/ia64" fi if [ ! -d "$var" ] ; then echo "Error: Unable to identify ifort lib directory" fi fixmakeargs="$fixmakeargs ifortlibdir=$libdir" fi if [ $ibmxlc = yes ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs IBMXLC_OPENMP" fi fi if [ $machine = hitachi ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs HITACHI_OPENMP" fi fi if [ $cxx_compiler = cxx ] ; then if [ $openmp = yes ] ; then fixmakeargs="$fixmakeargs COMPAQCXX_OPENMP" fi if [ $pthread = yes ] ; then fixmakeargs="$fixmakeargs COMPAQCXX_PTHREAD" fi fi if [ $fujitsu = yes ] ; then tauoptions="${tauoptions}-fujitsu" fi if [ $epilog = yes -o $vampirtrace = yes ] ; then if [ $forceshared = no -a $sicortex = no ] ; then disableshared=yes fi fi if [ $disableshared = yes ] ; then fixmakeargs="$fixmakeargs NOSHARED" fi if [ $disableshared = yes -a $python = yes ] ; then echo "ERROR: Shared libraries are disabled, but Python is specified" exit 1 fi if [ $noex = yes ] ; then tauoptions="${tauoptions}-noex" if [ $kai = yes ] ; then fixmakeargs="$fixmakeargs KAINOEX" else # OTHER COMPILERS NO EXCEPTIONS... SGICC needs this fixmakeargs="$fixmakeargs SGICCNOEX" fi fi if [ $hpctoolkit = yes ] ; then tauoptions="${tauoptions}-hpctoolkit" # check to make sure it's the patched version if [ ! -r $hpctoolkit_src_dir/README.TAU ] ; then echo "Didn't find patched HPCToolkit source in $hpctoolkit_src_dir" exit 1 fi hpctoolkit_include="-I${hpctoolkit_src_dir}/src/tool/hpcrun/unwind/common" hpctoolkit_link="-L${hpctoolkit_install_dir}/lib/hpctoolkit#-lcsprof" fixmakeargs="$fixmakeargs HPCTOOLKIT hpctoolkit_include=${hpctoolkit_include} hpctoolkit_link=${hpctoolkit_link}" fi # TAUmon MRNet if [ $mrnet = yes ] ; then if [ $mpi = yes ] ; then fixmakeargs="$fixmakeargs MRNET" fixmakeargs="$fixmakeargs mrnet_root=${mrnet_root}" fixmakeargs="$fixmakeargs mrnet_inc=-I${mrnet_root}/include#-I${mrnet_root}/xplat/include" fixmakeargs="$fixmakeargs mrnet_lib=-L${mrnet_lib}#-lmrnet#-lxplat#-ldl#-lm" else echo "ERROR: MRNet TAUmon transport requires MPI support" exit 1 fi fi if [ $machine = ia64 -o $machine = x86_64 -o $machine = i386_linux -o $machine = craycnl -o $machine = bgp -o $machine = mips -o $machine = mips32 -o $machine = ibm64linux -o $machine = ppc64 ] ; then extra_linker_args="${extralinker_args}#-Wl,--export-dynamic" else if [ $machine = apple ]; then extra_linker_args="${extralinker_args}#-rdynamic" fi fi fixmakeargs="$fixmakeargs extra_linker_args=$extra_linker_args" #### END OF TAU OPTIONS. Make changes above this line fixmakeargs="$fixmakeargs tauoptions=$tauoptions" if [ $use_ansic = yes ] ; then fixmakeargs="$fixmakeargs ANSIC" fi if [ $sicortex = yes ] ; then fixmakeargs="$fixmakeargs SICORTEX extrashlibopts=${sicortexlink}" fi echo "***********************************************************************" echo "Installing utilities..." configure_java if [ ${tauprefix} = unknown ] ; then targetdir=${tauroot} else targetdir=${tauprefix} if [ ! -d ${tauprefix} ] ; then echo "making directory $tauprefix " mkdir -p ${tauprefix} # Copy INSTALL README LICENSE files over there cp README LICENSE CREDITS ${tauprefix} fi if [ ! -d ${tauprefix}/${architecture} ] ; then echo "making directory $tauprefix/$architecture lib bin" mkdir ${tauprefix}/${architecture} mkdir ${tauprefix}/${architecture}/lib mkdir ${tauprefix}/${architecture}/bin else if [ "x$architecture" = "x" ] ; then echo "making directory $tauprefix lib bin" if [ ! -d ${tauprefix}/bin ] ; then mkdir ${tauprefix}/bin fi if [ ! -d ${tauprefix}/lib ] ; then mkdir ${tauprefix}/lib fi fi fi fi BINTARGET=${targetdir}/${architecture}/bin JARTARGET=${targetdir}/${architecture}/lib # Install tau_compiler.sh if [ ! -f /bin/bash ] ; then bashpath=`which bash` if [ ! -f $bashpath ] ; then echo "ERROR: You need a working bash shell in your path to use tau_compiler.sh" echo "Please add bash to your path and re-run configure." echo "**************************************************" else cat ${tauroot}/tools/src/tau_compiler.sh | sed -e 's#/bin/bash#'$bashpath'#' > $BINTARGET/tau_compiler.sh fi else cp ${tauroot}/tools/src/tau_compiler.sh $BINTARGET fi cp ${tauroot}/tools/src/tau_treemerge.pl $BINTARGET cp ${tauroot}/tools/src/tau_javamax.sh $BINTARGET cp ${tauroot}/tools/src/tau_header_replace.pl $BINTARGET cp ${tauroot}/tools/src/tau_exec $BINTARGET cp ${tauroot}/tools/src/tauex $BINTARGET cp ${tauroot}/tools/src/taucc $BINTARGET cp ${tauroot}/tools/src/taucxx $BINTARGET cp ${tauroot}/tools/src/tauf90 $BINTARGET cp ${tauroot}/tools/src/tauex.multiple $BINTARGET cp ${tauroot}/tools/src/tau_cxx.sh $BINTARGET cp ${tauroot}/tools/src/tau_cc.sh $BINTARGET cp ${tauroot}/tools/src/tau_f90.sh $BINTARGET cp ${tauroot}/tools/src/tau_f77.sh $BINTARGET cp ${tauroot}/tools/src/contrib/tcollect10.ini $BINTARGET #copy over tau_header_inst.sh if [ $pdt = yes ] ; then cat ${tauroot}/tools/src/tau_header_inst.sh | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@ARCH@,'$architecture',' \ -e 's,@PDTROOTDIR@,'$pdtdir',' -e 's,@PDTARCH@, '$pdtcompdir',' > ${targetdir}/${architecture}/bin/tau_header_inst.sh chmod a+rx ${targetdir}/${architecture}/bin/tau_header_inst.sh fi # Copy over tau_load.sh if [ $mpi = yes ] ; then cat ${tauroot}/tools/src/tau_load.sh | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau_load.sh chmod a+rx ${targetdir}/${architecture}/bin/tau_load.sh fi if [ $ibmmpi = yes ] ; then cat ${tauroot}/tools/src/tau_poe | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau_poe chmod a+rx ${targetdir}/${architecture}/bin/tau_poe fi cp ${tauroot}/tools/src/jtau_tf/bin/TAU_tf.jar ${targetdir}/${architecture}/lib cp ${tauroot}/tools/src/tau_multimerge/bin/tau_multimerge.jar ${targetdir}/${architecture}/lib cat ${tauroot}/tools/src/contrib/slog2sdk/bin/jumpshot.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/jumpshot chmod a+rx ${targetdir}/${architecture}/bin/jumpshot cat ${tauroot}/tools/src/contrib/slog2sdk/bin/slog2print.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/slog2print chmod a+rx ${targetdir}/${architecture}/bin/slog2print cat ${tauroot}/tools/src/tau2slog2/bin/tau2slog2.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau2slog2 chmod a+rx ${targetdir}/${architecture}/bin/tau2slog2 cat ${tauroot}/tools/src/tau_multimerge/bin/tau_multimerge.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' > ${targetdir}/${architecture}/bin/tau_multimerge chmod a+rx ${targetdir}/${architecture}/bin/tau_multimerge cp ${tauroot}/tools/src/contrib/slog2sdk/lib/jumpshot.jar ${targetdir}/${architecture}/lib cp ${tauroot}/tools/src/contrib/slog2sdk/lib/traceTOslog2.jar ${targetdir}/${architecture}/lib cp ${tauroot}/tools/src/contrib/slog2sdk/lib/slog2printserial.jar ${targetdir}/${architecture}/lib cp ${tauroot}/tools/src/tau2slog2/bin/tau2slog2.jar ${targetdir}/${architecture}/lib cat ${tauroot}/tools/src/tau-config.in | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/tau-config chmod a+rx ${targetdir}/${architecture}/bin/tau-config cp ${tauroot}/tools/src/tauinc.pl ${targetdir}/${architecture}/bin chmod a+rx ${targetdir}/${architecture}/bin/tauinc.pl configure_perfexplorer cat ${tauroot}/tools/src/TauIL/bin/tau_analyze.skel | sed -e 's,@TAUROOTDIR@,'$targetdir',' -e 's,@SHELL@,'$taushell',' -e 's,@ARCH@,'$architecture',' \ > ${targetdir}/${architecture}/bin/tau_analyze chmod a+rx ${targetdir}/${architecture}/bin/tau_analyze cat ${tauroot}/tools/src/TauIL/Makefile.inc.skel | sed -e 's,@TAUROOTDIR@,'$tauroot',' \ > ${tauroot}/tools/src/TauIL/Makefile.inc cp ${tauroot}/tools/src/TauIL/bin/*.jar ${targetdir}/${architecture}/lib cp ${tauroot}/tools/src/tau_throttle.sh ${targetdir}/${architecture}/bin echo "... done" echo "***********************************************************************" # Save the FixMakefile args # Clear any old data grep "^#" ./utils/FixMakefile.info > ./utils/FixMakefile.info~~0 /bin/mv ./utils/FixMakefile.info~~0 ./utils/FixMakefile.info echo $fixmakeargs >> ./utils/FixMakefile.info # Now FINALLY FixMakefile with the string I have built utils/FixMakefile $fixmakeargs # Use default setups, forget everything else (PHB) if [ $machine = default ] ; then /bin/cp ./utils/FixMakefile.sed.default ./utils/FixMakefile.sed /bin/cp ./utils/FixMakefile.info.default ./utils/FixMakefile.info fi sedout="./utils/FixMakefile.sed" echo "Applying script to all Makefiles, please wait, this may take a while..." # Change back to $START_DIR (defined at the top) to ensure we're in the tau2 directory # before we execute this fairly dangerous 'find' command cd $START_DIR for i in `find . -name Makefile -print ` do $echo ".${nnl}" sed -f $sedout < ${i} > ${i}~~0 mv ${i}~~0 ${i} done echo . if [ $tauprefix != unknown ] ; then echo "TAU: Copying include directory to ${tauprefix}" cp -r include ${tauprefix} echo "TAU: Copying man directory to ${tauprefix}" cp -r man ${tauprefix} fi ############################################################################# echo " " echo "***********************************************************************" echo "Configuring TAU Build scripts..." # Modify the Makefiles so include/Makefile is replaced by the TAU options # for specific examples echo "s@include \(.*\)TAUROOTDIR\(.*\)@include $\(TAUROOTDIR\)/$architecture/lib/Makefile.tau$tauoptions@g" > utils/sedexamples.out #echo "s@include/Makefile@$machine/lib/Makefile.tau$tauoptions@g" >utils/sedexamples.out sedex="./utils/sedexamples.out" echo "Modifying Makefiles in the examples subdirectory..." # Prefix start from examples directory pr=examples exampleslist="instrument/Makefile mapping/embedded/Makefile \ mapping/external/Makefile fork/Makefile selectiveAccess/Makefile" if [ $fortran_compiler != no ] ; then exampleslist="$exampleslist fortran/Makefile f90/Makefile" fi # Rules for adding examples follow... # If PDT is specified, then modify the following makefiles if [ $pdt = yes ] ; then exampleslist="$exampleslist autoinstrument/Makefile reduce/Makefile cinstrument/Makefile" if [ $fortran_compiler != no ] ; then exampleslist="$exampleslist selective/Makefile" fi fi # If PDT is specified WITH MPI if [ $pdt = yes -a $mpi = yes ] ; then exampleslist="$exampleslist pdt_mpi/c++/Makefile pdt_mpi/c/Makefile" if [ $pthread = yes ] ; then exampleslist="$exampleslist mixedmode/Makefile" fi if [ $fortran_compiler != no ] ; then exampleslist="$exampleslist pdt_mpi/f90/Makefile" fi fi if [ $mpi = yes ] ; then exampleslist="$exampleslist pi/Makefile mpishlib/Makefile" if [ $fortran_compiler != no ] ; then exampleslist="$exampleslist NPB2.3/config/make.def" fi if [ $openmp = yes ] ; then exampleslist="$exampleslist openmpi/Makefile" fi fi if [ $opari = yes ] ; then exampleslist="$exampleslist opari/c++/Makefile" if [ $pdt = yes -a $fortran_compiler != no ] ; then exampleslist="$exampleslist opari/pdt_f90/Makefile" fi if [ $mpi = yes ] ; then exampleslist="$exampleslist opari/openmpi/Makefile" fi fi if [ $trace = yes ] ; then exampleslist="$exampleslist traceinput/c++/Makefile traceinput/c/Makefile" fi if [ $callpath = yes ] ; then exampleslist="$exampleslist callpath/Makefile" fi if [ $python = yes -o $java = yes -o $dyninst = yes ] ; then # RESET the exampleslist, the C, C++, F90 examples don't matter! exampleslist="" fi if [ $pthread = yes ] ; then exampleslist="$exampleslist threads/Makefile cthreads/Makefile" fi if [ $sproc = yes ] ; then exampleslist="$exampleslist sproc/Makefile" fi if [ $papi = yes ] ; then exampleslist="$exampleslist papi/Makefile multicounter/Makefile" if [ $pthread = yes ] then exampleslist="$exampleslist papithreads/Makefile" fi fi # Modify the Makefiles only if prefix is not specified. if [ $tauprefix = unknown ] ; then for i in $exampleslist do $echo ".${nnl}" sed -f $sedex < $pr/${i} > $pr/${i}~~0 mv $pr/${i}~~0 $pr/${i} done # Copy over the Makefile so make clean works cp include/Makefile $machine/lib/Makefile.tau$tauoptions fi echo . # If it is default, restore to original state if [ "y$1" = "ydefault" ] ; then echo "Fixing examples Makefiles..." echo "s@include \(.*\)TAUROOTDIR\(.*\)@include $\(TAUROOTDIR\)/include/Makefile@g" >utils/sedexamples.out sedex="./utils/sedexamples.out" for i in `find examples -name Makefile -print` examples/NPB2.3/config/make.def do $echo ".${nnl}" sed -f $sedex < ${i} > ${i}~~0 mv ${i}~~0 ${i} done STUB="default" else STUB="$tautoplevel/$architecture/lib/Makefile.tau$tauoptions" fi # replace TAU_MAKEFILE in TAU.h cat ./include/TAU.h | sed -e "s@^#define TAU_MAKEFILE.*\$@#define TAU_MAKEFILE \"$STUB\"@" > TAU.h rm ./include/TAU.h mv TAU.h ./include/TAU.h if [ $perf = yes ] ; then cp include/Makefile $tautoplevel/$architecture/lib/Makefile.tau$tauoptions fi if [ $tauprefix != unknown ] ; then cp -r examples ${tauprefix} cp .all_configs .last_config ${tauprefix} fi # bye bye echo echo "Configuration complete!" if [ $tauprefix != unknown ] ; then echo " Please add " $tauprefix/$architecture/bin " to your path" else echo " Please add " $tauroot/$architecture/bin " to your path" fi echo ' Type "make install" to begin compilation' exit 0