build_mamba.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. if [[ $PKG_NAME == "mamba" ]]; then
  3. cd mamba || exit 1
  4. $PYTHON -m pip install . --no-deps -vv
  5. echo "Adding link to mamba into condabin";
  6. mkdir -p $PREFIX/condabin
  7. ln -s $PREFIX/bin/mamba $PREFIX/condabin/mamba
  8. exit 0
  9. fi
  10. rm -rf build
  11. mkdir build
  12. cd build || exit 1
  13. export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY=1"
  14. # Generate the build files.
  15. echo "Generating the build files..."
  16. if [[ $PKG_NAME == "libmamba" ]]; then
  17. cmake .. ${CMAKE_ARGS} \
  18. -GNinja \
  19. -DCMAKE_INSTALL_PREFIX=$PREFIX \
  20. -DCMAKE_PREFIX_PATH=$PREFIX \
  21. -DCMAKE_BUILD_TYPE=Release \
  22. -DBUILD_LIBMAMBA=ON \
  23. -DBUILD_SHARED=ON \
  24. -DBUILD_MAMBA_PACKAGE=ON
  25. elif [[ $PKG_NAME == "libmambapy" ]]; then
  26. # TODO finds wrong python interpreter!!!!
  27. cmake .. ${CMAKE_ARGS} \
  28. -GNinja \
  29. -DCMAKE_PREFIX_PATH=$PREFIX \
  30. -DCMAKE_INSTALL_PREFIX=$PREFIX \
  31. -DCMAKE_BUILD_TYPE=Release \
  32. -DPython_EXECUTABLE=$PYTHON \
  33. -DBUILD_LIBMAMBAPY=ON
  34. fi
  35. # Build.
  36. echo "Building..."
  37. ninja || exit 1
  38. # Installing
  39. echo "Installing..."
  40. ninja install || exit 1
  41. if [[ $PKG_NAME == "libmambapy" ]]; then
  42. cd ../libmambapy || exit 1
  43. rm -rf build
  44. $PYTHON -m pip install . --no-deps -vv
  45. find libmambapy/bindings* -type f -print0 | xargs -0 rm -f --
  46. fi
  47. # Error free exit!
  48. echo "Error free exit!"
  49. exit 0