~tes/goby/2.1-git

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
# Dependencies installation script for Goby
#
# At a minimum, Goby can be built in a C++ development environment 
# that also includes Google Protocol Buffers (http://code.google.com/p/protobuf/)
# and Boost (http://www.boost.org/). Both of these will readily compile on most
# embedded systems. The other dependencies add useful functionality.
function usage()
{
    echo "usage: ./DEPENDENCIES distribution [ALL] [DOC]";
    echo "";
    echo "distribution can be:";
    echo "debian"
    echo "ubuntu"
    echo "fedora"
    echo "opensuse"
    echo;
    echo "Other distributions should determine their dependencies"
    echo "by reading this file (less DEPENDENCIES). Please improve this script"
    echo "by adding your distribution."

    echo "option ALL installs all optional code dependencies";
    echo "option DOC installs all dependencies for generating documentation (doxygen, latex, etc.)";
}

if [ $# -lt 1 ]; then usage; exit 1; fi;
if [[ $UID -ne 0 ]]; then printf "You must run this script as root. Use 'sudo' in Ubuntu. \n" 1>&2; exit 1; fi


echo "Installing dependencies for $1 ...";
install_doc=0; if [[ $2 == "DOC" || $3 == "DOC" ]]; then install_doc=1; fi;
if [ $install_doc -ne 0 ]; then echo "Installing documentation dependencies ..."; fi
install_all=0; if [[ $2 == "ALL" || $3 == "ALL" ]]; then install_all=1; fi;
if [ $install_all -ne 0 ]; then echo "Installing all dependencies ..."; fi

set -u -e 

case $1 in
ubuntu|debian)
        # additionally, debian will require:
        # DCCL3 from source: http://libdccl.org

        if [[ -e "`which aptitude`" ]]; then
            package_manager=aptitude
        else
            package_manager=apt-get
        fi
        
        install_command="install"

        packages="build-essential
            cmake
            libboost-dev
            libboost-system-dev
            libboost-date-time-dev
            libboost-thread-dev
            libboost-program-options-dev
            libboost-filesystem-dev
            libboost-signals-dev
            libboost-regex-dev
            libprotobuf-dev
            libprotoc-dev
            protobuf-compiler
            libgmp3-dev"
        if [ $install_all -ne 0 ]; then 
            packages="${packages}
            libcrypto++-dev
            libncurses-dev
            libzmq-dev
            libwt-dev
            libwtdbo-dev
            libwtdbosqlite-dev
            libwthttp-dev
            libsqlite3-dev"
        fi

        if [[ $1 == "ubuntu" ]]; then
            add-apt-repository ppa:dccl-dev/ppa -s -y
            apt-get update -qq
            set +x
            packages="${packages} 
            libdccl3-dev"
        fi
        
        if [ $install_doc -ne 0 ]; then 
            packages="${packages} 
            graphviz
            doxygen
            texlive-xetex
            ttf-sil-gentium
            imagemagick
            texlive-fonts-recommended
            texlive-font-utils
            ghostscript
            lmodern
            texlive-latex-recommended
            texlive-latex-extra"
        fi
       
        # PPA dependencies
        if [[ $1 == "ubuntu" &&  $install_all -ne 0 ]]; then 
            set -x
            add-apt-repository ppa:goby-dev/ppa -s -y 
            add-apt-repository ppa:tes/lamss-moos10 -s -y
            apt-get update -qq
            set +x

            # override and use build-dep if ALL and DOC are requested
            if [ $install_doc -ne 0 ]; then
                package_manager="apt-get"
                install_command="build-dep"
                packages="libgoby2"
            else
                packages="${packages} 
            libmoos10-dev
            libproj-dev"
            fi
        fi
        ;;
fedora)
        package_manager=yum
        install_command="install"
        packages="cmake
            protobuf-devel
            boost-devel"

        if [[ $install_all -ne 0 || $install_doc -ne 0 ]]; then 
            echo "Warning: ALL and DOC are not yet supported for $1"
        fi
        ;; 
opensuse)
        package_manager=zypper
        install_command="install"
        packages="make gcc gcc-c++
            protobuf-devel
            boost-devel"

        if [[ $install_all -ne 0 || $install_doc -ne 0 ]]; then 
            echo "Warning: ALL and DOC are not yet supported for $1"
        fi

        ;; 
*)
   echo -e "Invalid distribution: $1\n"; usage; exit 1;;
esac

echo "Installing: ${packages}..."

set -x

${package_manager} ${install_command} ${packages}


# Fedora notes
# - base
# yum install cmake
# yum install protobuf-devel
# yum install boost-devel

# OpenSuSe Notes
# - base
# zypper install -t pattern devel_C_C++
# zypper install cmake
# zypper install boost-devel
# zypper install protobuf-devel
# - optional
# zypper install libxerces-c-devel
# (crypto++ from src)
# zypper install wt-devel



# MAC OS X
# Use MacPorts to install the needed dependencies. You will have 
# to install Wt from source to /opt/local 
# I believe these are the ports necessary to compile moos-ivp,
# moos-ivp-local, and goby:
# 
# - base
# boost +universal
# protobuf-cpp
# cmake
# - optional
# jpeg +universal
# libcryptopp +universal
# ncurses +universal
# ncursesw
# socat
# tiff +universal
# xercesc
# zlib +universal


# Windows
# Goby does not currently build on Windows