From d544ea3e2fee629064bc23f86724822f0aa3a4a0 Mon Sep 17 00:00:00 2001 From: navarrop Date: Mon, 6 Dec 2010 12:34:09 +0000 Subject: [PATCH] Fix gtnets detection and add a script to install patched gtnets from simgrid svn. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9008 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/Cmake/Modules/FindGTnets.cmake | 7 +- buildtools/Cmake/Option.cmake | 2 +- .../pipol/Experimental_all_simgrid_gt.sh | 2 +- buildtools/pipol/Nightly_simgrid.sh | 21 +----- buildtools/pipol/install_gtnets.sh | 67 +++++++++++++++++++ 5 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 buildtools/pipol/install_gtnets.sh diff --git a/buildtools/Cmake/Modules/FindGTnets.cmake b/buildtools/Cmake/Modules/FindGTnets.cmake index 14319a4d10..14dc6b7317 100644 --- a/buildtools/Cmake/Modules/FindGTnets.cmake +++ b/buildtools/Cmake/Modules/FindGTnets.cmake @@ -1,6 +1,6 @@ find_path(HAVE_RNGSTREAM_H RngStream.h HINTS - $ENV{LD_LIBRARY_PATH} + $ENV{HOME} PATH_SUFFIXES include include/gtnets PATHS /opt @@ -8,12 +8,14 @@ find_path(HAVE_RNGSTREAM_H RngStream.h /opt/csw /sw /usr + ${gtnets_path} ) find_library(HAVE_GTNETS_LIB NAME gtnets HINTS $ENV{LD_LIBRARY_PATH} + $ENV{HOME} PATH_SUFFIXES lib64 lib lib64/gtnets lib/gtnets PATHS /opt @@ -21,6 +23,7 @@ find_library(HAVE_GTNETS_LIB /opt/csw /sw /usr + ${gtnets_path} ) string(REPLACE "/libgtnets.${LIB_EXE}" "" GTNETS_LIB_PATH "${HAVE_GTNETS_LIB}") @@ -53,7 +56,7 @@ if(HAVE_GTNETS_LIB AND HAVE_RNGSTREAM_H) endif(COMPILE_GTNETS_VAR) else(HAVE_GTNETS_LIB AND HAVE_RNGSTREAM_H) -message(STATUS "Gtnets is enable but can't find it. You should set LD_LIBRARY_PATH...") +message(STATUS "Gtnets is enabled but can't find it. You should set LD_LIBRARY_PATH...") endif(HAVE_GTNETS_LIB AND HAVE_RNGSTREAM_H) message(STATUS "Looking for RngStream.h") diff --git a/buildtools/Cmake/Option.cmake b/buildtools/Cmake/Option.cmake index 4959732df4..06dd62ada3 100644 --- a/buildtools/Cmake/Option.cmake +++ b/buildtools/Cmake/Option.cmake @@ -4,7 +4,7 @@ set(BIBTEX2HTML ${BIBTEX2HTML} CACHE PATH "Path to bibtex2html") - +set(gtnets_path ${gtnets_path} CACHE PATH "Path to gtnets lib and include") set(custom_flags ${custom_flags} CACHE FORCE "Customers flags add to cmake_c_flag") if(NOT CMAKE_INSTALL_PREFIX) diff --git a/buildtools/pipol/Experimental_all_simgrid_gt.sh b/buildtools/pipol/Experimental_all_simgrid_gt.sh index 9938a78cce..d15ce5c238 100644 --- a/buildtools/pipol/Experimental_all_simgrid_gt.sh +++ b/buildtools/pipol/Experimental_all_simgrid_gt.sh @@ -92,7 +92,7 @@ cmake -Denable_lua=on \ -Denable_model-checking=on \ -Denable_tracing=on \ -Denable_latency_bound_tracking=on \ --Denable_gtnets=on \ +-Denable_gtnets=off \ -Denable_java=on \ -Dwith_context=auto \ -Denable_compile_optimizations=off \ diff --git a/buildtools/pipol/Nightly_simgrid.sh b/buildtools/pipol/Nightly_simgrid.sh index 18086c9dc9..80f4a22153 100644 --- a/buildtools/pipol/Nightly_simgrid.sh +++ b/buildtools/pipol/Nightly_simgrid.sh @@ -82,25 +82,6 @@ ctest -D NightlyTest ctest -D NightlySubmit make clean -#gtnets -cmake -Denable_lua=on \ --Denable_ruby=on \ --Denable_lib_static=on \ --Denable_graphviz=on \ --Denable_model-checking=off \ --Denable_tracing=on \ --Denable_latency_bound_tracking=on \ --Denable_gtnets=on \ --Denable_java=on \ --Dwith_context=auto \ --Denable_smpi=on . -ctest -D NightlyStart -ctest -D NightlyConfigure -ctest -D NightlyBuild -ctest -D NightlyTest -ctest -D NightlySubmit -make clean - #full_flags cmake -Denable_lua=on \ -Denable_ruby=on \ @@ -152,7 +133,7 @@ cmake -Denable_lua=on \ -Denable_model-checking=on \ -Denable_tracing=on \ -Denable_latency_bound_tracking=on \ --Denable_gtnets=on \ +-Denable_gtnets=off \ -Denable_java=on \ -Dwith_context=auto \ -Denable_compile_optimizations=off \ diff --git a/buildtools/pipol/install_gtnets.sh b/buildtools/pipol/install_gtnets.sh new file mode 100644 index 0000000000..c4cc101b46 --- /dev/null +++ b/buildtools/pipol/install_gtnets.sh @@ -0,0 +1,67 @@ +if [ x$1 != x ] ; then + echo "Install to prefix=$1"; + prefix=$1; +fi + +if [ -e $prefix ] ; then + echo -n "" +else + echo "Creating directory $prefix"; + mkdir -p $prefix; +fi + +echo "Downloading GTNetS from SVN SimGrid's repository"; +svn checkout svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/GTNetS/ --quiet +cd GTNetS +echo "Uncompressing package"; +unzip gtnets-current.zip > /dev/null +tar zxvf gtnets-current-patch.tgz > /dev/null +cd gtnets-current +cat ../00*.patch | patch -p1 > /dev/null + +ARCH_32=`uname -m | cut -d'_' -f2` + +if [ x$ARCH_32 = x64 ] ; then #only if 64 bit processor family +cat ../AMD64-FATAL-Removed-DUL_SIZE_DIFF-Added-fPIC-compillin.patch | patch -p1 > /dev/null +fi + +ln -sf Makefile.linux Makefile +echo "Creating dependencies"; +make -j 3 depend > /dev/null +echo "Compiling GTNetS debug libs"; +make -j 3 debug > /dev/null 2>&1 +echo "Compiling GTNetS optimal libs"; +make -j 3 opt > /dev/null 2>&1 +wait + +if [ -e $prefix/lib ] ; then + echo -n "" +else + echo "Creating directory $prefix/lib"; + mkdir $prefix/lib; +fi + +if [ -e $prefix/include ] ; then + echo -n ""; +else + echo "Creating directory $prefix/include"; + mkdir $prefix/include; +fi + +if [ -e $prefix/include/gtnets ] ; then + echo -n ""; +else + echo "Creating directory $prefix/include/gtnets"; + mkdir $prefix/include/gtnets; +fi + +echo "Copying files to $prefix/lib"; +cp -fr ./*.so $prefix/lib/ +ln -sf $prefix/lib/libgtsim-opt.so $prefix/lib/libgtnets.so + +echo "Copying files to $prefix/include/gtnets"; +cp -fr ./SRC/*.h $prefix/include/gtnets +wait + +echo "Done with gtnets installation"; + -- 2.20.1