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
makefile="Makefile"
with_otf=0
with_tau=0
with_otf_include_default=1
with_otf_lib_default=1
config_specified=0
......@@ -104,13 +105,29 @@ usage()
echo " makes the rabbit to turn when no trace is loaded"
echo ""
echo " --enable_otf"
echo " enables the otf support. The otf release used by default is in the src/general directory"
## Will be added later
echo " --otf_include_dir=<path> set the otf directory path (default is general/otf/otflib if --enable_otf is set)"
echo " --otf_library_dir=<path> set the otf library path (<path>/libotf.a)"
echo " enables the otf support (You can find an OTF release in the src/general directory)"
echo ""
echo " --otf_dir=<path>"
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 " 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
}
......@@ -122,13 +139,6 @@ while [ 0 -lt $# ]; do
--help|-h) # help
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 :)
defines="$defines SPINNING_LOGO"
;;
......@@ -140,22 +150,33 @@ while [ 0 -lt $# ]; do
config_specified=1;
config="$config debug"
;;
--otf_include_dir=*) # otf include directory
include_dir=`echo $OPT | awk -F"--otf_include_dir=" '{print $2}'`
includepath="$includepath $include_dir"
dependpath="$dependpath $include_dir"
with_otf_include_default=0
--enable_otf) # otf support
with_otf=1;
;;
--otf_dir=*) # otf directory
otfdir=`echo $OPT | awk -F"--otf_dir=" '{print $2}'`
otfincdir="$otfdir/include"
otflibdir="$otfdir/lib"
;;
--otf_incdir=*) # otf include directory
otfincdir=`echo $OPT | awk -F"--otf_incdir=" '{print $2}'`
;;
--otf_library_dir=*)
lib_dir=`echo $OPT | awk -F"--otf_library_dir=" '{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
defines="$defines WITH_TAU"
sources="$sources parser/ParserTau.cpp"
headers="$headers parser/ParserTau.hpp parser/TauStructs.hpp"
libs="$libs -lTAU_traceinput"
with_tau=1;
;;
--tau_dir=*) # tau directory
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";
......@@ -171,13 +192,23 @@ else
config="$config release\"";
fi
if [ $with_otf = 1 -a $with_otf_include_default = 1 ]; then
includepath="$includepath general/otf/otflib/"
dependpath="$dependpath general/otf/otflib/"
if [ $with_otf = 1 ]; then
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"
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
if [ $with_otf = 1 -a $with_otf_lib_default = 1 ]; then
libs="$libs general/otf/otflib/.libs/libotf.a -Lgeneral/otf/otflib/.libs"
if [ $with_tau = 1 ]
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
defines="$defines\"";
......@@ -205,8 +236,6 @@ if [ -z "$MAKE" ]; then
fi
fi
OTFLIB_DIR=./src/general/otf
# Creates the makefile
cat > "$makefile" <<EOF
########################################################################
......@@ -216,26 +245,10 @@ cat > "$makefile" <<EOF
################### 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:
make -C \$(OTFLIB_DIR)
rm -rf \$(OTFLIB_DIR)/otflib/.libs/*so*
rm -rf \$(OTFLIB_DIR)/otflib/.libs/*dylib* # For mac
EOF
else
cat >> "$makefile" <<EOF
all:
EOF
fi
if "$WHICH" qmake-qt4 >/dev/null 2>&1 ; then
cat >> "$makefile" <<EOF
cd ./src && qmake-qt4 -makefile -o Makefile $compilation_src_pro && make
......@@ -309,11 +322,6 @@ fi
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
MAKE=`basename $MAKE`
......
......@@ -41,6 +41,8 @@
**
*/
#include <cstdlib>
#include <cstdio>
#include <sstream>
#include <iostream>
#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