source: trunk/bin/jenkins.sh @ 2933

Last change on this file since 2933 was 2933, checked in by bradbell, 7 years ago

jenkins.sh: include openmp in testing, fix build_type setting.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1#! /bin/bash -e
2# $Id: jenkins.sh 2933 2013-10-12 15:30:28Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
5#
6# CppAD is distributed under multiple licenses. This distribution is under
7# the terms of the
8#                     Eclipse Public License Version 1.0.
9#
10# A copy of this license is included in the COPYING file of this distribution.
11# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12# -----------------------------------------------------------------------------
13# distribution directory corresponding to this version of CppAD
14trunk_dir=`pwd`
15# -----------------------------------------------------------------------------
16# bash function that echos and executes a command
17echo_eval() {
18        echo $*
19        eval $*
20}
21# bash function that echos and executes a command
22for ext in log err
23do
24        if [ -e "../jenkins.$ext" ]
25        then
26                echo_eval rm ../jenkins.$ext
27        fi
28done
29log_eval() {
30        echo "------------------------------------------------" >> ../jenkins.log
31        echo "------------------------------------------------" >> ../jenkins.err
32        echo $*  >> ../jenkins.log
33        echo $*  >> ../jenkins.err
34        echo $* "1>> ../jenkins.log 2>> ../jenkins.err"
35        if ! eval $*  1>> ../jenkins.log 2>> ../jenkins.err
36        then
37                echo_eval cat ../jenkins.log
38                echo_eval cat ../jenkins.err
39                exit 1
40        fi
41}
42for ext in log err
43do
44        if [ -e "../jenkins.$ext" ]
45        then
46                echo_eval rm ../jenkins.$ext
47        fi
48done
49# -----------------------------------------------
50if [ $0 != "bin/jenkins.sh" ]
51then
52        echo "bin/jenkins.sh: must be executed from its parent directory"
53        exit 1
54fi
55# -----------------------------------------------------------------------
56# Running bin/get_fadbad.sh will install include files in
57#       trunk_dir/build/prefix/include/FADBAD++
58log_eval bin/get_fadbad.sh
59# -----------------------------------------------------------------------
60# Running bin/get_eigen.sh will install include files in
61#       trunk_dir/build/prefix/include/Eigen
62log_eval bin/get_eigen.sh
63# -----------------------------------------------------------------------
64# Running bin/get_ipopt.sh will install include files in
65#       trunk_dir/build/prefix/include/coin
66# and library files in
67#       trunk_dir/build/prefix/$libdir
68# where $libdir is 'lib64' if /usr/lib64 exists and just 'lib' otherwise.
69log_eval bin/get_ipopt.sh
70# -----------------------------------------------------------------------
71# Running bin/get_sacado.sh will install include files in
72#       trunk_dir/build/prefix/include
73# and library files in
74#       trunk_dir/build/prefix/$libdir
75log_eval bin/get_sacado.sh
76# -----------------------------------------------------------------------
77# Use trunk_dir/../build to build and test CppAD (no reuse)
78echo_eval cd ..
79echo_eval rm -rf build
80echo_eval mkdir build
81echo_eval cd build
82#
83# configure cppad to use all the packages above
84if which rmp >& /dev/null
85then
86        build_type=`rpm --eval %{_host}`
87        build_type="--build=$build_type"
88else
89        build_type=''
90fi
91#
92cat << EOF
93$trunk_dir/configure \\
94        $build_type \\
95        SACADO_DIR="$trunk_dir/build/prefix" \\
96        EIGEN_DIR="$trunk_dir/build/prefix" \\
97        IPOPT_DIR="$trunk_dir/build/prefix" \\
98        FADBAD_DIR="$trunk_dir/build/prefix"  \\
99        OPENMP_FLAGS=-fopenmp
100EOF
101if ! $trunk_dir/configure $build_type \
102        SACADO_DIR="$trunk_dir/build/prefix" \
103        EIGEN_DIR="$trunk_dir/build/prefix" \
104        IPOPT_DIR="$trunk_dir/build/prefix" \
105        FADBAD_DIR="$trunk_dir/build/prefix" \
106        OPENMP_FLAGS=-fopenmp
107then
108        echo "Error during configure command. Here is config.log file:"
109        echo "--------------------------------------------------------"
110        cat config.log
111        exit 1
112fi
113#
114# compile the tests
115log_eval make check
116#
117# run the tests
118log_eval make test
119#
120# print the test results on the console
121echo 'copy make test output to console'
122sed -n -e '/^make test$/,$p' ../jenkins.log
123#
124# make it here without an error exit
125echo "jenkins.sh: OK"
Note: See TracBrowser for help on using the repository browser.