The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

97 lines
2.2 KiB

3 months ago
  1. #!/bin/bash
  2. set -e
  3. # Helper for travis folding
  4. travis_fold() {
  5. local action=$1
  6. local name=$2
  7. echo -en "travis_fold:${action}:${name}\r"
  8. }
  9. # Helper for building and testing
  10. run() {
  11. # We start in /opt/stormpy
  12. cd ..
  13. # Build carl-parser
  14. travis_fold start build_carl_parser
  15. git clone --single-branch -b master14 https://github.com/ths-rwth/carl-parser
  16. cd carl-parser
  17. mkdir build
  18. cd build
  19. cmake .. "${CMAKE_ARGS[@]}"
  20. make carl-parser -j 1
  21. cd ../..
  22. travis_fold end build_carl_parser
  23. # Create virtual environment
  24. travis_fold start virtualenv
  25. virtualenv --python=$PYTHON venv
  26. source venv/bin/activate
  27. # Print version
  28. python --version
  29. travis_fold end virtualenv
  30. # Build pycarl
  31. travis_fold start build_pycarl
  32. git clone https://github.com/moves-rwth/pycarl.git
  33. cd pycarl
  34. case "$CONFIG" in
  35. Debug*)
  36. python setup.py build_ext --debug -j 1 develop
  37. ;;
  38. *)
  39. python setup.py build_ext -j 1 develop
  40. ;;
  41. esac
  42. cd ..
  43. travis_fold end build_pycarl
  44. # Build stormpy
  45. travis_fold start build_stormpy
  46. cd stormpy
  47. case "$CONFIG" in
  48. Debug*)
  49. python setup.py build_ext --storm-dir /opt/storm/build/ --debug -j 1 develop
  50. ;;
  51. *)
  52. python setup.py build_ext --storm-dir /opt/storm/build/ -j 1 develop
  53. ;;
  54. esac
  55. travis_fold end build_stormpy
  56. # Perform tasks
  57. if [[ "$TASK" == *Test* ]]
  58. then
  59. # Install dependencies for tests
  60. pip install numpy # Used in sphinx tests
  61. # Run tests
  62. python setup.py test
  63. fi
  64. if [[ "$TASK" == *Documentation* ]]
  65. then
  66. # Install dependencies for documentation
  67. apt-get install -qq -y pandoc
  68. pip install -e ".[doc,numpy]"
  69. # Generate documentation
  70. cd doc
  71. make html
  72. touch build/html/.nojekyll
  73. rm -r build/html/_sources
  74. fi
  75. }
  76. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  77. # ignored).
  78. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  79. case "$CONFIG" in
  80. Debug*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
  81. Release*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
  82. *) echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 ;;
  83. esac
  84. run