diff --git a/CMake/External_VXL.cmake b/CMake/External_VXL.cmake index f69a7c6b..9ebb760f 100644 --- a/CMake/External_VXL.cmake +++ b/CMake/External_VXL.cmake @@ -47,22 +47,32 @@ add_package_dependency( ) set(VXL_ARGS_CONTRIB - -DBUILD_CONTRIB:BOOL=ON - -DBUILD_RPL:BOOL=ON - -DBUILD_BRL:BOOL=OFF - -DBUILD_MUL_TOOLS:BOOL=OFF - -DBUILD_PRIP:BOOL=OFF + -DVXL_BUILD_CONVERSIONS:BOOL=OFF + -DVXL_BUILD_CONTRIB:BOOL=ON + -DVXL_BUILD_BRL:BOOL=OFF + -DVXL_BUILD_CUL:BOOL=OFF + -DVXL_BUILD_GEL:BOOL=OFF + -DVXL_BUILD_MUL_TOOLS:BOOL=OFF + -DVXL_BUILD_MUL:BOOL=OFF + -DVXL_BUILD_OUL:BOOL=OFF + -DVXL_BUILD_OXL:BOOL=OFF + -DVXL_BUILD_PRIP:BOOL=OFF + -DVXL_BUILD_RPL:BOOL=ON + -DVXL_BUILD_TBL:BOOL=OFF ) # Handle FFMPEG disable flag list(APPEND VXL_ARGS_VIDL - -DBUILD_CORE_VIDEO:BOOL=ON + -DVXL_BUILD_CORE_VIDEO:BOOL=ON ) if(fletch_ENABLE_FFmpeg) add_package_dependency( PACKAGE VXL PACKAGE_DEPENDENCY FFmpeg ) + list(APPEND VXL_ARGS_VIDL + -DWITH_FFMPEG:BOOL=ON + ) else() list( APPEND VXL_ARGS_VIDL -DFFMPEG_CONFIG:FILEPATH=IGNORE @@ -94,9 +104,9 @@ endif() set (VXL_patch ${fletch_SOURCE_DIR}/Patches/VXL) if (EXISTS ${VXL_patch}) set(VXL_PATCH_COMMAND ${CMAKE_COMMAND} - -DVXL_PATCH_DIR:PATH=${VXL_patch} - -DVXL_SOURCE_DIR:PATH=${fletch_BUILD_PREFIX}/src/VXL - -P ${VXL_patch}/Patch.cmake + -DVXL_PATCH_DIR:PATH=${VXL_patch} + -DVXL_SOURCE_DIR:PATH=${fletch_BUILD_PREFIX}/src/VXL + -P ${VXL_patch}/Patch.cmake ) endif() @@ -116,24 +126,20 @@ ExternalProject_Add(VXL ${VXL_ARGS_V3P} ${VXL_EXTRA_CMAKE_CXX_FLAGS} ${COMMON_CMAKE_ARGS} - -DBUILD_EXAMPLES:BOOL=OFF + -DVXL_BUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=OFF - -DBUILD_DOCUMENTATION:BOOL=OFF - -DBUILD_FOR_VXL_DASHBOARD:BOOL=ON - -DBUILD_CORE_PROBABILITY:BOOL=ON - -DBUILD_CORE_GEOMETRY:BOOL=ON - -DBUILD_CORE_NUMERICS:BOOL=ON - -DBUILD_CORE_IMAGING:BOOL=ON - -DBUILD_CORE_SERIALISATION:BOOL=ON - -DBUILD_BRL:BOOL=OFF - -DBUILD_GEL:BOOL=OFF - -DBUILD_MUL:BOOL=OFF - -DBUILD_MUL_TOOLS:BOOL=OFF - -DBUILD_TBL:BOOL=OFF + -DVXL_BUILD_DOCUMENTATION:BOOL=OFF + -DVXL_BUILD_CORE_GEOMETRY:BOOL=ON + -DVXL_BUILD_CORE_IMAGING:BOOL=ON + -DVXL_BUILD_CORE_NUMERICS:BOOL=ON + -DVXL_BUILD_CORE_PROBABILITY:BOOL=ON + -DVXL_BUILD_CORE_SERIALISATION:BOOL=ON + -DVXL_BUILD_CORE_UTILITIES:BOOL=ON -DVXL_USE_DCMTK:BOOL=OFF - -DJPEG_LIBRARY:FILEPATH=${JPEG_LIBRARY} + -DVXL_VIL_INCLUDE_IMAGE_IO:BOOL=ON + -DJPEG_LIBRARY_RELEASE:FILEPATH=${JPEG_LIBRARY} -DJPEG_INCLUDE_DIR:PATH=${JPEG_INCLUDE_DIR} - -DGEOTIFF_LIBRARY=${libgeotiff_LIBRARY} + -DGEOTIFF_LIBRARY:FILEPATH=${libgeotiff_LIBRARY} ${VXL_EXTRA_BUILD_FLAGS} ) @@ -148,9 +154,11 @@ ExternalProject_Add_Step(VXL forcebuild fletch_external_project_force_install(PACKAGE VXL) -include_directories( SYSTEM ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl - ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl/vcl - ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl/core ) +include_directories( + SYSTEM ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl + ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl/vcl + ${KWIVER_BUILD_INSTALL_PREFIX}/include/vxl/core + ) set(VXL_ROOT "${fletch_BUILD_INSTALL_PREFIX}" CACHE PATH "" FORCE) set(VXL_DIR "${VXL_ROOT}/share/vxl/cmake" CACHE PATH "" FORCE) diff --git a/CMake/fletch-tarballs.cmake b/CMake/fletch-tarballs.cmake index 5aa6937f..7c20c7ec 100644 --- a/CMake/fletch-tarballs.cmake +++ b/CMake/fletch-tarballs.cmake @@ -459,9 +459,9 @@ set(VTK_url "http://www.vtk.org/files/release/${VTK_SELECT_VERSION}/VTK-${VTK_ve list(APPEND fletch_external_sources VTK) # VXL -set(VXL_version "0bb0ca92867408caec298cef05412ed85c6d56b7") +set(VXL_version "51558266cc28ffb522ae72eebc883a88124a4b6c") set(VXL_url "https://github.com/vxl/vxl/archive/${VXL_version}.zip") -set(VXL_md5 "287536149942081666a2f9a3be87a666") +set(VXL_md5 "400e55c3687666784597376f1ff4a6f0") set(VXL_dlname "vxl-${VXL_version}.zip") list(APPEND fletch_external_sources VXL) diff --git a/Doc/release-notes/master.txt b/Doc/release-notes/master.txt index 6f526d44..86759cf5 100644 --- a/Doc/release-notes/master.txt +++ b/Doc/release-notes/master.txt @@ -12,7 +12,7 @@ Updates since v1.4.1 * Patch VTK 8.2 to fix a compilation issue with gcc 10 in ThridParty/exoduxII * Patch VTK 8.x to fix a compilation issue with gcc 10.2 where the regex fails to detect the gcc version correctly. - + * Update VXL to 51558266cc28ffb522ae72eebc883a88124a4b6c and patch to fix a WIN32 link error. Updates since v1.4.0 -------------------- diff --git a/Patches/VXL/Patch.cmake b/Patches/VXL/Patch.cmake index cc5ba039..d52cbadd 100644 --- a/Patches/VXL/Patch.cmake +++ b/Patches/VXL/Patch.cmake @@ -3,11 +3,17 @@ # External_VXL.cmake for VXL #- +# fixes a Fortify 'detect' regarding a possible buffer overflow file(COPY ${VXL_PATCH_DIR}/core/vbl/vbl_array_2d.h DESTINATION ${VXL_SOURCE_DIR}/core/vbl/ -) + ) # fixes an issue with duplicate definition of lrintf() on Windows -file(COPY ${VXL_PATCH_DIR}/v3p/openjpeg2/opj_includes.h - DESTINATION ${VXL_SOURCE_DIR}/v3p/openjpeg2/ -) +if (WIN32) + file(COPY ${VXL_PATCH_DIR}/core/vnl/io/CMakeLists.txt + DESTINATION ${VXL_SOURCE_DIR}/core/vnl/io/ + ) + file(COPY ${VXL_PATCH_DIR}/core/vsl/Templates/vsl_vector_io+char-.cxx + DESTINATION ${VXL_SOURCE_DIR}/core/vsl/Templates/ + ) +endif() diff --git a/Patches/VXL/core/vbl/vbl_array_2d.h b/Patches/VXL/core/vbl/vbl_array_2d.h index 34f939a4..5519d93f 100644 --- a/Patches/VXL/core/vbl/vbl_array_2d.h +++ b/Patches/VXL/core/vbl/vbl_array_2d.h @@ -1,9 +1,6 @@ // This is core/vbl/vbl_array_2d.h #ifndef vbl_array_2d_h_ #define vbl_array_2d_h_ -#ifdef VCL_NEEDS_PRAGMA_INTERFACE -#pragma interface -#endif //: // \file // \brief Contains class for a templated 2d array @@ -19,8 +16,10 @@ #include #include -#include #include +#ifdef _MSC_VER +# include +#endif //: simple 2D array template @@ -145,7 +144,7 @@ class vbl_array_2d private: void construct() { - rows_ = VXL_NULLPTR; + rows_ = nullptr; num_rows_ = 0; num_cols_ = 0; } @@ -161,7 +160,7 @@ class vbl_array_2d rows_[i] = p + i * n; } else { - rows_ = VXL_NULLPTR; + rows_ = nullptr; } } @@ -173,7 +172,7 @@ class vbl_array_2d } }; -VCL_TEMPLATE_EXPORT template +template std::ostream& operator<<(std::ostream &, vbl_array_2d const &); #define VBL_ARRAY_2D_INSTANTIATE \ diff --git a/Patches/VXL/core/vnl/io/CMakeLists.txt b/Patches/VXL/core/vnl/io/CMakeLists.txt new file mode 100644 index 00000000..8414cdc7 --- /dev/null +++ b/Patches/VXL/core/vnl/io/CMakeLists.txt @@ -0,0 +1,40 @@ +# vxl/vnl/io/CMakeLists.txt + +set(vnl_io_sources + vnl_io_nonlinear_minimizer.cxx vnl_io_nonlinear_minimizer.h +# vnl_io_real_npolynomial.cxx vnl_io_real_npolynomial.h +# vnl_io_real_polynomial.cxx vnl_io_real_polynomial.h + vnl_io_rational.cxx vnl_io_rational.h + vnl_io_bignum.cxx vnl_io_bignum.h + + vnl_io_diag_matrix.hxx vnl_io_diag_matrix.h + vnl_io_matrix.hxx vnl_io_matrix.h + vnl_io_sparse_matrix.hxx vnl_io_sparse_matrix.h + vnl_io_sym_matrix.hxx vnl_io_sym_matrix.h + vnl_io_vector.hxx vnl_io_vector.h + vnl_io_vector_fixed.hxx vnl_io_vector_fixed.h + + vnl_io_matrix_fixed.hxx vnl_io_matrix_fixed.h +) + +aux_source_directory(Templates vnl_io_sources) + +if(CMAKE_COMPILER_IS_GNUCXX) + set_source_files_properties( + Templates/vsl_vector_io+vcl_vector+vcl_vector+vnl_vector+double----.cxx + PROPERTIES + COMPILE_FLAGS -ftemplate-depth-50) +endif() + +vxl_add_library(LIBRARY_NAME ${VXL_LIB_PREFIX}vnl_io + LIBRARY_SOURCES ${vnl_io_sources} + HEADER_INSTALL_DIR vnl/io) +target_link_libraries(${VXL_LIB_PREFIX}vnl_io ${VXL_LIB_PREFIX}vnl ${VXL_LIB_PREFIX}vsl) + +if(BUILD_TESTING) + add_subdirectory(tests) +endif() + +if (VXL_BUILD_OBJECT_LIBRARIES) + add_library(vnl_io-obj OBJECT ${vnl_io_sources}) +endif() diff --git a/Patches/VXL/core/vsl/Templates/vsl_vector_io+char-.cxx b/Patches/VXL/core/vsl/Templates/vsl_vector_io+char-.cxx new file mode 100644 index 00000000..2adea21f --- /dev/null +++ b/Patches/VXL/core/vsl/Templates/vsl_vector_io+char-.cxx @@ -0,0 +1,3 @@ +#include "vsl/vsl_vector_io.hxx" +VSL_VECTOR_IO_INSTANTIATE(char); +VSL_VECTOR_IO_INSTANTIATE(std::vector); diff --git a/Patches/VXL/v3p/openjpeg2/opj_includes.h b/Patches/VXL/v3p/openjpeg2/opj_includes.h deleted file mode 100644 index 1aa949fc..00000000 --- a/Patches/VXL/v3p/openjpeg2/opj_includes.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2005, Herve Drolon, FreeImage Team - * Copyright (c) 2008, Jerome Fimes, Communications & Systemes - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef OPJ_INCLUDES_H -#define OPJ_INCLUDES_H - -/* - ========================================================== - Standard includes used by the library - ========================================================== -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - ========================================================== - OpenJPEG interface - ========================================================== - */ - -/* - ========================================================== - OpenJPEG modules - ========================================================== -*/ - -/* Ignore GCC attributes if this is not GCC */ -#ifndef __GNUC__ - #define __attribute__(x) /* __attribute__(x) */ -#endif - -/* -The inline keyword is supported by C99 but not by C90. -Most compilers implement their own version of this keyword ... -*/ -#ifndef INLINE - #if defined(_MSC_VER) - #define INLINE __inline - #elif defined(__GNUC__) - #define INLINE __inline__ - #else - /* add other compilers here ... */ - #define INLINE - #endif /* defined() */ -#endif /* INLINE */ - -/* Are restricted pointers available? (C99) */ -#if (__STDC_VERSION__ != 199901L) - /* Not a C99 compiler */ - #ifdef __GNUC__ - #define restrict __restrict__ - #else - #define restrict /* restrict */ - #endif -#endif - -/* MSVC does not have lrintf */ -#if defined(_MSC_VER) - -/* MSVC 64bits doesn't support _asm */ -#if !defined(_WIN64) -static INLINE long lrintf(float f){ - int i; - - _asm{ - fld f - fistp i - }; - - return i; -} -#endif - -#endif - -#endif /* OPJ_INCLUDES_H */