Commit 96e26914b844d308da256030843cbdbb74655bb5

Authored by Benjamin Renard
1 parent 16582b4a

Some fix in kernel configuration

.gitignore
... ... @@ -5,8 +5,6 @@ src/Common/AMDA-Kernel_Config.hh
5 5 app-*/*
6 6 !app-*/lib
7 7 !app-*/src
8   -script/deploy-debug.sh
9   -script/deploy-release.sh
10 8 script/amda-kernel-env
11 9 config/app/spiceKernelConfig.xml
12 10 test/FitNesseRoot/ErrorLogs/
... ...
CMakeLists.txt
... ... @@ -5,7 +5,6 @@ PROJECT(AMDA-Kernel)
5 5 SET(CPACK_PACKAGE_VERSION_MAJOR "3")
6 6 SET(CPACK_PACKAGE_VERSION_MINOR "6")
7 7 SET(CPACK_PACKAGE_VERSION_PATCH "0")
8   -SET(SPICE_KERNELS_DATA "/usr/local/data/ORBITS/Kernels")
9 8  
10 9 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/)
11 10 set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/)
... ... @@ -22,21 +21,19 @@ set(Boost_USE_MULTITHREADED ON)
22 21 # Check some environment variables
23 22 if (EXISTS "$ENV{AMDA_COTS_DIR}")
24 23 message("AMDA_COTS_DIR exists")
25   - set(USERLOCAL_ROOT "$ENV{AMDA_COTS_DIR}")
  24 + set(AMDA_COTS_DIR "$ENV{AMDA_COTS_DIR}")
  25 + set(USERLOCAL_ROOT "$ENV{AMDA_COTS_DIR}/local")
  26 + set(AMDA_TOOLS_DIR "$ENV{AMDA_COTS_DIR}/tools")
  27 + set(GCC_ROOT "$ENV{AMDA_COTS_DIR}/tools/gcc/4.7.2/rtf")
  28 + set(BOOST_ROOT "$ENV{AMDA_COTS_DIR}/tools/gcc/4.7.2/boost")
  29 + set(SONAR_ROOT "$ENV{AMDA_COTS_DIR}/tools/sonar")
  30 + set(FITNESSE_ROOT "$ENV{AMDA_COTS_DIR}/tools/fitnesse")
26 31 else()
27 32 message(FATAL_ERROR "AMDA_COTS_DIR NOT exists")
28 33 endif()
29 34  
30 35 message("USERLOCAL_ROOT (AMDA COTS install directory) is defined as ${USERLOCAL_ROOT}")
31   -
32   -if (EXISTS "$ENV{AMDA_GCC_DIR}")
33   - message("AMDA_GCC_DIR exists")
34   - set(GCC_INSTALL_DIR "$ENV{AMDA_GCC_DIR}")
35   - set(BOOST_ROOT "$ENV{AMDA_GCC_DIR}/gcc/4.7.2/boost")
36   -else()
37   - message(FATAL_ERROR "AMDA_GCC_DIR NOT exists")
38   -endif()
39   -
  36 +message("GCC_ROOT (gcc install directory) is defined as ${GCC_ROOT}")
40 37 message("BOOST_ROOT (Boost install directory) is defined as ${BOOST_ROOT}")
41 38  
42 39 if(NOT DEFINED ENV{DDSERVER_HOST_NAME})
... ... @@ -93,13 +90,11 @@ foreach(environment debug release generate-paraminfo)
93 90 )
94 91 endforeach()
95 92  
96   -foreach(templated_file amda-kernel-env deploy-debug.sh deploy-release.sh)
97   - configure_file (
98   - "${CMAKE_SOURCE_DIR}/script/templates/${templated_file}.in"
99   - "${CMAKE_SOURCE_DIR}/script/${templated_file}"
100   - @ONLY
101   - )
102   -endforeach()
  93 +configure_file (
  94 + "${CMAKE_SOURCE_DIR}/script/templates/amda-kernel-env.in"
  95 + "${CMAKE_SOURCE_DIR}/script/amda-kernel-env"
  96 + @ONLY
  97 +)
103 98  
104 99 # Build AMDA Kernel
105 100 MESSAGE( STATUS "Build AMDA-Kernel Project" )
... ...
README.md
... ... @@ -5,8 +5,7 @@
5 5 **The first compilation** must be done with the script `script/deploy.sh` and with these required arguments:
6 6  
7 7 - `-b`: build type (Debug or Release)
8   -- `-g` : gcc install directory
9   -- `-o` : AMDA COTS install directory
  8 +- `-c` : COTS install directory (typically '/opt')
10 9 - `-d` : DDServer host name (will be write in DD.res file)
11 10 - `-p` : DDServer port (will be write in DD.res file)
12 11  
... ... @@ -14,7 +13,9 @@ For exemple:
14 13  
15 14 script/deploy.sh -b "Debug" -g "/opt/tools" -o "/opt/local" -d "amdadev.fr" -p "5000"
16 15  
17   -During this first compilation, scripts `script/deploy-debug.sh` and `script/deploy-release.sh` will be generated and they can be used later to compile the application with the same arguments.
  16 +During this first compilation, the correponding environment file will be write in 'script/amda-kernel-env'.
  17 +
  18 +Once this first step done, next compilation can be done with scripts `script/deploy-debug.sh` and `script/deploy-release.sh` (no arguments required, the generated environment file will be used).
18 19  
19 20 For example, to compile the application in release mode, you have just to run this command line:
20 21  
... ...
config/app/log4cxx.config.light deleted
... ... @@ -1,14 +0,0 @@
1   -log4j.rootLogger=error, stdout, F
2   -
3   -log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4   -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5   -
6   -# Pattern to output the caller's file name and line number.
7   -log4j.appender.stdout.layout.ConversionPattern=%X{PID} %r %5p [%t] (%r ms) (%F:%L) - %m%n
8   -
9   -log4j.appender.F=org.apache.log4j.FileAppender
10   -log4j.appender.F.File=example.log
11   -log4j.appender.F.Append=false
12   -
13   -log4j.appender.F.layout=org.apache.log4j.PatternLayout
14   -log4j.appender.F.layout.ConversionPattern=%p %t (%r ms) %c - %m%n
config/app/templates/app.properties.debug.in
... ... @@ -24,7 +24,7 @@ app.process.src=src
24 24 app.process.lib=lib
25 25 app.process.CXX_COMPILER=g++
26 26 app.process.CMAKE_CXX_FLAGS=-g -std=c++0x -fPIC -Wall -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread
27   -app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_INSTALL_DIR@/gcc/4.7.2/boost/include -I@USERLOCAL_ROOT@/include/log4cxx
  27 +app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_ROOT@/include -I@BOOST_ROOT@/include -I@USERLOCAL_ROOT@/include/log4cxx
28 28 app.process.LIB=-L../build/Debug/lib/ -lParameters
29 29 # Plot default configuration
30 30 app.plot.configfile=../config/app/plotConfig.xml
... ...
config/app/templates/app.properties.generate-paraminfo.in
... ... @@ -24,7 +24,7 @@ app.process.src=src
24 24 app.process.lib=lib
25 25 app.process.CXX_COMPILER=g++
26 26 app.process.CMAKE_CXX_FLAGS=-g -std=c++0x -fPIC -Wall -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread
27   -app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_INSTALL_DIR@/gcc/4.7.2/boost/include -I@USERLOCAL_ROOT@/include/log4cxx
  27 +app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_ROOT@/include -I@BOOST_ROOT@/include -I@USERLOCAL_ROOT@/include/log4cxx
28 28 app.process.LIB=-L../build/Debug/lib/ -lParameters
29 29 # Plot default configuration
30 30 app.plot.configfile=../config/app/plotConfig.xml
... ...
config/app/templates/app.properties.release.in
... ... @@ -24,7 +24,7 @@ app.process.src=src
24 24 app.process.lib=lib
25 25 app.process.CXX_COMPILER=g++
26 26 app.process.CMAKE_CXX_FLAGS=-std=c++0x -Wall -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread -O3 -DNDEBUG
27   -app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_INSTALL_DIR@/gcc/4.7.2/boost/include -I@USERLOCAL_ROOT@/include/log4cxx
  27 +app.process.INCLUDE=-I../src/InternLib -I../src/Common -I../src/Parameters -I../src/DD_Client_Lib -I../src/helpers -I../src/TimeTableCatalog -I@USERLOCAL_ROOT@/include -I@GCC_ROOT@/include -I@BOOST_ROOT@/include -I@USERLOCAL_ROOT@/include/log4cxx
28 28 app.process.LIB=-L../build/Release/lib/ -lParameters
29 29 # Plot default configuration
30 30 app.plot.configfile=../config/app/plotConfig.xml
... ...
script/templates/deploy-debug.sh.in renamed to script/deploy-debug.sh
... ... @@ -3,4 +3,6 @@
3 3 SCRIPT=$(readlink -f "$0")
4 4 SCRIPTDIR=$(dirname "$SCRIPT")
5 5  
6   -$SCRIPTDIR/deploy.sh -b Debug -g "@GCC_INSTALL_DIR@" -o "@USERLOCAL_ROOT@" -d "@DDSERVER_HOST_NAME@" -p "@DDSERVER_PORT@"
  6 +. ${SCRIPTDIR}/amda-kernel-env
  7 +
  8 +$SCRIPTDIR/deploy.sh -b Debug -c "${AMDA_COTS_DIR}" -d "${DDSERVER_HOST_NAME}" -p ${DDSERVER_PORT}
... ...
script/templates/deploy-release.sh.in renamed to script/deploy-release.sh
... ... @@ -3,4 +3,6 @@
3 3 SCRIPT=$(readlink -f "$0")
4 4 SCRIPTDIR=$(dirname "$SCRIPT")
5 5  
6   -$SCRIPTDIR/deploy.sh -b Release -g "@GCC_INSTALL_DIR@" -o "@USERLOCAL_ROOT@" -d "@DDSERVER_HOST_NAME@" -p "@DDSERVER_PORT@"
  6 +. ${SCRIPTDIR}/amda-kernel-env
  7 +
  8 +$SCRIPTDIR/deploy.sh -b Release -c "${AMDA_COTS_DIR}" -d "${DDSERVER_HOST_NAME}" -p ${DDSERVER_PORT}
... ...
script/deploy.sh
... ... @@ -6,18 +6,17 @@ SCRIPTDIR=$(dirname "$SCRIPT")
6 6 usage="
7 7 \n ### Deploy AMDA Kernel ###
8 8 \n
9   - \n Usage : $0 -b <build type (Debug or Release)> -g <gcc install directory> -o <other COTS install directory> -d <DDServer host name> -p <DDServer port>
  9 + \n Usage : $0 -b <build type (Debug or Release)> -c <COTS install directory> -d <DDServer host name> -p <DDServer port>
10 10 \n
11   - \n $0 -b Debug -g /opt/tools -o /opt/local -d amdadev.fr -p 5000
  11 + \n $0 -b Debug -c /opt -d amdadev.fr -p 5000
12 12 \n
13 13 \n
14 14 \n ###"
15 15  
16   -while getopts "b:g:o:d:p:h" options; do
  16 +while getopts "b:c:d:p:h" options; do
17 17 case $options in
18 18 b ) KERNEL_BUILD_TYPE=`echo $OPTARG`;;
19   - g ) GCC_INSTALL_DIR=`echo $OPTARG`;;
20   - o ) COTS_INSTALL_DIR=`echo $OPTARG`;;
  19 + c ) COTS_DIR=`echo $OPTARG`;;
21 20 d ) DDSERVER_HOST_NAME=`echo $OPTARG`;;
22 21 p ) DDSERVER_PORT=`echo $OPTARG`;;
23 22 h ) echo -e $usage
... ... @@ -29,25 +28,21 @@ while getopts &quot;b:g:o:d:p:h&quot; options; do
29 28 esac
30 29 done
31 30  
32   -if [ "$GCC_INSTALL_DIR" = "" ]
  31 +if [ "$COTS_DIR" = "" ]
33 32 then
34 33 echo -e $usage
35 34 exit 1
36 35 fi
37 36  
38   -if [ ! -d "$GCC_INSTALL_DIR" ]; then
  37 +if [ ! -d "$COTS_DIR/tools/gcc" ]; then
39 38 echo -e $usage
  39 + echo "[ERROR] Cannot find GCC tool directory $COTS_DIR/tools/gcc"
40 40 exit 1
41 41 fi
42 42  
43   -if [ "$COTS_INSTALL_DIR" = "" ]
44   -then
45   - echo -e $usage
46   - exit 1
47   -fi
48   -
49   -if [ ! -d "$COTS_INSTALL_DIR" ]; then
  43 +if [ ! -d "$COTS_DIR/local/lib" ]; then
50 44 echo -e $usage
  45 + echo "[ERROR] Cannot find lib directory $COTS_DIR/local/lib"
51 46 exit 1
52 47 fi
53 48  
... ... @@ -65,26 +60,23 @@ fi
65 60  
66 61 if [ "$KERNEL_BUILD_TYPE" = "Debug" ]
67 62 then
68   - echo ""
69   - echo "[INFO] Install AMDA Kernel in $SRC_DIR (Debug mode)"
  63 + echo "[INFO] Install AMDA Kernel in Debug mode"
70 64 elif [ "$KERNEL_BUILD_TYPE" = "Release" ]
71 65 then
72   - echo ""
73   - echo "[INFO] Install AMDA Kernel in $SRC_DIR (Release mode)"
  66 + echo "[INFO] Install AMDA Kernel in Release mode"
74 67 else
75 68 echo -e $usage
76 69 exit 1
77 70 fi
78 71  
79   -export AMDA_COTS_DIR="$COTS_INSTALL_DIR"
80   -export AMDA_GCC_DIR="$GCC_INSTALL_DIR"
  72 +export AMDA_COTS_DIR="$COTS_DIR"
81 73 export DDSERVER_HOST_NAME="$DDSERVER_HOST_NAME"
82 74 export DDSERVER_PORT="$DDSERVER_PORT"
83   -export LD_LIBRARY_PATH="$GCC_INSTALL_DIR/gcc/4.7.2/rtf/lib64:$GCC_INSTALL_DIR/gcc/4.7.2/rtf/lib:$COTS_INSTALL_DIR/lib:$LD_LIBRARY_PATH"
84   -export PATH="$GCC_INSTALL_DIR/gcc/4.7.2/rtf/bin:$COTS_INSTALL_DIR/bin:$PATH"
  75 +export LD_LIBRARY_PATH="$COTS_DIR/tools/gcc/4.7.2/rtf/lib64:$COTS_DIR/tools/gcc/4.7.2/rtf/lib:$COTS_DIR/local/lib:$LD_LIBRARY_PATH"
  76 +export PATH="$COTS_DIR/tools/gcc/4.7.2/rtf/bin:$COTS_DIR/local/bin:$PATH"
85 77  
86 78 cmake -E make_directory "$SCRIPTDIR/../build"
87 79 cmake -E make_directory "$SCRIPTDIR/../build/$KERNEL_BUILD_TYPE"
88   -cmake -E chdir "$SCRIPTDIR/../build/$KERNEL_BUILD_TYPE" cmake -DCMAKE_C_COMPILER="$AMDA_GCC_DIR/gcc/4.7.2/rtf/bin/gcc" -DCMAKE_CXX_COMPILER="$AMDA_GCC_DIR/gcc/4.7.2/rtf/bin/g++" -DCMAKE_BUILD_TYPE=$KERNEL_BUILD_TYPE ../..
  80 +cmake -E chdir "$SCRIPTDIR/../build/$KERNEL_BUILD_TYPE" cmake -DCMAKE_C_COMPILER="$COTS_DIR/tools/gcc/4.7.2/rtf/bin/gcc" -DCMAKE_CXX_COMPILER="$COTS_DIR/tools/gcc/4.7.2/rtf/bin/g++" -DCMAKE_BUILD_TYPE=$KERNEL_BUILD_TYPE ../..
89 81 cmake --build "$SCRIPTDIR/../build/$KERNEL_BUILD_TYPE"
90 82 make -C "$SCRIPTDIR/../build/$KERNEL_BUILD_TYPE" install VERBOSE=1
... ...
script/generate_sonar_report.sh
... ... @@ -10,4 +10,4 @@ ${SCRIPTDIR}/generate_cppcheck_report.sh
10 10  
11 11 cd ${PROJECTDIR}
12 12  
13   -${SONAR_DIR}/sonar-runner-1.4/bin/sonar-runner
  13 +${SONAR_ROOT}/sonar-runner-1.4/bin/sonar-runner
... ...
script/start-fitnesse.sh
... ... @@ -12,7 +12,7 @@ fi;
12 12  
13 13 . ${SCRIPTDIR}/amda-kernel-env
14 14  
15   -export PATH="${SCRIPT_PATH}/../build/Debug/bin:$PATH"
16   -nohup java -jar "${FITNESSE_DIR}/fitnesse-standalone.jar" -d test -e 0 -p ${FITNESSE_PORT} &
  15 +export PATH="${SCRIPTDIR}/../build/Debug/bin:$PATH"
  16 +nohup java -jar "${FITNESSE_ROOT}/fitnesse-standalone.jar" -d test -e 0 -p ${FITNESSE_PORT} &
17 17  
18 18 exit 0
... ...
script/templates/amda-kernel-env.in
1   -MY_GXX_HOME="@GCC_INSTALL_DIR@/gcc/4.7.2/rtf"
2   -export PATH="${MY_GXX_HOME}/bin:@USERLOCAL_ROOT@/bin:${PATH}"
3   -export LD_LIBRARY_PATH="${MY_GXX_HOME}/lib64:${MY_GXX_HOME}/lib:@USERLOCAL_ROOT@/lib:${LD_LIBRARY_PATH}"
4   -export SONAR_DIR="@USERLOCAL_ROOT@/sonar"
5   -export FITNESSE_DIR="@USERLOCAL_ROOT@/FitNesse"
  1 +export AMDA_COTS_DIR="@AMDA_COTS_DIR@"
  2 +export USERLOCAL_ROOT="@USERLOCAL_ROOT@"
  3 +export GCC_ROOT="@GCC_ROOT@"
  4 +export BOOST_ROOT="@BOOST_ROOT@"
  5 +export DDSERVER_HOST_NAME="@DDSERVER_HOST_NAME@"
  6 +export DDSERVER_PORT=@DDSERVER_PORT@
  7 +export SONAR_ROOT="@SONAR_ROOT@"
  8 +export FITNESSE_ROOT="@FITNESSE_ROOT@"
  9 +export SPICE_KERNELS_DATA="/usr/local/data/ORBITS/Kernels"
  10 +export PATH="@GCC_ROOT@/bin:@USERLOCAL_ROOT@/bin:${PATH}"
  11 +export LD_LIBRARY_PATH="@GCC_ROOT@/lib64:@GCC_ROOT@/lib:@USERLOCAL_ROOT@/lib:${LD_LIBRARY_PATH}"
... ...