source: trunk/test_more/test_one.sh.in @ 3754

Last change on this file since 3754 was 3754, checked in by bradbell, 4 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 4d397fa0c1ba147098a173bdbbca67432066d6e8
end hash code: 7dfec41e8207862aebc5f7ca502453f0aeda4640

commit 7dfec41e8207862aebc5f7ca502453f0aeda4640
Author: Brad Bell <bradbell@…>
Date: Thu Nov 26 12:48:39 2015 -0800

Remove invisible white space.

commit 8537354fe503177568e5e9ee92ade691749e5201
Author: Brad Bell <bradbell@…>
Date: Thu Nov 26 12:48:31 2015 -0800

Create cppad object library with cppad_colpack.cpp as its initial object.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1#! /bin/bash -e
2# $Id: test_one.sh.in 3754 2015-11-26 22:23:05Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 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#
14# Run one of the tests
15if [ "$1" = "" ]
16then
17        echo "usage: test_one.sh file [extra]"
18        echo "file is the *.cpp file name with extension"
19        echo "and extra is extra options for g++ command"
20        exit 1
21fi
22if [ ! -e "$1" ]
23then
24        echo "Cannot find the file $1"
25        exit 1
26fi
27fun=`grep "^bool *[a-zA-Z0-9_]* *( *void *)" $1 | tail -1 | \
28        sed -e "s/^bool *\([a-zA-Z0-9_]*\) *( *void *)/\1/"`
29if [ -e test_one.exe ]
30then
31        rm test_one.exe
32fi
33sed < test_more.cpp > test_one.cpp \
34-e '/ok *\&= *Run( /d' \
35-e "s/.*This line is used by test_one.sh.*/     ok \&= Run( $fun, \"$fun\");/"
36#
37#
38cxxflags='@cppad_cxx_flags@'
39if echo "$fun" | grep 'eigen' > /dev/null
40then
41        cxxflags=`echo "$cxxflags" | sed -e 's|-Wshadow||'`
42fi
43cmd="g++ test_one.cpp $*"
44cmd="$cmd
45        -o test_one.exe
46        $cxxflags
47        -L @cppad_BINARY_DIR@/cppad_lib
48        -lcppad_lib
49        -g
50        -fopenmp
51        -DCPPAD_ADOLC_TEST
52        -DCPPAD_OPENMP_TEST
53        -I..
54"
55if [ -e @adolc_prefix@/include ]
56then
57        cmd="$cmd -I@adolc_prefix@/include"
58fi
59if [ -e @colpack_prefix@/include ]
60then
61        cmd="$cmd -I@colpack_prefix@/include"
62fi
63if [ -e @eigen_prefix@/include ]
64then
65        cmd="$cmd -I@eigen_prefix@/include"
66fi
67for lib in lib lib64
68do
69        if [ -e @adolc_prefix@/$lib ]
70        then
71                cmd="$cmd -L@adolc_prefix@/$lib -ladolc -lColPack"
72                export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@adolc_prefix@/$lib"
73        fi
74        if [ -e @colpack_prefix@/$lib ]
75        then
76                cmd="$cmd -L@colpack_prefix@/$lib -lColPack"
77                export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@colpack_prefix@/$lib"
78        fi
79        if [ -e @ipopt_prefix@/$lib/pkgconfig ]
80        then
81                export PKG_CONFIG_PATH="@ipopt_prefix@/$lib/pkgconfig"
82                cflags=`pkg-config --cflags ipopt |
83                        sed -e 's|/coin$|/|' -e 's|/coin | |'`
84                libs=`pkg-config --libs ipopt`
85                cmd="$cmd $cflags $libs"
86        fi
87done
88export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:@cppad_BINARY_DIR@/cppad_lib"
89echo $cmd
90$cmd
91echo "./test_one.exe"
92if ! ./test_one.exe
93then
94        exit 1
95fi
96exit 0
Note: See TracBrowser for help on using the repository browser.