COIN-OR::LEMON - Graph Library

source: lemon-1.2/scripts/bootstrap.sh @ 747:a42f46828cc1

Last change on this file since 747:a42f46828cc1 was 747:a42f46828cc1, checked in by Alpar Juttner <alpar@…>, 10 years ago

Add soplex support to scripts/bootstrap.sh plus...
it checks whether cbc and soplex are installed at the given prefix.

  • Property exe set to *
File size: 2.9 KB
Line 
1#!/bin/bash
2#
3# This file is a part of LEMON, a generic C++ optimization library.
4#
5# Copyright (C) 2003-2009
6# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7# (Egervary Research Group on Combinatorial Optimization, EGRES).
8#
9# Permission to use, modify and distribute this software is granted
10# provided that this copyright notice appears in all copies. For
11# precise terms see the accompanying LICENSE file.
12#
13# This software is provided "AS IS" with no warranty of any kind,
14# express or implied, and with no claim as to its suitability for any
15# purpose.
16
17
18if [ ! -f ~/.lemon-bootstrap ]; then
19    echo 'Create ~/.lemon-bootstrap'.
20    cat >~/.lemon-bootstrap <<EOF
21#
22# Default settings for bootstraping the LEMON source code repository
23#
24EOF
25fi
26
27source ~/.lemon-bootstrap
28if [ -f ../../../.lemon-bootstrap ]; then source ../../../.lemon-bootstrap; fi
29if [ -f ../../.lemon-bootstrap ]; then source ../../.lemon-bootstrap; fi
30if [ -f ../.lemon-bootstrap ]; then source ../.lemon-bootstrap; fi
31if [ -f ./.lemon-bootstrap ]; then source ./.lemon-bootstrap; fi
32
33
34function augment_config() {
35    if [ "x${!1}" == "x" ]; then
36        eval $1=$2
37        echo Add "'$1'" to '~/.lemon-bootstrap'.
38        echo >>~/.lemon-bootstrap
39        echo $3 >>~/.lemon-bootstrap
40        echo $1=$2 >>~/.lemon-bootstrap
41    fi
42}
43
44augment_config LEMON_INSTALL_PREFIX /usr/local \
45    "# LEMON installation prefix"
46
47augment_config COIN_OR_PREFIX /usr/local/coin-or \
48    "# COIN-OR installation root prefix (used for CLP/CBC)"
49
50augment_config SOPLEX_PREFIX /usr/local/soplex \
51    "# Soplex build prefix"
52
53
54function ask() {
55echo -n "$1 [$2]? "
56read _an
57if [ "x$_an" == "x" ]; then
58    ret="$2"
59else
60    ret=$_an
61fi
62}
63
64function yesorno() {
65    ret='rossz'
66    while [ "$ret" != "y" -a "$ret" != "n" -a "$ret" != "yes" -a "$ret" != "no" ]; do
67        ask "$1" "$2"
68    done
69    if [ "$ret" != "y" -a "$ret" != "yes" ]; then
70        return 1
71    else
72        return 0
73    fi
74}
75
76if yesorno "External build" "n"
77then
78    CONFIGURE_PATH=".."
79else
80    CONFIGURE_PATH="."
81    if yesorno "Autoreconf" "y"
82    then
83        AUTORE=yes
84    else
85        AUTORE=no
86    fi
87fi
88
89if yesorno "Optimize" "n"
90then
91    opt_flags=' -O2'
92else
93    opt_flags=''
94fi
95
96if yesorno "Stop on warning" "y"
97then
98    werror_flags=' -Werror'
99else
100    werror_flags=''
101fi
102
103cxx_flags="CXXFLAGS=-ggdb$opt_flags$werror_flags"
104
105if [ -f ${COIN_OR_PREFIX}/include/coin/config_coinutils.h ]; then
106    if yesorno "Use COIN-OR (CBC/CLP)" "n"
107    then
108        coin_flag="--with-coin=$COIN_OR_PREFIX"
109    else
110        coin_flag=""
111    fi
112else
113    coin_flag=""       
114fi
115
116if [ -f ${SOPLEX_PREFIX}/src/soplex.h ]; then
117    if yesorno "Use Soplex" "n"
118    then
119        soplex_flag="--with-soplex=$SOPLEX_PREFIX"
120    else
121        soplex_flag=""
122    fi
123else
124    soplex_flag=""
125fi
126
127if [ "x$AUTORE" == "xyes" ]; then
128    autoreconf -vif;
129fi
130${CONFIGURE_PATH}/configure --prefix=$LEMON_INSTALL_PREFIX \
131"$cxx_flags" \
132$coin_flag \
133$soplex_flag \
134$*
Note: See TracBrowser for help on using the repository browser.