source: trunk/bin/jenkins.sh @ 2939

Last change on this file since 2939 was 2939, checked in by bradbell, 7 years ago
  1. Make sure all '# defines' have an '# undef' and vise-verser.
  2. Add adolc tests to jenkins.sh.

check_define.sh: New reoutine that check defines have matching undef.
package.sh: run check_define.sh.
search.sh: add missing source directory to search.
configure.hpp.in: fix bug in speed tests (name of preprocessor macro).
pow.hpp: fix comment.
thread_alloc.hpp: fix spelling in comment.
jenkins.sh: Automatically set LD_LIBRARY_PATH.
base_adolc.hpp: fix problem when using ADOL-C-2.4.1
adolc_prefix.omh: add link to get_adolc.sh.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1#! /bin/bash -e
2# $Id: jenkins.sh 2939 2013-10-14 11:06:18Z 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# --------------------------------------------------------------------------
56if [ -e /usr/lib64 ]
57then
58        libdir='lib64'
59else
60        libdir='lib'
61fi
62# -----------------------------------------------------------------------
63# The following test can be used to skip install of other packages
64skip='false'
65if [ "$skip" != 'true' ]
66then
67        # ----------------------------------------------------------------------
68        # Running bin/get_fadbad.sh will install include files in
69        #       $trunk_dir/build/prefix/include/FADBAD++
70        log_eval bin/get_fadbad.sh
71        # ----------------------------------------------------------------------
72        # Running bin/get_eigen.sh will install include files in
73        #       $trunk_dir/build/prefix/include/Eigen
74        log_eval bin/get_eigen.sh
75        # ----------------------------------------------------------------------
76        # Running bin/get_ipopt.sh will install include files in
77        #       $trunk_dir/build/prefix/include/coin
78        # and library files in
79        #       $trunk_dir/build/prefix/$libdir
80        # where $libdir is 'lib64' if /usr/lib64 exists and just 'lib' otherwise.
81        log_eval bin/get_ipopt.sh
82        # ----------------------------------------------------------------------
83        # Running bin/get_sacado.sh will install include files in
84        #       $trunk_dir/build/prefix/include
85        # and library files in
86        #       $trunk_dir/build/prefix/$libdir
87        log_eval bin/get_sacado.sh
88        # ----------------------------------------------------------------------
89        # Running bin/get_acolc.sh will install include files in
90        #       $trunk_dir/build/prefix/include/adolc
91        # and library files in
92        #       $trunk_dir/build/prefix/$libdir
93        log_eval bin/get_colpack.sh
94        log_eval bin/get_adolc.sh
95        # ----------------------------------------------------------------------
96fi
97# -----------------------------------------------------------------------
98system_name=`uname | sed -e 's|\(......\).*|\1|'`
99if [ "$system_name" == 'CYGWIN' ]
100then
101        export PATH="$trunk_dir/build/prefix/bin:$PATH"
102else
103        export LD_LIBRARY_PATH="$trunk_dir/build/prefix/$libdir"
104fi
105# -----------------------------------------------------------------------
106# Use trunk_dir/../build to build and test CppAD (no reuse)
107echo_eval cd ..
108echo_eval rm -rf build
109echo_eval mkdir build
110echo_eval cd build
111#
112# configure cppad to use all the packages above
113if which rmp >& /dev/null
114then
115        build_type=`rpm --eval %{_host}`
116        build_type="--build=$build_type"
117else
118        build_type=''
119fi
120#
121cat << EOF
122$trunk_dir/configure \\
123        $build_type \\
124        SACADO_DIR="$trunk_dir/build/prefix" \\
125        EIGEN_DIR="$trunk_dir/build/prefix" \\
126        IPOPT_DIR="$trunk_dir/build/prefix" \\
127        FADBAD_DIR="$trunk_dir/build/prefix"  \\
128        OPENMP_FLAGS=-fopenmp
129EOF
130if ! $trunk_dir/configure $build_type \
131        ADOLC_DIR="$trunk_dir/build/prefix" \
132        SACADO_DIR="$trunk_dir/build/prefix" \
133        EIGEN_DIR="$trunk_dir/build/prefix" \
134        IPOPT_DIR="$trunk_dir/build/prefix" \
135        FADBAD_DIR="$trunk_dir/build/prefix" \
136        OPENMP_FLAGS=-fopenmp
137then
138        echo "Error during configure command. Here is config.log file:"
139        echo "--------------------------------------------------------"
140        cat config.log
141        exit 1
142fi
143#
144# compile the tests
145log_eval make check
146#
147# run the tests
148log_eval make test
149#
150# print the test results on the console
151echo 'copy make test output to console'
152sed -n -e '/^make test$/,$p' ../jenkins.log
153#
154# make it here without an error exit
155echo "jenkins.sh: OK"
Note: See TracBrowser for help on using the repository browser.