[itk,libsamplerate,libsndfile] Apply some Visual Studio 2019 version 16.9 preview 1 workarounds (#14056)

This commit is contained in:
Billy O'Neal 2020-10-19 19:53:20 -07:00 committed by GitHub
parent e93810d2ef
commit 0d35472758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 153 additions and 78 deletions

View File

@ -1,38 +0,0 @@
Source: itk
Version: 5.1.0
Port-Version: 2
Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.
Homepage: https://github.com/InsightSoftwareConsortium/ITK
Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc
Feature: vtk
Description: Build ITKVtkGlue module.
Build-Depends: vtk[core]
Feature: python
Description: Python functionality for ITK
Build-Depends: python3
Feature: opencl
Description: Use OpenCL
Build-Depends: opencl
Feature: cufftw
Description: Use CUDA FFTW
Build-Depends: cuda
Feature: cuda
Description: Build CUDA module
Build-Depends: cuda, itk[core, opencl]
Feature: tbb
Description: Build TBB Module
Build-Depends: tbb
Feature: rtk
Description: Build RTK Module
Feature: tools
Description: Build RTK with tools
Build-Depends: itk[core, rtk]

View File

@ -8,7 +8,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
hdf5.patch
double-conversion.patch
double-conversion.patch
openjpeg.patch
openjpeg2.patch
var_libraries.patch
@ -16,6 +16,7 @@ vcpkg_from_github(
python_gpu_wrapping.patch
opencl.patch
cufftw.patch
use-the-lrintf-intrinsic.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -27,7 +28,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"tbb" Module_ITKTBB
"rtk" Module_RTK
"tools" RTK_BUILD_APPLICATIONS
# There are a lot of more (remote) modules and options in ITK
# There are a lot of more (remote) modules and options in ITK
# feel free to add those as a feature
)
@ -45,7 +46,7 @@ if("cufftw" IN_LIST FEATURES)
else()
message(FATAL_ERROR "Architecture ${VCPKG_TARGET_ARCHITECTURE} not supported !")
endif()
list(APPEND ADDITIONAL_OPTIONS
"-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}"
"-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
@ -64,7 +65,7 @@ if("rtk" IN_LIST FEATURES)
)
if("cuda" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS "-DRTK_USE_CUDA=ON")
#RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes.
#RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes.
endif()
endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/Modules/Remote/RTK")
@ -76,16 +77,16 @@ if("opencl" IN_LIST FEATURES)
)
endif()
if("tools" IN_LIST FEATURES)
if("rtk" IN_LIST FEATURES)
list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient
rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal
rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart
rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster
rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom
rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient
rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition
rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient
list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient
rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal
rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart
rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster
rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom
rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient
rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition
rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient
rtkwangdisplaceddetectorweighting rtkwarpedbackprojectsequence rtkwarpedforwardprojectsequence rtkwaveletsdenoising rtkxradgeometry)
endif()
endif()
@ -122,8 +123,8 @@ if("python" IN_LIST FEATURES)
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a")
elseif(VCPKG_TARGET_IS_OSX)
#Need Python3 information on OSX within VCPKG
endif()
#ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg
endif()
#ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg
endif()
set(USE_64BITS_IDS OFF)
@ -139,7 +140,7 @@ vcpkg_configure_cmake(
OPTIONS
-DBUILD_TESTING=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_PKGCONFIG_FILES=OFF
-DBUILD_PKGCONFIG_FILES=OFF
-DITK_DOXYGEN_HTML=OFF
-DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON
-DITK_SKIP_PATH_LENGTH_CHECKS=ON
@ -160,7 +161,7 @@ vcpkg_configure_cmake(
-DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past and still is. ITK still has not figured out how to do it correctly!
-DITK_USE_SYSTEM_GDCM=ON
-DITK_USE_SYSTEM_OpenJPEG=ON # Added by VCPKG
-DITK_USE_SYSTEM_DCMTK=ON
-DITK_USE_SYSTEM_DCMTK=ON
-DDCMTK_USE_ICU=ON
-DITK_USE_SYSTEM_ICU=ON
#-DITK_USE_SYSTEM_VXL=ON
@ -171,16 +172,16 @@ vcpkg_configure_cmake(
-DINSTALL_GTEST=OFF
-DITK_USE_SYSTEM_GOOGLETEST=ON
-DEXECUTABLE_OUTPUT_PATH=tools/${PORT}
# TODO
#-DVXL_USE_GEOTIFF=ON
-DVXL_USE_LFS=ON
-DITK_MINIMUM_COMPLIANCE_LEVEL:STRING=1 # To Display all remote modules within cmake-gui
#-DModule_IOSTL=ON # example how to turn on a non-default module
#-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module
#-DModule_RLEImage=ON # example how to turn on a remote module
# Some additional wraping options
#-DITK_WRAP_double=ON
#-DITK_WRAP_complex_double=ON
@ -189,11 +190,11 @@ vcpkg_configure_cmake(
${FEATURE_OPTIONS}
${ADDITIONAL_OPTIONS}
OPTIONS_DEBUG ${OPTIONS_DEBUG}
OPTIONS_RELEASE ${OPTIONS_RELEASE}
)
if(BUILD_RTK) # Remote Modules are only downloaded on configure.
if(BUILD_RTK) # Remote Modules are only downloaded on configure.
# TODO: In the future try to download via vcpkg_from_github and move the files. That way patching does not need this workaround
vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}/Modules/Remote/RTK" QUIET PATCHES rtk/already_defined.patch rtk/unresolved.patch)
endif()

View File

@ -0,0 +1,15 @@
diff --git a/Modules/ThirdParty/OpenJPEG/src/openjpeg/opj_includes.h b/Modules/ThirdParty/OpenJPEG/src/openjpeg/opj_includes.h
index e75a220d4d..4b13e1726a 100644
--- a/Modules/ThirdParty/OpenJPEG/src/openjpeg/opj_includes.h
+++ b/Modules/ThirdParty/OpenJPEG/src/openjpeg/opj_includes.h
@@ -87,8 +87,8 @@ Most compilers implement their own version of this keyword ...
#endif
#endif
-/* MSVC and Borland C do not have lrintf */
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+/* MSVC pre 16.8 and Borland C do not have lrintf */
+#if (defined(_MSC_VER) && _MSC_VER < 1928) || defined(__BORLANDC__)
/* MSVC 64bits doesn't support _asm */
#if !defined(_WIN64)

98
ports/itk/vcpkg.json Normal file
View File

@ -0,0 +1,98 @@
{
"name": "itk",
"version-string": "5.1.0",
"port-version": 3,
"description": "Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.",
"homepage": "https://github.com/InsightSoftwareConsortium/ITK",
"dependencies": [
"double-conversion",
"eigen3",
"expat",
{
"name": "fftw3",
"default-features": false
},
"gdcm",
"gtest",
{
"name": "hdf5",
"default-features": false,
"features": [
"cpp"
]
},
"icu",
"libjpeg-turbo",
"libpng",
"minc",
{
"name": "openjpeg",
"default-features": false
},
"tiff",
"zlib"
],
"features": {
"cuda": {
"description": "Build CUDA module",
"dependencies": [
"cuda",
{
"name": "itk",
"default-features": false,
"features": [
"opencl"
]
}
]
},
"cufftw": {
"description": "Use CUDA FFTW",
"dependencies": [
"cuda"
]
},
"opencl": {
"description": "Use OpenCL",
"dependencies": [
"opencl"
]
},
"python": {
"description": "Python functionality for ITK",
"dependencies": [
"python3"
]
},
"rtk": {
"description": "Build RTK Module"
},
"tbb": {
"description": "Build TBB Module",
"dependencies": [
"tbb"
]
},
"tools": {
"description": "Build RTK with tools",
"dependencies": [
{
"name": "itk",
"default-features": false,
"features": [
"rtk"
]
}
]
},
"vtk": {
"description": "Build ITKVtkGlue module.",
"dependencies": [
{
"name": "vtk",
"default-features": false
}
]
}
}
}

View File

@ -1,4 +0,0 @@
Source: libsamplerate
Version: 0.1.9.0-1
Homepage: https://www.mega-nerd.com/SRC
Description: Sample Rate Converter for audio

View File

@ -1,14 +1,9 @@
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE
URLS "http://www.mega-nerd.com/SRC/libsamplerate-0.1.9.tar.gz"
FILENAME "libsamplerate-0.1.9.tar.gz"
SHA512 78596657963cbf06785e3e6e1190b093df71da52ca340e75bd8246a962cd79dd1c90fa5527c607cebcb296e2c1ee605015278b274e3b768f2f3fbeb0eadfb728
)
vcpkg_extract_source_archive_ex(
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REPO libsndfile/libsamplerate
REF f6730d03c3e7660bb6ecad8816f1b09c5825142a # v0.1.9
SHA512 6a349c9144d024212fc78dc0d9e39bdc1a43abaf590fcfbf84396af22834545962d5ef10176b48b21fcae2ce62d12277b682059383805d059f4dd2b9f6708478
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/src)

View File

@ -0,0 +1,7 @@
{
"name": "libsamplerate",
"version-string": "0.1.9.0",
"port-version": 2,
"description": "Sample Rate Converter for audio",
"homepage": "https://www.mega-nerd.com/SRC"
}

View File

@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO erikd/libsndfile
REF v1.0.30
SHA512 2714dfbe923450a1f6f6d2a53ae0e88163170a5e0ce436bee27c1c41fc9b5526d6bc38e58918132248a9044f5b05fa29cd483c06c75ed67e6d83c961e30aaac9
REPO libsndfile/libsndfile
REF 68958f9c9199dad97dcd10700df3746b2cd9b8a3 # v1.0.30
SHA512 4f2af061af5d5b26106ed11e33f04930a57c79ca0e18ef5fe32255c3f555bfa7b9192db7ff0f34f782d85b2ee40662182073e1abf4a73f448c47b67c26bb5b53
HEAD_REF master
)
@ -28,7 +28,7 @@ vcpkg_configure_cmake(
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_install_cmake()
if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
set(CONFIG_PATH cmake)

View File

@ -1,6 +1,7 @@
{
"name": "libsndfile",
"version-string": "1.0.30",
"port-version": 1,
"description": "Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo",
"homepage": "https://github.com/erikd/libsndfile",
"license": "LGPL-2.1",