Commit ae30300f authored by Antoine Regimbeau's avatar Antoine Regimbeau

Merge branch 'develop' into ci_large_input

parents 0cce450f 1b9a6b9d
Pipeline #1866 failed
......@@ -30,42 +30,42 @@ stages:
- runner_system_failure
- stuck_or_timeout_failure
fast-build:
.common:
extends: .general
before_script:
- git lfs install --skip-repo
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
# Checkout the expected branch
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 CI/cdash_handler.py
artifacts:
when: on_failure
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
fast-build:
extends: .common
only: [merge_requests, branches]
stage: precheck
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
before_script:
- git checkout -f -q $CI_COMMIT_SHA
- python3 CI/check_twin_pipelines.py
after_script:
- python3 CI/cdash_handler.py
script:
- ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
- ccache -s
.common-build:
extends: .general
extends: .common
only:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
stage: build
before_script:
- git lfs install --skip-repo
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
# Checkout the expected branch
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 CI/cdash_handler.py
artifacts:
when: on_failure
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
debian-build:
extends: .common-build
......
......@@ -25,7 +25,12 @@ get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set (ENV{LANG} "C") # Only ascii output
# Build Configuration : Release, Debug..
set (CTEST_BUILD_CONFIGURATION "Release")
if(ci_build_type)
set (CTEST_BUILD_CONFIGURATION ${ci_build_type})
else()
set (CTEST_BUILD_CONFIGURATION "Release")
endif()
set (CTEST_CMAKE_GENERATOR "Ninja")
# detect short sha
......@@ -118,7 +123,12 @@ endif()
# ------------------------------ Build -----------------------------------------
if(ci_skip_install)
message(STATUS "Skip install")
set(CTEST_BUILD_TARGET)
if (ci_build_target)
message(STATUS "Building target: ${ci_build_target}")
set(CTEST_BUILD_TARGET ${ci_build_target})
else()
set(CTEST_BUILD_TARGET)
endif()
else()
set(CTEST_BUILD_TARGET install)
endif()
......@@ -159,7 +169,11 @@ if ( NOT _test_rv EQUAL 0 )
endif()
# ----------------------------- Submit -----------------------------------------
ctest_submit()
if(ci_skip_submit)
message(STATUS "Skip submit")
else()
ctest_submit()
endif()
# ---------------------------- Doxygen -----------------------------------------
if(ENABLE_DOXYGEN)
......
......@@ -196,6 +196,12 @@ of all our dependencies on `the Orfeo ToolBox website
<https://www.orfeo-toolbox.org/packages>`_ (pick the ’SuperBuild-archives’
corresponding to the OTB version you want to build).
**Notes about GDAL:** Since OTB 7.0, SuperBuild's GDAL version is 2.4.1. This version needs pkg-config to correctly find OpenJPEG (needed to read and write images with formats such as .jp2, .j2k), the minimal version is 0.21 for GDAL 2.4.1. You can install it with:
::
apt-get install pkg-config
**Notes about Qt:** Unlike other dependencies, building Qt5 on all platforms is
not a trivial task but OTB SuperBuild does its best to facilitate this for the
user. So there is still some additional package installation, one has to do as a
......
......@@ -49,7 +49,10 @@ GDALDriverManagerWrapper::GDALDriverManagerWrapper()
GDALDriverManagerWrapper::~GDALDriverManagerWrapper()
{
GDALDestroyDriverManager();
// GDALDestroyDriverManager();
// Since gdal 2.4 we need to explicitely call GDALDestroy
// GDALDestroyDriverManager is called inside
GDALDestroy(); // gdaldllmain.cpp line 74
}
// Open the file for reading and returns a smart dataset pointer
......
......@@ -51,13 +51,51 @@ macro(error_message m)
message(FATAL_ERROR "${m}")
endmacro(error_message)
#------------------- C version ---------------------
macro(gdal_try_run_c msg_type var source_file)
message(STATUS "Performing Test ${var}")
set(${var})
try_run(RUN_${var} COMPILE_${var} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/${source_file}
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
COMPILE_DEFINITIONS "-w"
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_${var}
RUN_OUTPUT_VARIABLE RUN_OUTPUT_${var}
ARGS ${ARGN}
)
if(NOT COMPILE_${var})
error_message("Compiling Test ${var} - Failed \n
COMPILE_OUTPUT_${var}: '${COMPILE_OUTPUT_${var}}'")
endif()
if(RUN_${var})
set(${var} FALSE)
#if msg_type is STATUS (ie "okay" if test is failing),
#then we don't need to give an run-output and exit status.
if("${msg_type}" STREQUAL "STATUS")
message(${msg_type} "Performing Test ${var} - Failed")
else()
error_message("Performing Test ${var} - Failed \n
Exit status: '${RUN_${var}}' \n
RUN_OUTPUT_${var}: '${RUN_OUTPUT_${var}}'")
endif()
else()
set(${var} TRUE)
message(STATUS "Performing Test ${var} - Success")
endif()
unset(RUN_OUTPUT_${var})
unset(COMPILE_OUTPUT_${var})
unset(COMPILE_${var})
endmacro()
#------------------- Helper Macro ---------------------
macro(gdal_try_run msg_type var source_file)
message(STATUS "Performing Test ${var}")
set(${var})
try_run(RUN_${var} COMPILE_${var} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/${source_file}
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-w" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
COMPILE_DEFINITIONS "-std=c++14" "-w"
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_${var}
RUN_OUTPUT_VARIABLE RUN_OUTPUT_${var}
ARGS ${ARGN}
......@@ -104,7 +142,8 @@ endif()
#gdal_try_run(FATAL_ERROR GDAL_HAS_OGR gdalOGRTest.cxx)
try_compile(COMPILE_GDAL_HAS_OGR ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalOGRTest.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-w" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
COMPILE_DEFINITIONS "-std=c++14" "-w"
OUTPUT_VARIABLE COMPILE_OUTPUT_GDAL_HAS_OGR
)
if(NOT COMPILE_GDAL_HAS_OGR)
......@@ -116,11 +155,11 @@ endif()
# check formats TIFF, GeoTIFF, JPEG, JPEG2000, HDF5
# Note : exact format names can be found here http://www.gdal.org/formats_list.html
gdal_try_run(STATUS GDAL_FORMATS_LIST gdalFormatsListTest.c ${TEMP}/gdalFormatsList.csv)
gdal_try_run_c(STATUS GDAL_FORMATS_LIST gdalFormatsListTest.c ${TEMP}/gdalFormatsList.csv)
gdal_try_run(FATAL_ERROR GDAL_HAS_JPEG gdalFormatsTest.c JPEG)
gdal_try_run_c(FATAL_ERROR GDAL_HAS_JPEG gdalFormatsTest.c JPEG)
gdal_try_run(FATAL_ERROR GDAL_HAS_GTiff gdalFormatsTest.c GTiff)
gdal_try_run_c(FATAL_ERROR GDAL_HAS_GTiff gdalFormatsTest.c GTiff)
gdal_try_run(FATAL_ERROR GDAL_CAN_CREATE_GTiff gdalCreateTest.cxx GTiff ${TEMP}/testImage.gtif )
......@@ -129,39 +168,39 @@ gdal_try_run(FATAL_ERROR GDAL_CAN_CREATE_GTiff_BIGTIFF gdalCreateCopyTest.cxx ${
gdal_try_run(FATAL_ERROR GDAL_CAN_CREATE_JPEG gdalCreateCopyTest.cxx ${TEMP}/testImage.gtif ${TEMP}/testImage.jpeg JPEG)
set(JPEG2000_DRIVER_USED)
gdal_try_run(STATUS GDAL_HAS_JP2OpenJPEG gdalFormatsTest.c JP2OpenJPEG)
gdal_try_run_c(STATUS GDAL_HAS_JP2OpenJPEG gdalFormatsTest.c JP2OpenJPEG)
if (GDAL_HAS_JP2OpenJPEG)
set(JPEG2000_DRIVER_USED "OpenJPEG")
gdal_try_run(STATUS GDAL_CAN_CREATE_JP2OpenJPEG gdalCreateCopyTest.cxx ${TEMP}/testImage.gtif ${TEMP}/testImage.j2k JP2OpenJPEG)
endif()
gdal_try_run(STATUS GDAL_HAS_JP2KAK gdalFormatsTest.c JP2KAK)
gdal_try_run_c(STATUS GDAL_HAS_JP2KAK gdalFormatsTest.c JP2KAK)
if (GDAL_HAS_JP2KAK)
set(JPEG2000_DRIVER_USED "Kakadu")
gdal_try_run(STATUS GDAL_CAN_CREATE_JP2KAK gdalCreateCopyTest.cxx ${TEMP}/testImage.gtif ${TEMP}/testImage.j2k JP2KAK)
endif()
gdal_try_run(STATUS GDAL_HAS_JP2ECW gdalFormatsTest.c JP2ECW)
gdal_try_run_c(STATUS GDAL_HAS_JP2ECW gdalFormatsTest.c JP2ECW)
if (GDAL_HAS_JP2ECW)
set(JPEG2000_DRIVER_USED "ECW")
gdal_try_run(STATUS GDAL_CAN_CREATE_JP2ECW gdalCreateCopyTest.cxx ${TEMP}/testImage.gtif ${TEMP}/testImage.j2k JP2ECW)
endif()
gdal_try_run(STATUS GDAL_HAS_JPEG2000 gdalFormatsTest.c JPEG2000)
gdal_try_run_c(STATUS GDAL_HAS_JPEG2000 gdalFormatsTest.c JPEG2000)
if (GDAL_HAS_JPEG2000)
set(JPEG2000_DRIVER_USED "JPEG2000")
gdal_try_run(STATUS GDAL_CAN_CREATE_JPEG2000 gdalCreateCopyTest.cxx ${TEMP}/testImage.gtif ${TEMP}/testImage.j2k JPEG2000)
endif()
gdal_try_run(STATUS GDAL_HAS_HDF5 gdalFormatsTest.c HDF5)
gdal_try_run(STATUS GDAL_HAS_HDF4 gdalFormatsTest.c HDF4)
gdal_try_run_c(STATUS GDAL_HAS_HDF5 gdalFormatsTest.c HDF5)
gdal_try_run_c(STATUS GDAL_HAS_HDF4 gdalFormatsTest.c HDF4)
#check some vector formats
#TODO: fix gdalFormatsTest.c to work with gdal 1.x and 2.x
# gdal_try_run(FATAL_ERROR GDAL_HAS_SQLite gdalFormatsTest.c SQLite)
# gdal_try_run(FATAL_ERROR GDAL_HAS_VRT gdalFormatsTest.c VRT)
# gdal_try_run(FATAL_ERROR GDAL_HAS_KML gdalFormatsTest.c KML)
# gdal_try_run(STATUS GDAL_HAS_LIBKML gdalFormatsTest.c LIBKML)
# gdal_try_run_c(FATAL_ERROR GDAL_HAS_SQLite gdalFormatsTest.c SQLite)
# gdal_try_run_c(FATAL_ERROR GDAL_HAS_VRT gdalFormatsTest.c VRT)
# gdal_try_run_c(FATAL_ERROR GDAL_HAS_KML gdalFormatsTest.c KML)
# gdal_try_run_c(STATUS GDAL_HAS_LIBKML gdalFormatsTest.c LIBKML)
#------------------- TESTS (END)---------------------
......
......@@ -29,7 +29,9 @@ ADD_SUPERBUILD_CONFIGURE_VAR(GDAL TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL GEOTIFF_ROOT --with-geotiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL PNG_ROOT --with-png)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL JPEG_ROOT --with-jpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL OPENJPEG_ROOT --with-openjpeg)
# This is not needed as from GDAL 2.4 it uses pkg-config to find openjpeg.
# It is found thanks to the $PKG_CONFIG_PATH in SB_ENV_CONFIGURE_CMD
# ADD_SUPERBUILD_CONFIGURE_VAR(GDAL OPENJPEG_ROOT --with-openjpeg)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL SQLITE_ROOT --with-sqlite3)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL ZLIB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL EXPAT_ROOT --with-expat)
......@@ -88,11 +90,11 @@ if(UNIX)
--with-odbc=no
--with-ogdi=no
--with-pam
--with-openjpeg
--with-pcidsk=yes
--with-pcraster=no
--with-pcre=no
--with-perl=no
--with-php=no
--with-python=no
--with-qhull=internal
--with-sde=no
......@@ -145,8 +147,8 @@ endif()
ExternalProject_Add(GDAL
PREFIX GDAL
URL "http://download.osgeo.org/gdal/2.2.1/gdal-2.2.1.tar.gz"
URL_MD5 785acf2b0cbf9d56d37c9044d0ee2505
URL "http://download.osgeo.org/gdal/2.4.1/gdal-2.4.1.tar.gz"
URL_MD5 8bc93c7ae4d3a46916918a52c7f5f10f
SOURCE_DIR ${GDAL_SB_SRC}
BINARY_DIR ${GDAL_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
......
......@@ -130,7 +130,7 @@ configure_file( ${QT5_CONFIGURE_COMMAND_IN} ${QT5_CONFIGURE_COMMAND} @ONLY )
ExternalProject_Add(QT5
PREFIX QT5
URL "http://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
URL "https://download.qt.io/archive/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
URL_MD5 7e167b9617e7bd64012daaacb85477af
BINARY_DIR ${QT5_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
......
......@@ -258,6 +258,9 @@ if(CMAKE_MODULE_LINKER_FLAGS)
list(APPEND SB_ENV_CONFIGURE_CMD "LDFLAGS=${CMAKE_MODULE_LINKER_FLAGS}")
endif()
# This is needed for gdal 2.4 in order to find OpenJPEG
list(APPEND SB_ENV_CONFIGURE_CMD "PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
list(REMOVE_DUPLICATES SB_ENV_CONFIGURE_CMD)
message(STATUS "Environment setup for CMake (SB_CMAKE_COMMAND) : ${SB_CMAKE_COMMAND}")
......
diff -burN gdal-2.1.0.orig/nmake.opt gdal-2.1.0/nmake.opt
--- gdal-2.1.0.orig/nmake.opt 2016-06-14 11:39:22.911630802 +0200
+++ gdal-2.1.0/nmake.opt 2016-06-14 11:39:39.827630670 +0200
@@ -247,7 +247,7 @@
JPEG_SUPPORTED = 1
diff -burN gdal-2.4.1_orig/nmake.opt gdal-2.4.1/nmake.opt
--- gdal-2.4.1_orig/nmake.opt 2019-03-15 13:30:03.000000000 +0100
+++ gdal-2.4.1/nmake.opt 2019-04-02 10:57:50.712191315 +0200
@@ -276,9 +276,9 @@
!ENDIF
# This will enable 12bit libjpeg - use only with internal jpeg builds.
-!IFNDEF JPEG12_SUPPORTED
-JPEG12_SUPPORTED = 1
-!ENDIF
+#!IFNDEF JPEG12_SUPPORTED
+#JPEG12_SUPPORTED = 1
+#!ENDIF
#if using an external jpeg library uncomment the following lines
#JPEG_EXTERNAL_LIB = 1
diff -burN gdal-2.2.1-orig/frmts/raw/envidataset.cpp gdal-2.2.1/frmts/raw/envidataset.cpp
--- gdal-2.2.1-orig/frmts/raw/envidataset.cpp 2017-06-23 14:18:43.000000000 +0200
+++ gdal-2.2.1/frmts/raw/envidataset.cpp 2017-07-20 18:25:05.373655046 +0200
@@ -620,10 +620,13 @@
diff -burN gdal-2.4.1_orig/frmts/raw/envidataset.cpp gdal-2.4.1/frmts/raw/envidataset.cpp
--- gdal-2.4.1_orig/frmts/raw/envidataset.cpp 2019-03-29 14:48:15.444066736 +0100
+++ gdal-2.4.1/frmts/raw/envidataset.cpp 2019-03-29 14:48:49.556067582 +0100
@@ -618,10 +618,13 @@
adfGeoTransform[4] != 0.0 || adfGeoTransform[5] != 1.0;
if( bHasNonDefaultGT )
{
......@@ -17,16 +17,16 @@ diff -burN gdal-2.2.1-orig/frmts/raw/envidataset.cpp gdal-2.2.1/frmts/raw/envida
const double dfRotation = (dfRotation1 + dfRotation2) / 2.0;
if( fabs(dfRotation1 - dfRotation2) > 1e-5 )
@@ -1534,7 +1537,12 @@
@@ -1530,7 +1533,12 @@
// Fallback to localcs if we don't recognise things.
if( oSRS.GetRoot() == NULL )
+ {
if( oSRS.GetRoot() == nullptr )
+ {
oSRS.SetLocalCS(papszFields[0]);
+ // assume that the Y axis isn't flipped
+ adfGeoTransform[2] *= -1.0;
+ adfGeoTransform[5] *= -1.0;
+ }
+ // assume that the Y axis isn't flipped
+ adfGeoTransform[2] *= -1.0;
+ adfGeoTransform[5] *= -1.0;
+ }
// Try to set datum from projection info line if we have a
// projected coordinate system without a GEOGCS.
--- GDAL-orig/frmts/hdf5/makefile.vc 2017-08-30 18:45:33.632677939 +0200
+++ GDAL/frmts/hdf5/makefile.vc 2017-08-30 18:46:05.316972947 +0200
--- gdal-2.4.1_orig/frmts/hdf5/makefile.vc 2019-03-15 13:30:02.000000000 +0100
+++ gdal-2.4.1/frmts/hdf5/makefile.vc 2019-04-05 17:43:22.356322797 +0200
@@ -7,7 +7,7 @@
PLUGIN_DLL = gdal_HDF5.dll
-EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -D_HDF5USEDLL_
+EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -DH5_BUILT_AS_DYNAMIC_LIB
!IF "$(HDF5_PLUGIN)" == "YES"
EXTRAFLAGS = $(EXTRAFLAGS) -DHDF5_PLUGIN
PLUGIN_DLL = gdal_HDF5.dll
-EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -D_HDF5USEDLL_
+EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -DH5_BUILT_AS_DYNAMIC_LIB
!IF "$(HDF5_PLUGIN)" == "YES"
EXTRAFLAGS = $(EXTRAFLAGS) -DHDF5_PLUGIN
Index: gdal/configure
===================================================================
--- gdal/configure (revision 39820)
+++ gdal/configure (revision 39821)
@@ -25116,10 +25116,10 @@
elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then
- for ac_header in openjpeg-2.0/openjpeg.h
+ for ac_header in openjpeg-2.2/openjpeg.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
-if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.2/openjpeg.h" "ac_cv_header_openjpeg_2_2_openjpeg_h" "$ac_includes_default"
+if test "x$ac_cv_header_openjpeg_2_2_openjpeg_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
+#define HAVE_OPENJPEG_2_2_OPENJPEG_H 1
_ACEOF
@@ -25128,5 +25128,5 @@
done
- if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_stream_set_user_data_length in -lopenjp2" >&5
$as_echo_n "checking for opj_stream_set_user_data_length in -lopenjp2... " >&6; }
@@ -25172,4 +25172,5 @@
if test "$HAVE_OPENJPEG" = "yes"; then
+ OPENJPEG_VERSION=20200
LIBS="-lopenjp2 $LIBS"
fi
@@ -25234,4 +25235,64 @@
LIBS="-lopenjp2 $LIBS"
fi
+ else
+ for ac_header in openjpeg-2.0/openjpeg.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
+if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_stream_set_user_data_length in -lopenjp2" >&5
+$as_echo_n "checking for opj_stream_set_user_data_length in -lopenjp2... " >&6; }
+if ${ac_cv_lib_openjp2_opj_stream_set_user_data_length+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lopenjp2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opj_stream_set_user_data_length ();
+int
+main ()
+{
+return opj_stream_set_user_data_length ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_openjp2_opj_stream_set_user_data_length=yes
+else
+ ac_cv_lib_openjp2_opj_stream_set_user_data_length=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openjp2_opj_stream_set_user_data_length" >&5
+$as_echo "$ac_cv_lib_openjp2_opj_stream_set_user_data_length" >&6; }
+if test "x$ac_cv_lib_openjp2_opj_stream_set_user_data_length" = xyes; then :
+ HAVE_OPENJPEG=yes
+else
+ HAVE_OPENJPEG=no
+fi
+
+ if test "$HAVE_OPENJPEG" = "yes"; then
+ LIBS="-lopenjp2 $LIBS"
+ fi
+ fi
fi
fi
@@ -25244,6 +25305,9 @@
OPENJPEG_VERSION=20100
EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
+ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then
+ OPENJPEG_VERSION=20200
+ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
else
- as_fn_error $? "openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1" "$LINENO" 5
+ as_fn_error $? "openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2" "$LINENO" 5
fi
Index: gdal/configure.ac
===================================================================
--- gdal/configure.ac (revision 39820)
+++ gdal/configure.ac (revision 39821)
@@ -2540,8 +2540,9 @@
elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then
- AC_CHECK_HEADERS([openjpeg-2.0/openjpeg.h])
- if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ AC_CHECK_HEADERS([openjpeg-2.2/openjpeg.h])
+ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then
AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
if test "$HAVE_OPENJPEG" = "yes"; then
+ OPENJPEG_VERSION=20200
LIBS="-lopenjp2 $LIBS"
fi
@@ -2554,4 +2555,12 @@
LIBS="-lopenjp2 $LIBS"
fi
+ else
+ AC_CHECK_HEADERS([openjpeg-2.0/openjpeg.h])
+ if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
+ if test "$HAVE_OPENJPEG" = "yes"; then
+ LIBS="-lopenjp2 $LIBS"
+ fi
+ fi
fi
fi
@@ -2564,6 +2573,9 @@
OPENJPEG_VERSION=20100
EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
- else
- AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1])
+ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then
+ OPENJPEG_VERSION=20200
+ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
+ else
+ AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2])
fi
Index: gdal/frmts/openjpeg/openjpegdataset.cpp
===================================================================
--- gdal/frmts/openjpeg/openjpegdataset.cpp (revision 39820)
+++ gdal/frmts/openjpeg/openjpegdataset.cpp (revision 39821)
@@ -35,5 +35,7 @@
#endif
-#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100
+#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20200
+#include <openjpeg-2.2/openjpeg.h>
+#elif defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100
#include <openjpeg-2.1/openjpeg.h>
#else
Index: gdal/nmake.opt
===================================================================
--- gdal/nmake.opt (revision 39820)
+++ gdal/nmake.opt (revision 39821)
@@ -608,6 +608,8 @@
#OPENJPEG_CFLAGS = -IC:\openjpeg\include
#OPENJPEG_LIB = C:\openjpeg\lib\openjp2.lib
-# For OpenJpeg >= 2.1, uncomment
+# For OpenJpeg 2.1.x, uncomment
#OPENJPEG_VERSION = 20100
+# For OpenJpeg 2.2.x, uncomment
+#OPENJPEG_VERSION = 20200
#if using an external zlib uncomment the following lines
--- gdal-2.2.1-orig/swig/python/GNUmakefile 2017-06-23 14:18:44.000000000 +0200
+++ gdal-2.2.1/swig/python/GNUmakefile 2018-03-13 17:20:34.951592209 +0100
@@ -81,18 +81,7 @@
endif
ifdef prefix
- ifeq ($(shell uname),Darwin)
- STD_UNIX_LAYOUT=$(shell $(PYTHON) -c "from __future__ import print_function;import sys;print(\"FALSE\" if \"framework\" in sys.prefix.lower() else \"TRUE\")")
- ifeq ($(STD_UNIX_LAYOUT),"TRUE")
- setup_opts+=--prefix=$(prefix)
- else
- ifdef PYTHON_INSTALL_LIB
- setup_opts+=--install-lib=$(PYTHON_INSTALL_LIB)
- endif
- endif
- else
- setup_opts+=--prefix=$(prefix)
- endif
+ setup_opts+=--install-lib=$(site_package_dir)
endif
ifdef INSTALL_LAYOUT
--- gdal-2.2.1-orig/makefile.vc 2017-06-23 14:18:38.000000000 +0200
+++ gdal-2.2.1/makefile.vc 2018-03-14 19:05:43.372712378 +0100
@@ -49,6 +49,12 @@
DISTDIR = gdal_$(VERSION)
+WRAP_TARGETS =
+
+!IFDEF WRAP_PYTHON
+WRAP_TARGETS = $(WRAP_TARGETS) swig_py
+!ENDIF
+
!IFDEF DLLBUILD
TARGET_LIB = dll
PLUGIN_TARGET = plugin_dir
@@ -58,7 +64,7 @@
DEFAULT_TARGETS =
-default: $(TARGET_LIB) $(PLUGIN_TARGET) apps_dir
+default: $(TARGET_LIB) $(PLUGIN_TARGET) apps_dir $(WRAP_TARGETS)
staticlib: $(LIB_DEPENDS)
if exist gdal.lib del gdal.lib
@@ -166,6 +172,11 @@
dll: $(GDAL_DLL)
+swig_py: $(TARGET_LIB)
+ cd swig
+ $(MAKE) /f makefile.vc python
+ cd ..
+
install: default
-mkdir $(BINDIR)
-mkdir $(DATADIR)
@@ -191,6 +202,11 @@
!ENDIF
cd ..\..
!ENDIF
+!IFDEF WRAP_PYTHON
+ cd swig
+ $(MAKE) /f makefile.vc python-install
+ cd ..
+!ENDIF
libinstall: $(GDALLIB)
-mkdir $(LIBDIR)
--- gdal-2.2.1-orig/swig/makefile.vc 2017-06-23 14:18:45.000000000 +0200
+++ gdal-2.2.1/swig/makefile.vc 2018-03-14 19:04:05.851776139 +0100
@@ -22,6 +22,11 @@
$(SWIG) -c++ -python -modern -new_repr -I../include/python -I../include/python/docs -o extensions/gdal_array_wrap.cpp -outdir osgeo ..\include\gdal_array.i
$(PYDIR)\python.exe setup.py build
+python-install: python
+ cd python
+ $(PYDIR)\python.exe setup.py install --prefix=$(GDAL_HOME)
+ # TODO: install python scripts
+
#d:\Python\debug\Python-2.4\PCbuild\python_d.exe setup.py build --debug
csharp: gdalvars
diff -burN gdal-1.11.2.orig/configure gdal-1.11.2/configure
--- gdal-1.11.2.orig/configure 2016-04-19 12:27:26.000000000 +0200
+++ gdal-1.11.2/configure 2016-04-19 13:05:25.000000000 +0200
@@ -12510,9 +12510,9 @@
diff -burN gdal-2.4.1_orig/configure gdal-2.4.1/configure
--- gdal-2.4.1_orig/configure 2019-03-15 13:30:02.000000000 +0100
+++ gdal-2.4.1/configure 2019-04-02 14:32:16.488024213 +0200
@@ -14125,9 +14125,9 @@
esac
if test "$_lt_dar_can_shared" = "yes"; then
if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
@@ -15457,13 +15457,13 @@
@@ -17247,13 +17247,13 @@
esac
if test "$_lt_dar_can_shared" = "yes"; then
if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
if test yes != "$lt_cv_apple_cc_single_mod"; then
- archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring$_lt_dsymutil"
+ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
else
--- gdal-2.4.1_orig/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp
+++ gdal-2.4.1/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp
@@ -83,7 +83,7 @@ int OGRwillNeverBeTrue = FALSE;
void OGRCleanupAll()
{
- GDALDestroyDriverManager();
+ GDALDestroy();
#if defined(WIN32) && defined(_MSC_VER)
// Horrible hack: for some reason MSVC doesn't export those classes&symbols
// if they are not referenced from the DLL itself
......@@ -60,10 +60,9 @@ GEOS_CFLAGS = -I$(GEOS_DIR)\include -I$(GEOS_DIR)\include\geos -DHAVE_GEOS
GEOS_LIB = $(GEOS_DIR)\lib\geos.lib $(GEOS_DIR)\lib\geos_c.lib