compile.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. ### inspired by https://github.com/OSGeo/gdal/blob/master/gdal/scripts/vagrant/gdal.sh
  3. # abort install if any errors occur and enable tracing
  4. set -o errexit
  5. set -o xtrace
  6. NUMTHREADS=2
  7. if [[ -f /sys/devices/system/cpu/online ]]; then
  8. # Calculates 1.5 times physical threads
  9. NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 ))
  10. fi
  11. #NUMTHREADS=1 # disable MP
  12. export NUMTHREADS
  13. cd /vagrant
  14. if [ ! -f "include/Make/Platform.make" ] ; then
  15. ./configure \
  16. --bindir=/usr/bin \
  17. --srcdir=/vagrant \
  18. --prefix=/usr/lib \
  19. --enable-socket \
  20. --enable-shared \
  21. --with-postgres \
  22. --with-mysql \
  23. --with-cxx \
  24. --with-x \
  25. --with-gdal \
  26. --with-geos \
  27. --with-freetype \
  28. --with-motif \
  29. --with-readline \
  30. --with-nls \
  31. --with-odbc \
  32. --with-netcdf \
  33. --with-blas \
  34. --with-lapack \
  35. --with-sqlite \
  36. --enable-largefile \
  37. --with-freetype-includes=/usr/include/freetype2 \
  38. --with-postgres-includes=`pg_config --includedir` \
  39. --with-mysql-includes=`mysql_config --include | sed -e 's/-I//'` \
  40. --with-proj-share=/usr/share/proj \
  41. --with-wxwidgets=/usr/bin/wx-config \
  42. --with-python \
  43. --with-cairo \
  44. --with-liblas
  45. fi
  46. make -j $NUMTHREADS
  47. sudo make install
  48. sudo ldconfig
  49. exit 0