source: trunk/bin/get_ipopt.sh @ 2916

Last change on this file since 2916 was 2916, checked in by bradbell, 7 years ago
  1. svn does not work on coin-jenkins, so try using wget.
  2. Take out edit of source code (now have option to suppress printing).
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1#! /bin/bash -e
2# $Id: get_ipopt.sh 2916 2013-10-10 13:29:10Z 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# $begin get_ipopt.sh$$ $newlinech #$$
14# $spell
15#       Ipopt
16#       CppAD
17# $$
18#
19# $section Download and Install Ipopt in Build Directory$$
20# $index ipopt, download and install$$
21# $index download, install ipopt$$
22# $index install, ipopt$$
23#
24# $head Syntax$$
25# $code bin/get_ipopt.sh$$
26#
27# $head Purpose$$
28# If you are using Unix, this command will download and install
29# $href%http://www.coin-or.org/projects/Ipopt.xml%Ipopt%$$ in the
30# CppAD $code build$$ directory.
31#
32# $head Distribution Directory$$
33# This command must be executed in the
34# $cref/distribution directory/download/Distribution Directory/$$.
35#
36# $head External Directory$$
37# The Ipopt source code is downloaded and compiled in the sub-directory
38# $code build/external$$ below the distribution directory.
39#
40# $head Prefix Directory$$
41# The Ipopt libraries and include files are installed in the sub-directory
42# $code build/prefix$$ below the distribution directory.
43#
44# $end
45# -----------------------------------------------------------------------------
46if [ $0 != "bin/get_ipopt.sh" ]
47then
48        echo "bin/get_ipopt.sh: must be executed from its parent directory"
49        exit 1
50fi
51# -----------------------------------------------------------------------------
52# bash function that echos and executes a command
53echo_eval() {
54        echo $*
55        eval $*
56}
57# -----------------------------------------------------------------------------
58echo 'Download ipopt to build/external and install it to build/prefix'
59version='3.10.4'
60web_page='http://www.coin-or.org/download/source/Ipopt'
61prefix=`pwd`'/build/prefix'
62# -----------------------------------------------------------------------------
63if [ ! -d build/external ]
64then
65        echo_eval mkdir -p build/external
66fi
67echo_eval cd build/external
68# -----------------------------------------------------------------------------
69if [ ! -e "Ipopt-$version.tgz" ]
70then
71        echo_eval wget --no-check-certificate "$web_page/Ipopt-$version.tgz"
72fi
73if [ ! -e "Ipopt-$version" ]
74then
75        echo_eval tar -xzf Ipopt-$version.tgz
76fi
77echo_eval cd "Ipopt-$version"
78# -----------------------------------------------------------------------------
79for file in ThirdParty/Blas/get.Blas ThirdParty/Lapack/get.Lapack
80do
81        sed -e 's|ftp:\(\/\/www.netlib.org\/\)|http:\1|' \
82                -i $file
83done
84# -----------------------------------------------------------------------------
85if [ -e ThirdParty/HSL ]
86then
87        echo_eval rm -rf ThirdParty/HSL
88fi
89for package in Blas Lapack Metis Mumps
90do
91        if [ ! -e "ThirdParty/$package/get.$package.done" ]
92        then
93                echo_eval cd ThirdParty/$package
94                echo_eval "./get.$package"
95                echo_eval touch "get.$package.done" 
96                echo_eval cd ../..
97        fi
98done
99# -----------------------------------------------------------------------------
100if [ -e /usr/lib64 ]
101then
102        libdir='lib64'
103else
104        libdir='lib'
105fi
106export PKG_CONFIG_PATH="$prefix/$libdir/pkgconfig"
107echo_eval ./configure \
108        --enable-debug \
109        --prefix="$prefix" \
110        --libdir="$prefix/$libdir" 
111# -----------------------------------------------------------------------------
112echo_eval make install
Note: See TracBrowser for help on using the repository browser.