diff --git a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst index 286e2e08ddf1f811001c12d62ce833c1107685f7..b358aebd1a266f6591ad9d6c4915d40049fea9f3 100644 --- a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst +++ b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst @@ -27,7 +27,7 @@ process: +===================================================================+=======================+============================+==========================+ | `Boost <http://www.boost.org>`_ | Yes | 1.73.0 | 1.86.0 | +-------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ - | `Expat <https://sourceforge.net/projects/expat/>`_ | Yes | | 2.5.0 | + | `Expat <https://sourceforge.net/projects/expat/>`_ | Yes | | 2.6.3 | +-------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ | `Geos <https://libgeos.org/>`_ | Yes | | 3.12.1 | +-------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ diff --git a/Packaging/Files/post_install.sh.in b/Packaging/Files/post_install.sh.in index c84d73f34044cf97ba55f6592bb1236da28ecdb3..df4affb99a204806b0ab03b7d48ef743c5c39ada 100644 --- a/Packaging/Files/post_install.sh.in +++ b/Packaging/Files/post_install.sh.in @@ -25,8 +25,6 @@ OTB_SHORT_VERSION=@OTB_VERSION_MAJOR@.@OTB_VERSION_MINOR@ echo "***** First time launching OTB after installation, doing some post installation steps before use *****" # Apply necessary patches for a modular install because cmake generates these file at configure time, not at packaging time CMAKE_DIRS="$OTB_INSTALL_DIR/lib/cmake" -sed -i "s/FATAL_ERROR/WARNING/g" "$CMAKE_DIRS/OTB-$OTB_SHORT_VERSION/OTBTargets.cmake" -sed -i "s/FATAL_ERROR/WARNING/g" "$CMAKE_DIRS/OTB-$OTB_SHORT_VERSION/OTBModuleAPI.cmake" sed -i "s/\/builds\/otb\/xdk/\${OTB_INSTALL_PREFIX}/g" "$CMAKE_DIRS"/OTB-"$OTB_SHORT_VERSION"/*.cmake sed -i "s/\/builds\/otb\/xdk/\${OTB_INSTALL_PREFIX}/g" "$CMAKE_DIRS"/OTB-"$OTB_SHORT_VERSION"/Modules/*.cmake sed -i "s/\/builds\/otb\/xdk/\${OTB_INSTALL_PREFIX}/g" "$CMAKE_DIRS"/ITK-5.3/*.cmake @@ -35,20 +33,25 @@ sed -i "s/\/builds\/otb\/xdk/\$OTB_INSTALL_DIR/g" "$OTB_INSTALL_DIR"/bin/gdal-co sed -i "s/\/builds\/otb\/xdk/\$OTB_INSTALL_DIR/g" "$OTB_INSTALL_DIR"/bin/curl-config sh "$OTB_INSTALL_DIR"/tools/sanitize_rpath.sh -# Check python version, if python 3.12 (ubuntu 24 and debian > 12) download and extract the gdal bindings for python 3.12 pyversion="$(python3 -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]*\).*/\1\2/')" -if [ "$pyversion" = "312" ]; then +# Recompile OTB Python bindings +if [ "$pyversion" -ne "310" ]; then + sh "$OTB_INSTALL_DIR"/recompile_bindings.sh +fi +# Check python version, if python 3.12 (ubuntu 24 and debian > 12) download and extract the gdal bindings for python 3.12 +# In case your install is from compiled code, the gdal bindings will be already there in the installation +gdal_python_found="$(find "$OTB_INSTALL_DIR"/lib/python3/dist-packages/osgeo/ -name "*$pyversion-x86_64-linux*")" +if [ "$pyversion" = "312" ] && [ -z $gdal_python_found ]; then echo "***** Python 3.12 detected, downloading gdal bindings compiled for python 3.12 *****" HTTP_STATUS=$(curl -s -o "$OTB_INSTALL_DIR"/tools/py312.tar.gz -w "%{response_code}\n" https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-$OTB_SHORT_VERSION-GDAL-bindings-py$pyversion.tar.gz) if [ $HTTP_STATUS -eq 200 ]; then tar -xf "$OTB_INSTALL_DIR"/tools/gdal-py312.tar.gz -C "$OTB_INSTALL_DIR"/lib/python3/dist-packages/osgeo/ rm "$OTB_INSTALL_DIR"/tools/gdal-py312.tar.gz - echo "*** GDAL bindings for python 3.12 successfully installed ***" + echo "***** GDAL bindings for python 3.12 successfully installed *****" else echo "Can not find GDAL bindings at https://www.orfeo-toolbox.org/packages/archives/OTB/OTB-$OTB_SHORT_VERSION-GDAL-bindings-py$pyversion.tar.gz" return -1 fi - sh "$OTB_INSTALL_DIR"/recompile_bindings.sh - echo "***** OTB Environment and Python bindings setup complete *****" fi -echo "OK" > "$OTB_INSTALL_DIR"/tools/install_done.txt +echo "***** OTB Environment and Python bindings setup complete *****" +echo "OK" > "$OTB_INSTALL_DIR"/tools/install_done.txt \ No newline at end of file diff --git a/SuperBuild/CMake/External_expat.cmake b/SuperBuild/CMake/External_expat.cmake index 0ebd60126593581dfaa8780a3767229fd181c858..e0f86c934f9b980a8c94c018438c8d08e79dfd26 100644 --- a/SuperBuild/CMake/External_expat.cmake +++ b/SuperBuild/CMake/External_expat.cmake @@ -24,8 +24,8 @@ SETUP_SUPERBUILD(EXPAT) ExternalProject_Add(EXPAT PREFIX EXPAT - URL "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz" - URL_MD5 686e9d986f85966c7924dfc041cdc15e + URL "https://github.com/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.gz" + URL_MD5 8b0344e35dc7d40a42b80317076ee8c2 BINARY_DIR ${EXPAT_SB_BUILD_DIR} INSTALL_DIR ${SB_INSTALL_PREFIX} DOWNLOAD_DIR ${DOWNLOAD_LOCATION}