source: trunk/bin/get_eigen.sh @ 2912

Last change on this file since 2912 was 2912, checked in by bradbell, 7 years ago

get_eigen.sh: attempt to get around certificate problem on coin-jenkins.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#! /bin/bash -e
2# $Id: get_eigen.sh 2912 2013-10-09 22:02:08Z 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_eigen.sh$$ $newlinech #$$
14# $spell
15#       Eigen
16#       CppAD
17# $$
18#
19# $section Download and Install Eigen in Build Directory$$
20# $index eigen, download and install$$
21# $index download, install eigen$$
22# $index install, eigen$$
23#
24# $head Syntax$$
25# $code bin/get_eigen.sh$$
26#
27# $head Purpose$$
28# If you are using Unix, this command will download and install
29# $href%http://eigen.tuxfamily.org%Eigen%$$ 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 Eigen source code is downloaded into the sub-directory
38# $code build/external$$ below the distribution directory.
39#
40# $head Prefix Directory$$
41# The Eigen include files are installed in the sub-directory
42# $code build/prefix/include/EIGEN$$ below the distribution directory.
43#
44# $end
45# -----------------------------------------------------------------------------
46if [ $0 != "bin/get_eigen.sh" ]
47then
48        echo "bin/get_eigen.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 eigen to build/external and install it to build/prefix'
59version='3.1.3'
60web_page='https://bitbucket.org/eigen/eigen/get'
61prefix=`pwd`'/build/prefix'
62# -----------------------------------------------------------------------------
63if [ ! -d external ]
64then
65        echo_eval mkdir -p build/external
66fi
67echo_eval cd build/external
68# -----------------------------------------------------------------------------
69if [ ! -e "eigen-$version.tar.gz" ]
70then
71        echo_eval wget --no-check-certificate $web_page/$version.tar.gz
72        echo_eval mv $version.tar.gz eigen-$version.tar.gz
73fi
74if [ -e eigen-eigen-* ]
75then
76        echo_eval rm -r eigen-eigen-*
77fi
78if [ -e "eigen-$version" ]
79then
80        echo_eval rm -r eigen-$version
81fi
82if [ -e "$prefix/include/Eigen" ]
83then
84        echo_eval rm "$prefix/include/Eigen"
85fi
86echo_eval tar -xzf eigen-$version.tar.gz
87#
88git_name=`ls | grep eigen-eigen`
89echo_eval mv $git_name eigen-$version
90#
91echo_eval cd eigen-$version
92echo_eval mkdir build
93echo_eval cd build
94echo_eval cmake .. -DCMAKE_INSTALL_PREFIX=$prefix
95echo_eval make install
96echo_eval ln -s $prefix/include/eigen3/Eigen $prefix/include/Eigen
97#
98echo "get_eigen.sh: OK"
Note: See TracBrowser for help on using the repository browser.