Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CGNS/ParaView] Add new ports #9960

Merged
merged 26 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cfc3223
[cgns] add port cgns
Neumann-A May 11, 2020
38bb147
[paraview] add new port
Neumann-A May 11, 2020
aa4e06d
[paraview] correct dependencies; disable catalyst
Neumann-A May 11, 2020
f4d8187
Merge remote-tracking branch 'upstream/master' into extract_paraview_pr
Neumann-A May 12, 2020
5272a72
[VTK/ParaView] Make ParaView build
Neumann-A May 12, 2020
af5f408
[paraview] add missing patch
Neumann-A May 13, 2020
6938ce9
[paraview] add cgns patch
Neumann-A May 13, 2020
bde989f
[paraview] add qt plugin patches back in. Remove in the future
Neumann-A May 13, 2020
fad61bd
[vtk] slightly improved patches
Neumann-A May 13, 2020
322aba3
[vtk] don't disable findPython
Neumann-A May 13, 2020
da4316e
[paraview] add more features
Neumann-A May 13, 2020
1307fed
[paraview] remove X11Extras from OSX
Neumann-A May 13, 2020
5a81eea
[vtk] make vtk workcorrectly with python and prepare for paraview wit…
Neumann-A May 14, 2020
2ccf632
[paraview] Python fixes
Neumann-A May 14, 2020
63d1616
[paraview] small bin -> lib replacement fix for static builds
Neumann-A May 14, 2020
b1540a7
[vtk] fix patch path
Neumann-A May 14, 2020
0b96cb4
update baseline to exclude paraview for the time being on osx and linux.
Neumann-A May 14, 2020
4b003af
[paraview]try setting LD_LIBRARY_PATH for unix systems
Neumann-A May 14, 2020
5e84c89
[paraview] a bit of cleanup
Neumann-A May 14, 2020
f303b00
update baseline
Neumann-A May 14, 2020
9c5debd
fix typo in baseline
Neumann-A May 14, 2020
579d255
[paraview] remove unnecessary patch
Neumann-A May 14, 2020
3ffc68d
[vtk] replace custom patch with upstream patch
Neumann-A May 15, 2020
a2b9c24
[paraview] cleanup in the portfile.
Neumann-A May 15, 2020
93ee65c
Update ports/paraview/CONTROL
JackBoosY May 22, 2020
6517a62
Merge remote-tracking branch 'upstream/master' into extract_paraview_pr
Neumann-A Jun 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ports/cgns/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Source: cgns
Version: 3.4.0-1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, 5.8.1 (due at the end of June) will have/need 4.1.1 (customer needed it bumped).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it's due at the end of May.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question then is does PV 5.8.1 still compile with VTK 9.0? Or do you have a coordinated release VTK + PV this time around?
VTKm + VTK + PV are quite picky with which version or should I say git commit they compile. (e.g. I cant use VTKm 1.5.1 for VTK 9.0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.8.1 is still tracking the VTK that it 5.8.0 came out with (VTK's paraview/release branch). I think there have only been a few dozen patches on it since 5.8.0. I think all the necessary patches are also in master (not sure about 9.0.x). But no coordination is there yet (I want it too, but VTK development is hard to get to commit to API stability for a variety of reasons).

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
6 changes: 6 additions & 0 deletions ports/cgns/cgnsconfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef CGNSCONFIG_H
#define CGNSCONFIG_H

#include "cgnstypes.h"

#endif
16 changes: 16 additions & 0 deletions ports/cgns/defines.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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@
108 changes: 108 additions & 0 deletions ports/cgns/hdf5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58f078fe7..46446da8a 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)

- 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)
-
- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS})
- message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_FOUND}")
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
- if (HDF5_BUILD_SHARED_LIBS)
- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
- 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)
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY})
- else (HDF5_static_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 (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 $<TARGET_FILE:h5dump-shared>)
+ else()
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static)
+ #add_executable(h5dump ALIAS hdf5::h5dump)
set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump>)
-
- 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}")
- set (HDF5_BUILD_SHARED_LIBS 1)
- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
- else ()
- set (HDF5_BUILD_SHARED_LIBS 0)
- add_definitions (-DH5_BUILT_AS_STATIC_LIB)
- 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 $<TARGET_FILE:h5dump>)
- endif (HDF5_FOUND)
- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME})
-
+ 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})
12 changes: 12 additions & 0 deletions ports/cgns/linux_lfs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46446da8a..a3d8cd98f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,7 @@ if (CGNS_ENABLE_LFS)
else (WIN32)
check_symbol_exists(open64 "sys/types.h;sys/stat.h;unistd.h" HAVE_OPEN64)
check_symbol_exists(lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64)
+ add_definitions(-D_FILE_OFFSET_BITS=64 -D__LARGEFILE64_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
endif (WIN32)
if (HAVE_OPEN64)
add_definitions(-DHAVE_OPEN64)
88 changes: 88 additions & 0 deletions ports/cgns/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CGNS/CGNS
REF 3420e23febf0eb38c1b05af3c157d614d8476557 # v3.4.0
SHA512 3fec1c32f1514cd9bc327f12f3f9db6a229df05f514193bd9e913d06b8ae6465664410a3c77a30b0c29f3e999e5efcb1ebed3a8b80e14be92035940c10b1d6d7
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
lfs CGNS_ENABLE_LFS
legacy CGNS_ENABLE_LEGACY
)

if(VCPKG_TARGET_ARCHITECTURE MATCHES "64")
list(APPEND CGNS_BUILD_OPTS "-DCGNS_ENABLE_64BIT=ON")
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=ON;-DCGNS_USE_SHARED=ON")
else()
list(APPEND CGNS_BUILD_OPTS "-DCGNS_BUILD_SHARED=OFF;-DCGNS_USE_SHARED=OFF")
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
${FEATURE_OPTIONS}
${CGNS_BUILD_OPTS}
)

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

set(TOOLS cgnscheck cgnscompress cgnsconvert cgnsdiff cgnslist cgnsnames)

foreach(tool ${TOOLS})
set(suffix ${VCPKG_TARGET_EXECUTABLE_SUFFIX})
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
endif()
endforeach()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})

IF(EXISTS ${CURRENT_PACKAGES_DIR}/debug)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/debug/include/cgnsconfig.h)
endif()

file(REMOVE ${CURRENT_PACKAGES_DIR}/include/cgnsBuild.defs ${CURRENT_PACKAGES_DIR}/include/cgnsconfig.h)
file(GLOB_RECURSE BATCH_FILES ${CURRENT_PACKAGES_DIR}/bin/*.bat)

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

# # Moves all .cmake files from /debug/share/cgns/ to /share/cgns/
# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details
# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/cgns)

# # Handle copyright
file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

# # Post-build test for cmake libraries
# vcpkg_test_cmake(PACKAGE_NAME cgns)
35 changes: 35 additions & 0 deletions ports/cgns/zlib_szip_mpi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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)
25 changes: 25 additions & 0 deletions ports/paraview/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Source: paraview
Version: 5.8.0
Homepage: https://www.paraview.org/
Description: VTK-based Data Analysis and Visualization Application
Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm

Feature: vtkm
Description: enables vtkm for the build of paraview
Build-Depends: vtk[core,vtkm]

Feature: python
Description: enables the build of python wrappers
Build-Depends: vtk[core,python]

Feature: cuda
Description: enables cuda within paraview
Build-Depends: cuda, vtk[core, cuda]

Feature: mpi
Description: enables cuda within paraview
Build-Depends: hdf5[core,parallel], vtk[core, mpi]

Feature: all_modules
Description: enables the build of all paraview modules
Build-Depends: gdal, pdal, ffmpeg, laszip
Loading