Jelajahi Sumber

Revert "Remove unmaintained installation script."

This reverts commit 93b8a8122ccb978179c1642622b89f02ed420058.
bentleyjoakes 5 tahun lalu
induk
melakukan
54b2e4ac05
2 mengubah file dengan 92 tambahan dan 0 penghapusan
  1. 3 0
      README.md
  2. 89 0
      run_AToMPM.sh

+ 3 - 0
README.md

@@ -42,6 +42,9 @@ To run AToMPM on Windows, execute the `run.bat` script inside of the main AToMPM
     3. Open a browser (Firefox or Chrome) and navigate to http://localhost:8124/atompm
 
 * The above steps are automated by the `run_AToMPM_local.sh` script
+* Note that the `run_AToMPM.sh` script can automate the installation and usage of AToMPM
+    * The first time you run this script, all dependencies are automatically downloaded and installed in the `dependencies/` folder.
+    * If, for any reason, the download process is interrupted or you experience problems with AToMPM, remove the `dependencies/` folder and run the script again.
 
 ## Documentation
 Documentation for AToMPM can be found here: https://msdl.uantwerpen.be/documentation/AToMPM/index.html

+ 89 - 0
run_AToMPM.sh

@@ -0,0 +1,89 @@
+#!/bin/bash
+# Author: Yentl Van Tendeloo
+
+set -e
+working_dir=`pwd`
+
+if [ ! -d "dependencies" ]; then
+    mkdir dependencies
+
+    # Install socket.IO first
+    curl -L -O https://msdl.uantwerpen.be/AToMPM/socketIO.tgz
+    tar -xvzf socketIO.tgz
+
+    cd dependencies
+    # First fetch Node.JS
+    curl -L -O http://msdl.uantwerpen.be/AToMPM/node-v4.5.0.tar.gz
+    tar -xvzf node*
+    rm node-*.tar.gz
+    cd node*
+    ./configure --prefix=$working_dir/dependencies/node.js
+    make -j5
+    make install
+    cd ..
+
+    # Install Python with development headers
+    # Install zlib seperately
+    curl -L -O http://msdl.uantwerpen.be/AToMPM/zlib-1.2.8.tar.gz
+    tar -xvzf zlib-*
+    rm zlib-*.tar.gz
+    cd zlib-*
+    ./configure --prefix=$working_dir/dependencies/localPython
+    make
+    make install
+    cd ..
+    curl -L -O http://msdl.uantwerpen.be/AToMPM/Python-2.7.12.tar.xz
+    tar -xvf Python-*
+    rm Python-*.tar.xz
+    cd Python-2.7.12
+    ./configure --prefix=$working_dir/dependencies/localPython
+    sed -i "s/^#zlib/zlib/g" Modules/Setup
+    make -j5
+    make install
+    export PATH=$working_dir/dependencies/localPython/bin:$PATH
+    cd ..
+
+    # Remove previous builds
+    rm -rf python-igraph || true
+    mkdir python-igraph
+    cd python-igraph
+
+    # Install igraph C core
+    curl -L -O http://msdl.uantwerpen.be/AToMPM/igraph-0.7.1.tar.gz
+    tar -xvzf igraph-*
+    rm igraph-*.tar.gz
+    cd igraph-*
+    ./configure
+    make -j5
+
+    # Install python-igraph binding
+    curl -L -O http://msdl.uantwerpen.be/AToMPM/python-igraph-0.7.1.post6.tar.gz
+    tar -xvzf python-igraph-*
+    rm python-igraph-*.tar.gz
+    cd python-igraph-*
+    rm setup.cfg
+    echo "[build_ext]" > setup.cfg
+    echo "include_dirs = ../../../localPython/include/python2.7:../../build/include:../include:../../include:/usr/local/include:/usr/include" >> setup.cfg
+    echo "library_dirs = ../../../localPython/lib:../../build/src/.libs:../lib/:../src/.libs:../../src/.libs:/usr/local/lib:/usr/lib" >> setup.cfg
+    echo "" >> setup.cfg
+    echo "[egg_info]" >> setup.cfg
+    echo "tag_build = " >> setup.cfg
+    echo "tag_date = 0" >> setup.cfg
+    echo "tag_svn_revision = 0" >> setup.cfg
+    python setup.py install --user
+    cd ..
+
+    echo "INSTALLATION SUCCESSFUL"
+    echo "Continuing to start up AToMPM!"
+    cd ..
+    cd ..
+    cd ..
+fi
+
+# Set PATHs correctly
+export PATH=$working_dir/dependencies/localPython/bin:$working_dir/dependencies/node.js/bin:$PATH
+export LD_LIBRARY_PATH="$working_dir/dependencies/python-igraph/igraph-0.7.1/src/.libs/:$working_dir/dependencies/localPython/lib"
+
+node httpwsd.js &
+sleep 3
+python mt/main.py