run_AToMPM.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. rm node-*.tar.gz
  15. cd node*
  16. ./configure --prefix=$working_dir/dependencies/node.js
  17. make -j5
  18. make install
  19. cd ..
  20. # Install Python with development headers
  21. # Install zlib seperately
  22. curl -L -O http://msdl.uantwerpen.be/AToMPM/zlib-1.2.8.tar.gz
  23. tar -xvzf zlib-*
  24. rm zlib-*.tar.gz
  25. cd zlib-*
  26. ./configure --prefix=$working_dir/dependencies/localPython
  27. make
  28. make install
  29. cd ..
  30. curl -L -O http://msdl.uantwerpen.be/AToMPM/Python-2.7.12.tar.xz
  31. tar -xvf Python-*
  32. rm Python-*.tar.xz
  33. cd Python-2.7.12
  34. ./configure --prefix=$working_dir/dependencies/localPython
  35. sed -i "s/^#zlib/zlib/g" Modules/Setup
  36. make -j5
  37. make install
  38. export PATH=$working_dir/dependencies/localPython/bin:$PATH
  39. cd ..
  40. # Remove previous builds
  41. rm -rf python-igraph || true
  42. mkdir python-igraph
  43. cd python-igraph
  44. # Install igraph C core
  45. curl -L -O http://msdl.uantwerpen.be/AToMPM/igraph-0.7.1.tar.gz
  46. tar -xvzf igraph-*
  47. rm igraph-*.tar.gz
  48. cd igraph-*
  49. ./configure
  50. make -j5
  51. # Install python-igraph binding
  52. curl -L -O http://msdl.uantwerpen.be/AToMPM/python-igraph-0.7.1.post6.tar.gz
  53. tar -xvzf python-igraph-*
  54. rm python-igraph-*.tar.gz
  55. cd python-igraph-*
  56. rm setup.cfg
  57. echo "[build_ext]" > setup.cfg
  58. echo "include_dirs = ../../../localPython/include/python2.7:../../build/include:../include:../../include:/usr/local/include:/usr/include" >> setup.cfg
  59. echo "library_dirs = ../../../localPython/lib:../../build/src/.libs:../lib/:../src/.libs:../../src/.libs:/usr/local/lib:/usr/lib" >> setup.cfg
  60. echo "" >> setup.cfg
  61. echo "[egg_info]" >> setup.cfg
  62. echo "tag_build = " >> setup.cfg
  63. echo "tag_date = 0" >> setup.cfg
  64. echo "tag_svn_revision = 0" >> setup.cfg
  65. python setup.py install --user
  66. cd ..
  67. echo "INSTALLATION SUCCESSFUL"
  68. echo "Continuing to start up AToMPM!"
  69. cd ..
  70. cd ..
  71. cd ..
  72. fi
  73. # Set PATHs correctly
  74. export PATH=$working_dir/dependencies/localPython/bin:$working_dir/dependencies/node.js/bin:$PATH
  75. export LD_LIBRARY_PATH="$working_dir/dependencies/python-igraph/igraph-0.7.1/src/.libs/:$working_dir/dependencies/localPython/lib"
  76. node httpwsd.js &
  77. sleep 3
  78. python mt/main.py