diff --git a/ports/cgns/CONTROL b/ports/cgns/CONTROL deleted file mode 100644 index 3398bad14fdf49..00000000000000 --- a/ports/cgns/CONTROL +++ /dev/null @@ -1,32 +0,0 @@ -Source: cgns -Version: 3.4.0-1 -Homepage: http://cgns.org/ -Description: The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. -Default-Features: hdf5, lfsselector - -Feature: mpi -Description: Compile with support for the message passage interface (MPI) -Build-Depends: hdf5[core,parallel] - -Feature: fortran -Description: Enable fortran support (not yet implemented) - -Feature: tests -Description: Build tests - -Feature: tools -Description: Build tools - -Feature: hdf5 -Description: Enable hdf5 support -Build-Depends: hdf5[core,tools] - -Feature: lfsselector -Description: Selector for LFS -Build-Depends: cgns[core,lfs] (!osx) - -Feature: lfs -Description: Enable LFS support - -Feature: legacy -Description: Enable legacy support diff --git a/ports/cgns/defines.patch b/ports/cgns/defines.patch deleted file mode 100644 index e17d488287a6a6..00000000000000 --- a/ports/cgns/defines.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/cgnstypes.h.in b/src/cgnstypes.h.in -index 98c4e7fdc..8c6bcea62 100644 ---- a/src/cgnstypes.h.in -+++ b/src/cgnstypes.h.in -@@ -29,6 +29,11 @@ - #ifndef CGNSTYPES_H - #define CGNSTYPES_H - -+#define CG_BUILD_HDF5 @BUILDHDF5@ -+#define CG_BUILD_FORTRAN @BUILDFORTRAN@ -+#define CG_BUILD_PARALLEL @BUILDPARALLEL@ -+#define CG_BUILD_BASESCOPE @BUILDBASESCOPE@ -+ - #define CG_BUILD_LEGACY @BUILDLEGACY@ - #define CG_BUILD_64BIT @BUILD64BIT@ - #define CG_BUILD_SCOPE @BUILDSCOPE@ diff --git a/ports/cgns/hdf5.patch b/ports/cgns/hdf5.patch index 4de9ee35ba031a..67d08fa2d88b2d 100644 --- a/ports/cgns/hdf5.patch +++ b/ports/cgns/hdf5.patch @@ -1,25 +1,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 58f078fe7..46446da8a 100644 +index d871a9dc8..d2c631023 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -194,71 +194,17 @@ endif (CGNS_ENABLE_FORTRAN AND HAS_FORTRAN) - option(CGNS_ENABLE_HDF5 "Enable or disable HDF5 interface" "OFF") - if (CGNS_ENABLE_HDF5) +@@ -232,46 +232,12 @@ if (CGNS_ENABLE_HDF5) + cmake_policy(SET CMP0074 NEW) + endif() -- if (CGNS_BUILD_SHARED) -- set (FIND_HDF_COMPONENTS C shared) -- else (CGNS_BUILD_SHARED) -- set (FIND_HDF_COMPONENTS C static) -- endif (CGNS_BUILD_SHARED) -- message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}") -- -- #set (SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) -- set (SEARCH_PACKAGE_NAME "hdf5") -- - find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) - message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}") - if (HDF5_FOUND) -- add_executable (h5dump IMPORTED) - if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) - set (FIND_HDF_COMPONENTS C) - @@ -31,40 +20,22 @@ index 58f078fe7..46446da8a 100644 - else (HDF5_BUILD_SHARED_LIBS) - add_definitions (-DH5_BUILT_AS_STATIC_LIB) - endif (HDF5_BUILD_SHARED_LIBS) -- if (BUILD_SHARED_LIBS AND WIN32) -- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dumpdll") -- else (BUILD_SHARED_LIBS AND WIN32) -- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") -- endif (BUILD_SHARED_LIBS AND WIN32) - else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) -- if (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND) +- if (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY}) -- else (HDF5_static_C_FOUND) +- else (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY}) -- endif (BUILD_SHARED_LIBS AND HDF5_shared_C_FOUND) -- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") +- endif (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) - endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) -+ find_package(HDF5 CONFIG REQUIRED) -+ if(TARGET hdf5::hdf5-shared) -+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared) -+ #add_executable(h5dump ALIAS hdf5::h5dump-shared) -+ set (HDF5_DUMP_EXECUTABLE $) -+ else() -+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static) -+ #add_executable(h5dump ALIAS hdf5::h5dump) - set (HDF5_DUMP_EXECUTABLE $) - -- set (HDF5_HAVE_H5PUBCONF_H 1) -- set (HDF5_HAVE_HDF5 1) -- set (HDF5_HDF5_HEADER "h5pubconf.h") -- set (HDF5_INCLUDE_DIR_GEN ${HDF5_INCLUDE_DIR}) -- message (STATUS "HDF5-${HDF5_VERSION_STRING} found: INC=${HDF5_INCLUDE_DIR} TOOLS=${HDF5_TOOLS_DIR}") - else (HDF5_FOUND) - find_package (HDF5) # Legacy find --#Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here -- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY_DIRS}/../bin) --#Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here -- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY_DIRS}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") +- +- #Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here +- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY}/../bin) +- +- #Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here +- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") - set (HDF5_BUILD_SHARED_LIBS 1) - add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) - else () @@ -73,36 +44,45 @@ index 58f078fe7..46446da8a 100644 - endif () - set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) - -- add_executable (h5dump IMPORTED) -- set_property (TARGET h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump") -- set (HDF5_DUMP_EXECUTABLE $) - endif (HDF5_FOUND) - set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME}) -- -+ endif() -+ ++ find_package (HDF5 CONFIG REQUIRED) ++ if (TARGET hdf5::hdf5-shared) ++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared) ++ else () ++ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static) ++ endif () + if (HDF5_FOUND) - set (HDF5_HAVE_H5PUBCONF_H 1) - set (HDF5_HAVE_HDF5 1) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 66b547ed1..4051f07d4 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -12,13 +12,14 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) - if (CGNS_ENABLE_HDF5) - add_definitions(-DBUILD_HDF5) - if (WIN32) -- if (HDF5_LIBRARY) -+ add_definitions(-DWIN32) -+ if (HDF5_BUILD_SHARED_LIBS) - # file(STRINGS ${HDF5_LIBRARY} HDF5isDLL REGEX "__imp__H5close") - # if (HDF5isDLL) - # this is only needed when using hdf5 dll libs -- add_definitions(-DWIN32 -D_HDF5USEDLL_) -+ add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) - # endif (HDF5isDLL) -- endif (HDF5_LIBRARY) -+ endif (HDF5_BUILD_SHARED_LIBS) - endif (WIN32) - if(HDF5_NEED_MPI AND MPI_INC) - include_directories(${MPI_INC}) + if (NOT DEFINED HDF5_INCLUDE_DIRS) +@@ -289,20 +255,10 @@ if (CGNS_ENABLE_HDF5) + endif (HDF5_FOUND) + + set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") +- if(HDF5_NEED_ZLIB) +- find_library(ZLIB_LIBRARY z) +- mark_as_advanced(CLEAR ZLIB_LIBRARY) +- else (HDF5_NEED_ZLIB) +- mark_as_advanced(FORCE ZLIB_LIBRARY) +- endif(HDF5_NEED_ZLIB) ++ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE) + + set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to szip?") +- if (HDF5_NEED_SZIP) +- find_library(SZIP_LIBRARY szip) +- mark_as_advanced(CLEAR SZIP_LIBRARY) +- else (HDF5_NEED_SZIP) +- mark_as_advanced(FORCE SZIP_LIBRARY) +- endif (HDF5_NEED_SZIP) ++ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE) + + # Check if HDF5 version is 1.8 or greater + if (HDF5_VERSION VERSION_LESS "1.8.0") +@@ -310,6 +266,7 @@ if (CGNS_ENABLE_HDF5) + endif (HDF5_VERSION VERSION_LESS "1.8.0") + + set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)") ++ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE) + set(MPI_INC) + set(MPI_LIBS) + if (HDF5_NEED_MPI) diff --git a/ports/cgns/portfile.cmake b/ports/cgns/portfile.cmake index 89544674496be3..bb75a9485ceae7 100644 --- a/ports/cgns/portfile.cmake +++ b/ports/cgns/portfile.cmake @@ -2,19 +2,16 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGNS/CGNS - REF 3420e23febf0eb38c1b05af3c157d614d8476557 # v3.4.0 - SHA512 3fec1c32f1514cd9bc327f12f3f9db6a229df05f514193bd9e913d06b8ae6465664410a3c77a30b0c29f3e999e5efcb1ebed3a8b80e14be92035940c10b1d6d7 + REF 86b686bce292eef7782cfb56b6acdb5123c96f49 # v4.2.0 + SHA512 88df741acc1b650724bcbeb82ab0f7e593bf01e0a30c04b14b9915f4ea4331725cc24b87715dd08d93d5a3708660ca7f7874bc0a9c5505b76471802cf033e35d HEAD_REF develop PATCHES hdf5.patch linux_lfs.patch - zlib_szip_mpi.patch - defines.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - mpi HDF5_NEEDS_MPI fortran CGNS_ENABLE_FORTRAN tests CGNS_ENABLE_TESTS hdf5 CGNS_ENABLE_HDF5 @@ -45,7 +42,7 @@ vcpkg_install_cmake() file(INSTALL ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h) -file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # we patched the config and the include is all that is needed +file(INSTALL ${CURRENT_PORT_DIR}/cgnsconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) # the include is all that is needed set(TOOLS cgnscheck cgnscompress cgnsconvert cgnsdiff cgnslist cgnsnames) diff --git a/ports/cgns/vcpkg.json b/ports/cgns/vcpkg.json new file mode 100644 index 00000000000000..c738b9a3b6d904 --- /dev/null +++ b/ports/cgns/vcpkg.json @@ -0,0 +1,64 @@ +{ + "name": "cgns", + "version-semver": "4.2.0", + "description": "The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations.", + "homepage": "http://cgns.org/", + "default-features": [ + "hdf5", + "lfsselector" + ], + "features": { + "fortran": { + "description": "Enable fortran support (not yet implemented)" + }, + "hdf5": { + "description": "Enable hdf5 support", + "dependencies": [ + { + "name": "hdf5", + "default-features": false, + "features": [ + "tools" + ] + } + ] + }, + "legacy": { + "description": "Enable legacy support" + }, + "lfs": { + "description": "Enable LFS support" + }, + "lfsselector": { + "description": "Selector for LFS", + "dependencies": [ + { + "name": "cgns", + "default-features": false, + "features": [ + "lfs" + ], + "platform": "!osx" + } + ] + }, + "mpi": { + "description": "Enable MPI support", + "dependencies": [ + { + "name": "hdf5", + "default-features": false, + "features": [ + "parallel" + ] + } + ] + }, + "tests": { + "description": "Build tests" + }, + "tools": { + "description": "Build tools" + } + } +} diff --git a/ports/cgns/zlib_szip_mpi.patch b/ports/cgns/zlib_szip_mpi.patch deleted file mode 100644 index 4f6608cf4d1641..00000000000000 --- a/ports/cgns/zlib_szip_mpi.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46446da8a..cd05cf51a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -219,20 +221,10 @@ if (CGNS_ENABLE_HDF5) - endif (HDF5_FOUND) - - set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") -- if(HDF5_NEED_ZLIB) -- find_library(ZLIB_LIBRARY z) -- mark_as_advanced(CLEAR ZLIB_LIBRARY) -- else (HDF5_NEED_ZLIB) -- mark_as_advanced(FORCE ZLIB_LIBRARY) -- endif(HDF5_NEED_ZLIB) -+ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE) - - set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") -- if (HDF5_NEED_SZIP) -- find_library(SZIP_LIBRARY szip) -- mark_as_advanced(CLEAR SZIP_LIBRARY) -- else (HDF5_NEED_SZIP) -- mark_as_advanced(FORCE SZIP_LIBRARY) -- endif (HDF5_NEED_SZIP) -+ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE) - - # Check if HDF5 version is 1.8 or greater - if (HDF5_VERSION VERSION_LESS "1.8.0") -@@ -240,6 +231,7 @@ if (CGNS_ENABLE_HDF5) - endif (HDF5_VERSION VERSION_LESS "1.8.0") - - set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)") -+ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE) - set(MPI_INC) - set(MPI_LIBS) - if (HDF5_NEED_MPI) diff --git a/versions/baseline.json b/versions/baseline.json index 0be479fdf7a438..449092b7fc0d3e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1201,7 +1201,7 @@ "port-version": 0 }, "cgns": { - "baseline": "3.4.0-1", + "baseline": "4.2.0", "port-version": 0 }, "chaiscript": { diff --git a/versions/c-/cgns.json b/versions/c-/cgns.json index 6a9a059d3c04dd..bc33d2bd991678 100644 --- a/versions/c-/cgns.json +++ b/versions/c-/cgns.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9d33908ce58fbfa6e823c937716e57d84d1cb2a5", + "version-semver": "4.2.0", + "port-version": 0 + }, { "git-tree": "cc70f3fcc3f4ff2dad2712400208181dc7bb280d", "version-string": "3.4.0-1",