run_AToMPM.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # Author: Yentl Van Tendeloo
  3. set -e
  4. working_dir=`pwd`
  5. if [ ! -d "dependencies" ]; then
  6. mkdir dependencies
  7. # Install socket.IO first
  8. curl -L -O https://msdl.uantwerpen.be/AToMPM/socketIO.tgz
  9. tar -xvzf socketIO.tgz
  10. cd dependencies
  11. # First fetch Node.JS
  12. curl -L -O http://msdl.uantwerpen.be/AToMPM/node-v4.5.0.tar.gz
  13. tar -xvzf node*
  14. cd node*
  15. ./configure --prefix=$working_dir/dependencies/node.js
  16. make -j5
  17. make install
  18. cd ..
  19. # Install Python with development headers
  20. # Install zlib seperately
  21. curl -L -O http://msdl.uantwerpen.be/AToMPM/zlib-1.2.8.tar.gz
  22. tar -xvzf zlib-*
  23. cd zlib-*
  24. ./configure --prefix=$working_dir/dependencies/localPython
  25. make
  26. make install
  27. cd ..
  28. curl -L -O http://msdl.uantwerpen.be/AToMPM/Python-2.7.12.tar.xz
  29. tar -xvf Python-*
  30. cd Python-2.7.12
  31. ./configure --prefix=$working_dir/dependencies/localPython
  32. sed -i "s/^#zlib/zlib/g" Modules/Setup
  33. make -j5
  34. make install
  35. export PATH=$working_dir/dependencies/localPython/bin:$PATH
  36. cd ..
  37. # Remove previous builds
  38. rm -rf python-igraph || true
  39. mkdir python-igraph
  40. cd python-igraph
  41. # Install igraph C core
  42. curl -L -O http://msdl.uantwerpen.be/AToMPM/igraph-0.7.1.tar.gz
  43. tar -xvzf igraph-*
  44. cd igraph-*
  45. ./configure
  46. make -j5
  47. # Install python-igraph binding
  48. curl -L -O http://msdl.uantwerpen.be/AToMPM/python-igraph-0.7.1.post6.tar.gz
  49. tar -xvzf python-igraph-*
  50. cd python-igraph-*
  51. rm setup.cfg
  52. echo "[build_ext]" > setup.cfg
  53. echo "include_dirs = ../../../localPython/include/python2.7:../../build/include:../include:../../include:/usr/local/include:/usr/include" >> setup.cfg
  54. echo "library_dirs = ../../../localPython/lib:../../build/src/.libs:../lib/:../src/.libs:../../src/.libs:/usr/local/lib:/usr/lib" >> setup.cfg
  55. echo "" >> setup.cfg
  56. echo "[egg_info]" >> setup.cfg
  57. echo "tag_build = " >> setup.cfg
  58. echo "tag_date = 0" >> setup.cfg
  59. echo "tag_svn_revision = 0" >> setup.cfg
  60. python setup.py install --user
  61. cd ..
  62. echo "INSTALLATION SUCCESSFUL"
  63. echo "Continuing to start up AToMPM!"
  64. cd ..
  65. cd ..
  66. cd ..
  67. fi
  68. # Set PATHs correctly
  69. export PATH=$working_dir/dependencies/localPython/bin:$working_dir/dependencies/node.js/bin:$PATH
  70. export LD_LIBRARY_PATH="$working_dir/dependencies/python-igraph/igraph-0.7.1/src/.libs/:$working_dir/dependencies/localPython/lib"
  71. node httpwsd.js &
  72. sleep 3
  73. python mt/main.py