Skip to content

Commit aa7766b

Browse files
authored
Merge pull request #291 from SylvainLan/SylvainLan/issue290
OK thanks, @SylvainLan. Merging.
2 parents 3d5bd7c + b34e168 commit aa7766b

File tree

2 files changed

+57
-26
lines changed

2 files changed

+57
-26
lines changed

README.rst

100755100644
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Installation
5050
============
5151
To begin with, you may also want to install the pre-compiled version of SPM (in case you don't have matlab, etc.). Just run the following::
5252

53-
$ bash continuous_integration/install_spm.sh
53+
$ . continuous_integration/install_spm12.sh
5454

5555
First, install neurodebian-travis::
5656

@@ -191,8 +191,14 @@ or if you have write privileges::
191191
192192
Common problems and fixes
193193
=========================
194-
* libXp.so.6 missing (in ubuntu >= 15.10, for example)
195-
This is a known is http://askubuntu.com/questions/719839/libxp-so-6-missing-15-10. The idea is to install it manually from official sources https://launchpad.net/ubuntu/wily/+package/libxp6
194+
* libXp.so.6 missing (in ubuntu >= 15.10, for example). You'll need to install it manually by executing the following lines in a terminal (you'll need root)::
195+
196+
$ sudo add-apt-repository "deb http://securuty.ubuntu.com/ubuntu precise-security main"
197+
$ sudo apt update
198+
$ sudo apt install lixp6
199+
$ sudo add-apt-repository -r "deb http://securuty.ubuntu.com/ubuntu precise-security main"
200+
201+
196202

197203
* whitespaces in the directory name for the variable 'scratch' triggers a bug in nipype and results in a crash (have not tested if this also occur for other path variables)
198204

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,71 @@
11
#! /bin/bash
2+
# Time-stamp: <2018-02-14 11:26:59 cp983411>
3+
4+
# Download and install SPM12 standalone (no Matlab license required)
5+
# see https://en.wikibooks.org/wiki/SPM/Standalone
6+
27
set -e
8+
# set -x # echo on for debugging
39

4-
# set -x # echo on
10+
# Installation directory can be specified as first argument on the command line
11+
# Warning: use a fully qualitifed path (from root) to correctly set up env variables
12+
13+
if [ $# -eq 0 ]
14+
then
15+
SPM_ROOT_DIR=$HOME/opt/spm12 # default
16+
else
17+
SPM_ROOT_DIR=$1
18+
fi
519

6-
SPM_ROOT_DIR=~/opt/spm12 # Installation directory
20+
mkdir -p $SPM_ROOT_DIR
721

8-
SPM_SRC=spm12_r7219.zip # this used to be spm12_r6914.zip, watch out it might get pulled down again!!!
22+
# Download
23+
SPM_SRC=spm12_r????.zip
924
MCRINST=MCRInstaller.bin
1025

11-
mkdir -p $SPM_ROOT_DIR && cd $SPM_ROOT_DIR
26+
wget -N -r -l1 --no-parent -nd -P $SPM_ROOT_DIR -A.zip -R "index.html*" http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/
1227

13-
if [ ! -d spm12 ]; then
14-
if [ ! -f ${SPM_SRC} ]; then
15-
wget http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/${SPM_SRC}
16-
fi
17-
unzip -q ${SPM_SRC}
18-
chmod 755 spm12/run_spm12.sh
19-
fi
28+
wget -N -r -l1 --no-parent -nd -P $SPM_ROOT_DIR -A.bin http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/MCR/glnxa64/
2029

21-
if [ ! -d mcr ]; then
22-
if [ ! -f MCRInstaller.bin ]; then
23-
wget http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/MCR/glnxa64/${MCRINST}
24-
fi
25-
chmod 755 ${MCRINST}
26-
./${MCRINST} -P bean421.installLocation="mcr" -silent
27-
fi
2830

31+
# Install
32+
cd $SPM_ROOT_DIR
33+
unzip -q -u ${SPM_SRC}
34+
chmod 755 spm12/run_spm12.sh
2935

30-
if [ ! -f $SPM_ROOT_DIR/spm12.sh ]; then
31-
cat <<EOF > $SPM_ROOT_DIR/spm12.sh
36+
if [ ! -d mcr ]; then
37+
chmod 755 ${MCRINST}
38+
./${MCRINST} -P bean421.installLocation="mcr" -silent
39+
fi
40+
41+
# create start-up script
42+
cat <<EOF > spm12.sh
3243
#!/bin/bash
3344
SPM12_STANDALONE_HOME=$SPM_ROOT_DIR/spm12
3445
exec "\${SPM12_STANDALONE_HOME}/run_spm12.sh" "\${SPM12_STANDALONE_HOME}/../mcr/v713" \${1+"\$@"}
3546
EOF
3647

37-
chmod 755 $SPM_ROOT_DIR/spm12.sh
48+
chmod 755 spm12.sh
49+
50+
if [ ! -f /usr/lib/x86_64-linux-gnu/libXp.so.6 ]; then
51+
echo "WARNING!!!"
52+
echo "/usr/lib/x86_64-linux-gnu/libXp.so.6 is missing"
53+
echo
54+
echo To install it:
55+
echo 'sudo add-apt-repository "deb http://securuty.ubuntu.com/ubuntu precise-security main"'
56+
echo 'sudo apt update'
57+
echo 'sudo apt install lixp6'
58+
echo 'sudo add-apt-repository -r "deb http://securuty.ubuntu.com/ubuntu precise-security main"'
3859
fi
3960

4061
# Create CTF
41-
$SPM_ROOT_DIR/spm12.sh quit
62+
${SPM_ROOT_DIR}/spm12.sh quit
4263
cmds="export SPM_DIR=$SPM_ROOT_DIR/spm12/; export SPM_MCR=$SPM_ROOT_DIR/spm12.sh"
4364
${cmds}
44-
echo "You may want to add the following commands (the exports) to your ~/.bashrc file once and for all."
4565
echo
4666
echo ${cmds}
67+
echo "IMPORTANT: you should now execute the following line: "
68+
echo "echo ${cmds} >> $HOME/.bashrc"
69+
70+
71+

0 commit comments

Comments
 (0)