source: trunk/bin/check_all.sh @ 2600

Last change on this file since 2600 was 2600, checked in by bradbell, 7 years ago
  1. Add documentation for ipopt_prefix.
  2. Fix the make and execute commands for other package speed tests.
  3. Fix some problems with the CppAD pkg-config file cppad.pc.
  4. Add documentation for using pkg-config with cppad.

check_all.sh: make lib64 install directory.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1#! /bin/bash -e
2# $Id: check_all.sh 2600 2012-12-14 02:08:51Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-12 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# -----------------------------------------------------------------------------
13if [ ! -e "bin/check_all.sh" ]
14then
15        echo "bin/check_all.sh: must be executed from its parent directory"
16        exit 1
17fi
18echo_exec() {
19     echo $* 
20     eval $*
21}
22echo_exec_log() {
23        echo "$* >> check_all.log"
24        echo    >> $top_srcdir/check_all.log
25        eval $* >> $top_srcdir/check_all.log
26}
27# circular shift program list and set program to first entry in list
28next_program() {
29        program_list=`echo "$program_list" | sed -e 's| *\([^ ]*\) *\(.*\)|\2 \1|'`
30        program=`echo "$program_list" | sed -e 's| *\([^ ]*\).*|\1|'`
31}
32if [ -e 'check_all.log' ]
33then
34        echo_exec rm check_all.log
35fi
36top_srcdir=`pwd`
37cmake_args=''
38if [ "$1" != "" ]
39then
40        if [ "$1" == '--verbose' ]
41        then
42                cmake_args="$cmake_args  -D CMAKE_VERBOSE_MAKEFILE=1"
43        else
44                echo 'usage: bin/check_all.sh: [--verbose]'
45                exit 1
46        fi
47fi
48# -----------------------------------------------------------------------------
49# Create package to run test in
50echo_exec bin/package.sh
51# -----------------------------------------------------------------------------
52# change into gpl version of package directory
53version=`bin/version.sh get`
54echo_exec cd work/cppad-$version
55# -----------------------------------------------------------------------------
56list="
57        check_all.log
58        $HOME/prefix/cppad
59        work
60"
61for name in $list
62do
63        if [ -e "$name" ]
64        then
65                echo_exec rm -r $name
66        fi
67done
68echo_exec mkdir work
69echo_exec cd work
70# -----------------------------------------------------------------------------
71cmake_args="$cmake_args  -D cmake_install_prefix=$HOME/prefix/cppad"
72if [ -d '/usr/include' ]
73then
74        cmake_args="$cmake_args -D cmake_install_includedirs=include"
75fi
76#
77if [ -d '/usr/share' ]
78then
79        cmake_args="$cmake_args -D cmake_install_datadir=share"
80fi
81#
82if [ -d '/usr/lib64' ]
83then
84        cmake_args="$cmake_args -D cmake_install_libdirs='lib64;lib'"
85elif [ -d '/usr/lib' ]
86then
87        cmake_args="$cmake_args -D cmake_install_libdirs='lib;lib64'"
88fi
89for package in adolc eigen ipopt fadbad sacado
90do
91        dir=$HOME/prefix/$package
92        if [ -d "$dir" ]
93        then
94                cmake_args="$cmake_args  -D ${package}_prefix=$dir"
95        fi
96done
97cmake_args="$cmake_args -D cppad_sparse_list=YES"
98cmake_args="$cmake_args -D cppad_testvector=boost"
99cmake_args="$cmake_args -D cppad_tape_id_type='unsigned int'"
100cmake_args="$cmake_args -D cppad_tape_addr_type=int"
101cmake_args="$cmake_args -D cppad_max_num_threads=48"
102cmake_args="$cmake_args -D cppad_documentation=YES"
103cmake_args="$cmake_args -D cppad_cxx_flags=\
104'-Wall -ansi -pedantic-errors -std=c++98 -Wshadow'"
105#
106#
107echo_exec_log cmake $cmake_args ..
108# -----------------------------------------------------------------------------
109echo_exec_log make check
110# -----------------------------------------------------------------------------
111skip=''
112list='
113        example/example
114        test_more/test_more
115        cppad_ipopt/example/ipopt_example
116        cppad_ipopt/speed/ipopt_speed
117        cppad_ipopt/test/ipopt_test_more
118        speed/example/speed_example
119'
120#
121# standard tests
122for program in $list
123do
124        if [ ! -e "$program" ]
125        then
126                skip="$skip $program"
127        else
128                echo_exec_log $program 
129        fi
130done
131#
132# speed tests
133for dir in adolc cppad double fadbad sacado profile
134do
135        program="speed/$dir/speed_${dir}"
136        if [ ! -e "$program" ]
137        then
138                skip="$skip $program"
139        else
140                echo_exec_log $program correct 54321
141                echo_exec_log $program correct 54321 retape
142        fi
143done
144#
145# multi_thread tests
146# ----------------------------------------------------------------------------
147program_list=''
148for dir in bthread openmp pthread
149do
150        program="multi_thread/${dir}/${dir}_test"
151        if [ ! -e $program ]
152        then
153                skip="$skip $program"
154        else
155                program_list="$program_list $program"
156                #
157                # fast cases, test for all programs
158                echo_exec_log ./$program a11c
159                echo_exec_log ./$program simple_ad
160                echo_exec_log ./$program team_example
161        fi
162done
163if [ "$program_list" != '' ]
164then
165        # test_time=1,max_thread=4,mega_sum=1
166        next_program
167        echo_exec_log ./$program harmonic 1 4 1
168        #
169        # test_time=2,max_thread=4,num_zero=20,num_sub=30,num_sum=500,use_ad=true
170        next_program
171        echo_exec_log ./$program multi_newton 2 4 20 30 500 true
172        #
173        # case that failed in the past
174        next_program
175        echo_exec_log ./$program multi_newton 1 1 100 700 1 true
176        #
177        # case that failed in the past
178        next_program
179        echo_exec_log ./$program multi_newton 1 2 3 12 1 true
180fi
181#
182# print_for test
183if [ ! -e 'print_for/print_for' ]
184then
185        skip="$skip print_for/print_for"
186else
187        echo_exec_log print_for/print_for
188        print_for/print_for | sed -e '/^Test passes/,$d' > junk.1.$$
189        print_for/print_for | sed -e '1,/^Test passes/d' > junk.2.$$
190        if diff junk.1.$$ junk.2.$$
191        then
192                rm junk.1.$$ junk.2.$$
193                echo "print_for: OK"  >> $top_srcdir/check_all.log
194        else
195                echo "print_for: Error"  >> $top_srcdir/check_all.log
196                exit 1
197        fi
198fi
199#
200echo_exec_log make install
201#
202if [ "$skip" != '' ]
203then
204        echo "check_all.sh: skip = $skip"
205        exit 1
206fi
207#
208echo 'check_all.sh: OK'
209exit 0
Note: See TracBrowser for help on using the repository browser.