Skip to content

Instantly share code, notes, and snippets.

@iwatakeshi
Created April 19, 2017 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iwatakeshi/b4fd17223e5c7875605a02e08e9e98a3 to your computer and use it in GitHub Desktop.
Save iwatakeshi/b4fd17223e5c7875605a02e08e9e98a3 to your computer and use it in GitHub Desktop.
Installs Insight for Ubuntu
#!/bin/bash
get_deps() {
sudo apt install build-essentials autoconf autogen texinfo zlib1g-dev tcl-dev tk-dev mesa-common-dev libjpeg-dev libtogl-dev python-dev flex bison itcl3 itk3 iwidgets4 git
}
get_insight() {
git clone --recursive https://github.com/monnerat/insight.git
}
cd_to_insight() {
cd ./insight/
}
cd_to_gdb() {
cd ./bundle/gdb/
}
cd_out_of_gdb() {
cd "../../"
}
reinstall_gdb() {
sudo apt remove gdb && sudo apt install gdb
}
clean_up() {
cd ../ && rm -r -f ./insight/
}
install_insight () {
cd_to_insight && autoconf && ./configure --prefix=/usr/. \
--libdir=/usr/lib64 \
--disable-binutils \
--disable-elfcpp \
--disable-gas \
--disable-gold \
--disable-gprof \
--disable-ld \
--disable-rpath \
--disable-zlib \
--enable-sim \
--with-gdb-datadir=/usr/share/insight \
--with-jit-reader-dir=/usr/lib64/insight \
--with-separate-debug-dir='/usr/lib/debug' \
--with-expat \
--with-python \
--without-libunwind && make && cd_to_gdb make && cd_out_of_gdb && sudo make install
}
if [ -d "./insight/" ]; then
install_insight && reinstall_gdb && clean_up
else
get_deps && get_insight && install_insight && reinstall_gdb && clean_up
fi
@iwatakeshi
Copy link
Author

Usage

# change permissions
chmod +x ./insight.sh
# note that the dot before the script is required
. ./insight.sh

@mdfeiza
Copy link

mdfeiza commented Aug 23, 2021

how can I use this code to install "Insight" on ubuntu?

@wg-xu
Copy link

wg-xu commented May 5, 2022

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,选中 'python-dev-is-python2' 而非 'python-dev'
E: 无法定位软件包 build-essentials

但是我遇到了这样的bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment