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

[gmsh] Add new port #21896

Merged
merged 13 commits into from
Dec 17, 2021
110 changes: 110 additions & 0 deletions ports/gmsh/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.onelab.info/
OUT_SOURCE_PATH SOURCE_PATH
REPO gmsh/gmsh
REF gmsh_4_9_0
SHA512 e70a09741a86a9131094e77742078aec1cc94517e1d7c855c257bc93c21c057e25c7ac5168d31ec4d905d78f31d5704faf63bfd3a81b4b9e2ebbcfacf2fdaa8b
HEAD_REF master
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_LIB)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
fltk ENABLE_FLTK
opencascade ENABLE_OCC
opencascade ENABLE_OCC_CAF
opencascade ENABLE_OCC_TBB
tools ENABLE_BUILD_DYNAMIC
graphics ENABLE_GRAPHICS
mpi ENABLE_MPI
zipper ENABLE_ZIPPER

)

if (ENABLE_BUILD_DYNAMIC)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
include(vcpkg_find_fortran)
vcpkg_find_fortran(FORTRAN_CMAKE)
endif()
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${FEATURE_OPTIONS}
-DENABLE_BUILD_LIB=${BUILD_LIB}
-DENABLE_BUILD_SHARED=${BUILD_SHARED}
-DENABLE_MSVC_STATIC_RUNTIME=${STATIC_RUNTIME}
${FORTRAN_CMAKE}
-DGMSH_RELEASE=ON
Copy link
Member

Choose a reason for hiding this comment

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

Is there some kind of rationale as to which of these are turned on vs. off? I don't really know how to evaluate if this is correct or not but I see yet another scientific compute project that depends on the universe of optional dependencies and am scared 👻

Also, is there a good way to make sure if/when the version is updated that we know what the new optional dependencies are to turn off?

Copy link
Contributor

Choose a reason for hiding this comment

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

According to the CMakeLists.txt:

if(NOT GMSH_RELEASE)
  find_package(Git)
  if(GIT_FOUND)
    execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
                    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ERROR_QUIET
                    OUTPUT_VARIABLE GIT_COMMIT_HASH
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
  endif()
  if(GIT_COMMIT_HASH)
    set(GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}-git-${GIT_COMMIT_HASH}")
  endif()
  set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION_TEXI} (development version)")
endif()

set(GMSH_SHORT_VERSION
    "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}")
set(GMSH_VERSION "${GMSH_SHORT_VERSION}${GMSH_EXTRA_VERSION}")
set(GMSH_SHORT_LICENSE "GNU General Public License")

set(GMSH_GITLAB_PREFIX "https://gitlab.onelab.info/gmsh/gmsh")
if(GMSH_RELEASE)
  string(REPLACE "\." "_" GMSH_SHORT_VERSION_ ${GMSH_SHORT_VERSION})
  set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/gmsh_${GMSH_SHORT_VERSION_}")
else()
  set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/master")
endif()

This option is used to get gmsh version.
Since we use the release, so it should be turn on.

Copy link
Member

Choose a reason for hiding this comment

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

@JackBoosY Perhaps I chose a bad example option. There are a ton of options in this list that look like they control optional dependencies, and I don't know how to evaluate how or why various ones of those are turned on. (Of course the first option in the list is the one that just tells it it's a release copy :()

-DENABLE_3M=OFF
-DENABLE_ALGLIB=OFF
-DENABLE_ANN=OFF
-DENABLE_BAMG=OFF
-DENABLE_BLAS_LAPACK=OFF
-DENABLE_BLOSSOM=OFF
-DENABLE_BUILD_ANDROID=OFF
-DENABLE_BUILD_IOS=OFF
-DENABLE_CGNS=OFF
-DENABLE_CGNS_CPEX0045=OFF
-DENABLE_CAIRO=OFF
-DENABLE_PROFILE=OFF
-DENABLE_DINTEGRATION=OFF
-DENABLE_DOMHEX=OFF
-DENABLE_EIGEN=OFF
-DENABLE_GEOMETRYCENTRAL=OFF
-DENABLE_GETDP=OFF
-DENABLE_GMM=OFF
-DENABLE_GMP=OFF
-DENABLE_HXT=OFF
-DENABLE_KBIPACK=OFF
-DENABLE_MATHEX=OFF
-DENABLE_MED=OFF
-DENABLE_MESH=OFF
-DENABLE_METIS=OFF
-DENABLE_MMG=OFF
-DENABLE_MPEG_ENCODE=OFF
-DENABLE_MUMPS=OFF
-DENABLE_NETGEN=OFF
-DENABLE_OPENMP=OFF
-DENABLE_NUMPY=OFF
-DENABLE_PETSC4PY=OFF
-DENABLE_ONELAB=OFF
-DENABLE_ONELAB_METAMODEL=OFF
-DENABLE_OPENACC=OFF
-DENABLE_OPTHOM=OFF
-DENABLE_OS_SPECIFIC_INSTALL=OFF
-DENABLE_OSMESA=OFF
-DENABLE_P4EST=OFF
-DENABLE_PACKAGE_STRIP=ON
-DENABLE_PARSER=OFF
-DENABLE_PETSC=OFF
-DENABLE_PLUGINS=ON
-DENABLE_POST=OFF
-DENABLE_POPPLER=OFF
-DENABLE_PRIVATE_API=OFF
-DENABLE_PRO=OFF
-DENABLE_QUADMESHINGTOOLS=OFF
-DENABLE_QUADTRI=OFF
-DENABLE_REVOROPT=OFF
-DENABLE_RPATH=OFF # Should use dependencies in vcpkg
-DENABLE_SLEPC=OFF
-DENABLE_SOLVER=OFF
-DENABLE_SYSTEM_CONTRIB=ON
-DENABLE_TCMALLOC=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOUCHBAR=OFF
-DENABLE_VISUDEV=OFF
-DENABLE_VOROPP=OFF
-DENABLE_WINSLOWUNTANGLER=OFF
-DENABLE_WRAP_JAVA=OFF
-DENABLE_WRAP_PYTHON=OFF
)

vcpkg_cmake_install()

# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/gmsh)

file(INSTALL" ${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
61 changes: 61 additions & 0 deletions ports/gmsh/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "gmsh",
"version": "4.9.0",
"description": "Gmsh is an open source 3D finite element mesh generator with a built-in CAD engine and post-processor.",
"homepage": "https://gmsh.info",
"dependencies": [
"blas",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"fltk": {
"description": "Enable FLTK graphical user interface (requires mesh/post)",
"dependencies": [
"fltk"
]
},
"graphics": {
"description": "Enable building graphics lib even without GUI (advanced)",
"dependencies": [
"libjpeg-turbo",
"libpng",
"opengl",
"zlib"
]
},
"mpi": {
"description": "Enable MPI (experimental, not used for meshing)",
"dependencies": [
"openmpi"
]
},
"occ": {
"description": "Enable OpenCASCADE modules",
"dependencies": [
"caf",
"freetype",
"opencascade",
"tbb"
]
},
"tools": {
"description": "Enable dynamic Gmsh executable (linked with shared library)",
"dependencies": [
"vcpkg-gfortran"
]
},
"zipper": {
"description": "Enable Zip file compression/decompression",
"dependencies": [
"zlib"
]
}
}
}
9 changes: 9 additions & 0 deletions versions/g-/gmsh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "a3d820b76e6f0730d1d5aa595bdefcca0cbf3f3b",
"version-string": "2021-12-04",
"port-version": 0
}
]
}