source: trunk/bin/test_one.sh.in @ 3843

Last change on this file since 3843 was 3843, checked in by bradbell, 3 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: c2fc444ef4437f00b2a5dbff169ee90c2e7ca0a5
end hash code: cd5824ab1b676cbd261cf924e31313177319abc2

commit cd5824ab1b676cbd261cf924e31313177319abc2
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 10:49:52 2016 -0700

Advance to cppad-20161113.
whats_new_16.omh: Comments about mering in sparse branch.

commit 765a1d0fc792a11aaecc85a1a86283a061bdf936
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 09:38:53 2016 -0700

sparse branch:
Remove the begin and next_element functions from sparse_list and sparse_pack.

commit 9a02ec89550495025497bcdda4ab752fcf9e7ff8
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 09:21:12 2016 -0700

sparse branch:
conver use of next_element -> const_iterator.
test_one.sh.in: fix running tests in test_more/local directory.

commit ef2019c8d57035c726361d75b19d4bc0ffe70d67
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 08:50:23 2016 -0700

sparse branch:
ad_fun.hpp: change a member function argument to const.
rev_sparse_hes.hpp: convert use of next_element -> const_iterator.
rev_sparse_jac.hpp: convert use of next_element -> const_iterator.

commit 821a612cce99edba22bef9cf961fc10cad1d273c
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 08:26:31 2016 -0700

sparse branch:
rev_jac_sweep.hpp: convert use of next_element -> const_iterator.

commit f6aaccd30ac2d366e746a496f9a06d277e0b1736
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 07:45:51 2016 -0700

sparse branch:
rev_hes_sweep.hpp: convert use of next_element -> const_iterator.
sparse_binary_op.hpp: add more const declarations.
sparse_unary_op.hpp: add more const declarations.

commit 995aa7f2795152d0b91d4c9770a20890d6b211a0
Author: Brad Bell <bradbell@…>
Date: Sun Nov 13 07:02:49 2016 -0700

sparse branch:
ad_fun.hpp: add 'const' to a member function argument.
for_sparse_jac.hpp: convert use of next_element -> const_iterator.
sparse_list.hpp: fix bug, (only next == 0 determines end of list).

commit 62eb1027afdb2e2d9702101f16a379abfe801362
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 18:30:56 2016 -0700

sparse branch:
for_sparse_hes.hpp: change use of next_element -> const_iterator.

commit 3281ad2186b9e70d6890904321cc0d36f70faaf4
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 17:49:44 2016 -0700

sparse branch:
for_jac_sweep.hpp: convert use of next_element -> iterator.
sparse_list.hpp: set next to avoid compiler warning.

commit f90028d277b1fcad6ee8a4576d5412c74b29808d
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 15:03:27 2016 -0700

sparse branch:
for_hes_sweep.hpp: convert next_element -> iterator use.

commit 230ade894fe084460d87d9e2aec037e38247819f
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 08:55:17 2016 -0700

sparse branch:
sparse_unary_op.hpp: convert next_element use to iterator use.

commit 1632ff186b1dd580d4bf561918c6bde26f5fd6c6
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 07:31:49 2016 -0700

sparse branch:
sparse_binary_op.hpp: convert next_element use to iterator use.

commit fad9645fc1d2e97ef46e73893f45f1ee613c2176
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 06:25:03 2016 -0700

sparse branch:
color_general.hpp: minor edit to doxygen documentation.
color_symmetric.hpp: remove use of next_element.

commit f43bc585c700b7cbeb177bbe2b0b52fe8670528f
Author: Brad Bell <bradbell@…>
Date: Sat Nov 12 06:04:42 2016 -0700

sparse branch:
color_general.hpp: convert uses of next_element to use iterator.

commit 37a76a4fbec718a6de053837dcb91a3f83740636
Author: Brad Bell <bradbell@…>
Date: Fri Nov 11 22:42:27 2016 -0700

sparse branch:
Add const_iterator to sparse_list and sparse_pack.
checkpoint.hpp: convert use of next_element to const_iterator.

commit 1bf5271607e09c4972615231d05c7221a3524d6d
Author: Brad Bell <bradbell@…>
Date: Fri Nov 11 07:45:18 2016 -0700

Advance to cppad-20161111.

commit ed1214ac0a32471f146509f498f11300adaed074
Author: Brad Bell <bradbell@…>
Date: Thu Oct 27 06:15:14 2016 -0700

  1. Add the optimize option to checkpoint functions.
  2. Advance to cppad-20161014.


optimize.hpp: fix some commemnts about parameters in atomic functions.

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#! /bin/bash -e
2# $Id$
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 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# Run one of the tests
14if [ "$0" != 'bin/test_one.sh' ]
15then
16cat << EOF
17usage: bin/test_one.sh dir/file [extra]
18
19dir:   example, example/atomic, example/ipopt_solve, or test_more
20file:  name of *.cpp file, with extension, that contains the test
21extra: extra options for the g++ command
22EOF
23        exit 1
24fi
25dir=`echo $1 | sed -e 's|/[^/]*$||'`
26file=`echo $1 | sed -e 's|.*/||'`
27extra="$2"
28if [ "$dir" == 'test_more/local' ]
29then
30        dir='test_more'
31        file="local/$file"
32fi
33# ---------------------------------------------------------------------------
34if [ "$dir" == '' ]
35then
36        echo "test_one.sh: cannot find dir in front of file"
37        exit 1
38fi
39if [ ! -e "$dir/$file" ]
40then
41        echo "test_one.sh: Cannot find the file $dir/$file"
42        exit 1
43fi
44if [ -e test_one.exe ]
45then
46        rm test_one.exe
47fi
48if [ -e test_one.cpp ]
49then
50        rm test_one.cpp
51fi
52original_dir=`pwd`
53# ---------------------------------------------------------------------------
54# include_flags
55include_flags="-I $original_dir"
56if [ -e @adolc_prefix@/include ]
57then
58        include_flags="$include_flags -I @adolc_prefix@/include"
59fi
60if [ -e @colpack_prefix@/include ]
61then
62        include_flags="$include_flags -I @colpack_prefix@/include"
63fi
64if [ -e @ipopt_prefix@/include ]
65then
66        include_flags="$include_flags -I @ipopt_prefix@/include"
67fi
68if [ -e @eigen_prefix@/include ]
69then
70        include_flags="$include_flags -isystem @eigen_prefix@/include"
71fi
72# --------------------------------------------------------------------------
73# determine the function name
74fun=`grep "^bool *[a-zA-Z0-9_]* *( *void *)" $dir/$file | tail -1 | \
75        sed -e "s/^bool *\([a-zA-Z0-9_]*\) *( *void *)/\1/"`
76#
77# determine the main program main
78main=`echo *$dir | sed -e 's|.*/||' -e 's|$|.cpp|'`
79#
80# create test_one.cpp
81sed < $dir/$main > test_one.cpp \
82-e '/ok *\&= *Run( /d' \
83-e "s/.*This line is used by test_one.sh.*/     ok \&= Run( $fun, \"$fun\");/"
84#
85# compiler flags
86cxx_flags='@cppad_cxx_flags@'
87#
88# library flags
89library_flags=`pkg-config --libs ipopt`
90library_flags="$library_flags @PROJECT_BINARY_DIR@/cppad_lib/libcppad_lib.so"
91library_flags="$library_flags -lboost_thread -lpthread"
92for lib in lib lib64
93do
94        if [ -e @colpack_prefix@/$lib ]
95        then
96                library_flags="$library_flags -L@colpack_prefix@/$lib -lColPack"
97                export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@colpack_prefix@/$lib"
98        fi
99        if [ -e @adolc_prefix@/$lib ]
100        then
101                library_flags="$library_flags -L@adolc_prefix@/$lib -ladolc"
102                export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@adolc_prefix@/$lib"
103        fi
104done
105#
106# compile command
107compile_command="g++ test_one.cpp -o test_one.exe
108        $dir/$file $extra
109        -g
110        $cxx_flags
111        $include_flags
112        $library_flags
113"
114echo "$compile_command"
115$compile_command
116# --------------------------------------------------------------------------
117new_library_path='@PROJECT_BINARY_DIR@/cppad_lib'
118has_library_path='yes'
119if ! echo $LD_LIBRARY_PATH | grep "$new_library_path"
120then
121        has_library_path='no'
122        export LD_LIBRARY_PATH="$new_library_path:$LD_LIBRARY_PATH"
123fi
124# --------------------------------------------------------------------------
125#
126echo "./test_one.exe"
127if ! ./test_one.exe
128then
129        if [ "$has_library_path" == 'no' ]
130        then
131                echo 'Must execute the following command before running in debugger'
132                echo "export LD_LIBRARY_PATH=\"$new_library_path:\$LD_LIBRARY_PATH\""
133        fi
134        exit 1
135fi
136exit 0
Note: See TracBrowser for help on using the repository browser.