Commit d0c10fc2 authored by Mathieu Faverge's avatar Mathieu Faverge

Update configure for OTF and TAU / Correct some include problems in parserTau

parent 6aa129ef
...@@ -49,6 +49,7 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown ...@@ -49,6 +49,7 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
makefile="Makefile" makefile="Makefile"
with_otf=0 with_otf=0
with_tau=0
with_otf_include_default=1 with_otf_include_default=1
with_otf_lib_default=1 with_otf_lib_default=1
config_specified=0 config_specified=0
...@@ -104,13 +105,29 @@ usage() ...@@ -104,13 +105,29 @@ usage()
echo " makes the rabbit to turn when no trace is loaded" echo " makes the rabbit to turn when no trace is loaded"
echo "" echo ""
echo " --enable_otf" echo " --enable_otf"
echo " enables the otf support. The otf release used by default is in the src/general directory" echo " enables the otf support (You can find an OTF release in the src/general directory)"
## Will be added later echo ""
echo " --otf_include_dir=<path> set the otf directory path (default is general/otf/otflib if --enable_otf is set)" echo " --otf_dir=<path>"
echo " --otf_library_dir=<path> set the otf library path (<path>/libotf.a)" echo " path to the OTF library"
echo ""
echo " --otf_incdir=<path>"
echo " include path to the OTF headers"
echo ""
echo " --otf_libdir=<path>"
echo " library path to the OTF libraries"
echo ""
echo " --enable_tau" echo " --enable_tau"
echo " enables the tau support. The tau release used by default is in the src/general directory" # search in /usr/include, /usr/lib and if not found ask to download and install. echo " enables the tau support"
echo ""
echo " --tau_dir=<path>"
echo " path to the TAU library"
echo ""
echo " --tau_incdir=<path>"
echo " include path to the TAU headers"
echo ""
echo " --tau_libdir=<path>"
echo " library path to the TAU libraries"
echo ""
exit 0 exit 0
} }
...@@ -122,13 +139,6 @@ while [ 0 -lt $# ]; do ...@@ -122,13 +139,6 @@ while [ 0 -lt $# ]; do
--help|-h) # help --help|-h) # help
usage usage
;; ;;
--enable_otf) # otf support
with_otf=1;
defines="$defines WITH_OTF"
sources="$sources parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp"
headers="$headers parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp"
#compilation_src_pro="\"DEFINES+=WITH_OTF\" \"LIBS+=general/otf/otflib/.libs/libotf.a -Lgeneral/otf/otflib/.libs\" \"SOURCES+=parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp\" \"HEADERS+=parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp\" src.pro "
;;
--enable_spinning_logo) # good openGL spinning rabbit :) --enable_spinning_logo) # good openGL spinning rabbit :)
defines="$defines SPINNING_LOGO" defines="$defines SPINNING_LOGO"
;; ;;
...@@ -140,22 +150,33 @@ while [ 0 -lt $# ]; do ...@@ -140,22 +150,33 @@ while [ 0 -lt $# ]; do
config_specified=1; config_specified=1;
config="$config debug" config="$config debug"
;; ;;
--otf_include_dir=*) # otf include directory --enable_otf) # otf support
include_dir=`echo $OPT | awk -F"--otf_include_dir=" '{print $2}'` with_otf=1;
includepath="$includepath $include_dir" ;;
dependpath="$dependpath $include_dir" --otf_dir=*) # otf directory
with_otf_include_default=0 otfdir=`echo $OPT | awk -F"--otf_dir=" '{print $2}'`
otfincdir="$otfdir/include"
otflibdir="$otfdir/lib"
;; ;;
--otf_library_dir=*) --otf_incdir=*) # otf include directory
lib_dir=`echo $OPT | awk -F"--otf_library_dir=" '{print $2}'` otfincdir=`echo $OPT | awk -F"--otf_incdir=" '{print $2}'`
libs="$libs $lib_dir/libotf.a -L$lib_dir" ;;
with_otf_lib_default=0 --otf_libdir=*)
otflibdir=`echo $OPT | awk -F"--otf_libdir=" '{print $2}'`
;; ;;
--enable_tau) # tau support --enable_tau) # tau support
defines="$defines WITH_TAU" with_tau=1;
sources="$sources parser/ParserTau.cpp" ;;
headers="$headers parser/ParserTau.hpp parser/TauStructs.hpp" --tau_dir=*) # tau directory
libs="$libs -lTAU_traceinput" taudir=`echo $OPT | awk -F"--tau_dir=" '{print $2}'`
tauincdir="$taudir/include"
taulibdir="$taudir/lib"
;;
--tau_incdir=*) # tau include directory
tauincdir=`echo $OPT | awk -F"--tau_incdir=" '{print $2}'`
;;
--tau_libdir=*)
taulibdir=`echo $OPT | awk -F"--tau_libdir=" '{print $2}'`
;; ;;
*) *)
echo "invalid option : $OPT"; echo "invalid option : $OPT";
...@@ -171,13 +192,23 @@ else ...@@ -171,13 +192,23 @@ else
config="$config release\""; config="$config release\"";
fi fi
if [ $with_otf = 1 -a $with_otf_include_default = 1 ]; then if [ $with_otf = 1 ]; then
includepath="$includepath general/otf/otflib/" defines="$defines WITH_OTF"
dependpath="$dependpath general/otf/otflib/" sources="$sources parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp"
headers="$headers parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp"
includepath="$includepath $otfincdir"
#dependpath="$dependpath $otfincdir"
libs="$libs -L$otflibdir -lotf"
#compilation_src_pro="\"DEFINES+=WITH_OTF\" \"LIBS+=general/otf/otflib/.libs/libotf.a -Lgeneral/otf/otflib/.libs\" \"SOURCES+=parser/ParserOTF.cpp parser/ParserEventOTF.cpp parser/ParserDefinitionOTF.cpp\" \"HEADERS+=parser/ParserOTF.hpp parser/ParserEventOTF.hpp parser/ParserDefinitionOTF.hpp\" src.pro "
fi fi
if [ $with_otf = 1 -a $with_otf_lib_default = 1 ]; then if [ $with_tau = 1 ]
libs="$libs general/otf/otflib/.libs/libotf.a -Lgeneral/otf/otflib/.libs" then
defines="$defines WITH_TAU"
sources="$sources parser/ParserTau.cpp"
headers="$headers parser/ParserTau.hpp parser/TauStructs.hpp"
includepath="$includepath $tauincdir"
libs="$libs -L$taulibdir -lTAU_tf"
fi fi
defines="$defines\""; defines="$defines\"";
...@@ -205,8 +236,6 @@ if [ -z "$MAKE" ]; then ...@@ -205,8 +236,6 @@ if [ -z "$MAKE" ]; then
fi fi
fi fi
OTFLIB_DIR=./src/general/otf
# Creates the makefile # Creates the makefile
cat > "$makefile" <<EOF cat > "$makefile" <<EOF
######################################################################## ########################################################################
...@@ -216,25 +245,9 @@ cat > "$makefile" <<EOF ...@@ -216,25 +245,9 @@ cat > "$makefile" <<EOF
################### It has by done for ViTE project #################### ################### It has by done for ViTE project ####################
## ## ## ##
######################################################################## ########################################################################
EOF
if [ $with_otf = 1 -a $with_otf_lib_default = 1 ]; then # set the directory... should be decided by the user, we will see after how to do beautiful options :)
cat >> "$makefile" <<EOF
OTFLIB_DIR = ./src/general/otf
all: all:
make -C \$(OTFLIB_DIR)
rm -rf \$(OTFLIB_DIR)/otflib/.libs/*so*
rm -rf \$(OTFLIB_DIR)/otflib/.libs/*dylib* # For mac
EOF EOF
else
cat >> "$makefile" <<EOF
all:
EOF
fi
if "$WHICH" qmake-qt4 >/dev/null 2>&1 ; then if "$WHICH" qmake-qt4 >/dev/null 2>&1 ; then
cat >> "$makefile" <<EOF cat >> "$makefile" <<EOF
...@@ -309,11 +322,6 @@ fi ...@@ -309,11 +322,6 @@ fi
EOF EOF
if [ $with_otf = 1 -a $with_otf_lib_default = 1 ]; then
echo >&2 "Configuration of the otf library"
cd $OTFLIB_DIR && ./configure
fi
# basename erase the path of acces of the command # basename erase the path of acces of the command
MAKE=`basename $MAKE` MAKE=`basename $MAKE`
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
** **
*/ */
#include <cstdlib>
#include <cstdio>
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
#include <string> #include <string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment