aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Ribizel <ribizel@kit.edu>2021-03-29 18:52:37 +0200
committerGitHub <noreply@github.com>2021-03-29 09:52:37 -0700
commit286fa50cbdc2854e4a6c626e811cbb701833765d (patch)
treef48101faa498d992283d3da0a2813f5756032dc0
parent2980294114179299de1794e230187e98785d858d (diff)
downloadvcpkg-286fa50cbdc2854e4a6c626e811cbb701833765d.tar.gz
vcpkg-286fa50cbdc2854e4a6c626e811cbb701833765d.zip
[ginkgo] Create new port (#16536)
* [ginkgo] create new port * [ginkgo] add description for feature requirements * Update baseline version * [ginkgo] Minimize patches Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
-rw-r--r--ports/ginkgo/cmake-fixes.patch86
-rw-r--r--ports/ginkgo/portfile.cmake40
-rw-r--r--ports/ginkgo/vcpkg.json26
-rw-r--r--ports/ginkgo/windows-iterator.patch117
-rw-r--r--versions/baseline.json4
-rw-r--r--versions/g-/ginkgo.json9
6 files changed, 282 insertions, 0 deletions
diff --git a/ports/ginkgo/cmake-fixes.patch b/ports/ginkgo/cmake-fixes.patch
new file mode 100644
index 000000000..dde1c4667
--- /dev/null
+++ b/ports/ginkgo/cmake-fixes.patch
@@ -0,0 +1,86 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e75f7d6..63685f2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,6 +20,12 @@ include(cmake/hip_path.cmake)
+ include(cmake/autodetect_executors.cmake)
+ include(cmake/build_type_helpers.cmake)
+
++if (MSVC)
++ add_compile_options(/bigobj)
++elseif (MINGW OR CYGWIN)
++ add_compile_options("-Wa,-mbig-obj")
++endif()
++
+ # Ginkgo configuration options
+ option(GINKGO_DEVEL_TOOLS "Add development tools to the build system" OFF)
+ option(GINKGO_BUILD_TESTS "Generate build files for unit tests" ON)
+diff --git a/cmake/GinkgoConfig.cmake.in b/cmake/GinkgoConfig.cmake.in
+index 0348f95..3b8be0f 100644
+--- a/cmake/GinkgoConfig.cmake.in
++++ b/cmake/GinkgoConfig.cmake.in
+@@ -129,8 +129,6 @@ set(GINKGO_OPENMP_LIBRARIES @OpenMP_CXX_LIBRARIES@)
+ set(GINKGO_OPENMP_FLAGS "@OpenMP_CXX_FLAGS@")
+
+ # Provide useful HIP helper functions
+-include(${CMAKE_CURRENT_LIST_DIR}/hip_helpers.cmake)
+-include(${CMAKE_CURRENT_LIST_DIR}/windows_helpers.cmake)
+
+ # NOTE: we do not export benchmarks, examples, tests or devel tools
+ # so `third_party` libraries are currently unneeded.
+diff --git a/cmake/install_helpers.cmake b/cmake/install_helpers.cmake
+index ba7ea3f..7cc3ba8 100644
+--- a/cmake/install_helpers.cmake
++++ b/cmake/install_helpers.cmake
+@@ -14,16 +14,11 @@ function(ginkgo_install_library name subdir)
+ # dll is considered as runtime
+ install(TARGETS "${name}"
+ EXPORT Ginkgo
+- LIBRARY DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR}
+- ARCHIVE DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR}
+- RUNTIME DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR}
+ )
+ else ()
+ # install .so and .a files
+ install(TARGETS "${name}"
+ EXPORT Ginkgo
+- LIBRARY DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR}
+- ARCHIVE DESTINATION ${GINKGO_INSTALL_LIBRARY_DIR}
+ )
+ endif ()
+ endfunction()
+@@ -37,9 +32,8 @@ function(ginkgo_install)
+ DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}"
+ FILES_MATCHING PATTERN "*.hpp"
+ )
+- install(DIRECTORY "${Ginkgo_BINARY_DIR}/include/"
+- DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}"
+- FILES_MATCHING PATTERN "*.hpp"
++ install(FILES "${Ginkgo_BINARY_DIR}/include/ginkgo/config.hpp"
++ DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}/ginkgo"
+ )
+ if (GINKGO_HAVE_PAPI_SDE)
+ install(FILES "${Ginkgo_SOURCE_DIR}/third_party/papi_sde/papi_sde_interface.h"
+@@ -70,8 +64,6 @@ function(ginkgo_install)
+ install(FILES
+ "${Ginkgo_BINARY_DIR}/GinkgoConfig.cmake"
+ "${Ginkgo_BINARY_DIR}/GinkgoConfigVersion.cmake"
+- "${Ginkgo_SOURCE_DIR}/cmake/hip_helpers.cmake"
+- "${Ginkgo_SOURCE_DIR}/cmake/windows_helpers.cmake"
+ DESTINATION "${GINKGO_INSTALL_CONFIG_DIR}"
+ )
+ install(EXPORT Ginkgo
+diff --git a/cmake/windows_helpers.cmake b/cmake/windows_helpers.cmake
+index 5f517a5..46d31ba 100644
+--- a/cmake/windows_helpers.cmake
++++ b/cmake/windows_helpers.cmake
+@@ -14,9 +14,7 @@ function(ginkgo_switch_windows_link lang from to)
+ endfunction()
+
+ macro(ginkgo_switch_to_windows_static lang)
+- ginkgo_switch_windows_link(${lang} "MD" "MT")
+ endmacro()
+
+ macro(ginkgo_switch_to_windows_dynamic lang)
+- ginkgo_switch_windows_link(${lang} "MT" "MD")
+ endmacro()
diff --git a/ports/ginkgo/portfile.cmake b/ports/ginkgo/portfile.cmake
new file mode 100644
index 000000000..8cd722f5a
--- /dev/null
+++ b/ports/ginkgo/portfile.cmake
@@ -0,0 +1,40 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ginkgo-project/ginkgo
+ REF v1.3.0
+ SHA512 40db39666730a2120d0c5e197518f784aab71655781c037fb83302a346f6bf717e5c58491e9b29b9adacb492328e11bc60960f99323c220d53505ecab6489871
+ HEAD_REF master
+ PATCHES
+ cmake-fixes.patch
+ windows-iterator.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ openmp GINKGO_BUILD_OMP
+ cuda GINKGO_BUILD_CUDA
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PREFER_NINJA
+ OPTIONS
+ -DGINKGO_BUILD_REFERENCE=ON
+ -DGINKGO_BUILD_TESTS=OFF
+ -DGINKGO_BUILD_EXAMPLES=OFF
+ -DGINKGO_BUILD_HIP=OFF
+ -DGINKGO_BUILD_BENCHMARKS=OFF
+ -DGINKGO_DEVEL_TOOLS=OFF
+ -DGINKGO_SKIP_DEPENDENCY_UPDATE=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
+ -DGinkgo_NAME=ginkgo
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Ginkgo)
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/ginkgo" RENAME copyright)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/ports/ginkgo/vcpkg.json b/ports/ginkgo/vcpkg.json
new file mode 100644
index 000000000..68d62e518
--- /dev/null
+++ b/ports/ginkgo/vcpkg.json
@@ -0,0 +1,26 @@
+{
+ "name": "ginkgo",
+ "version-semver": "1.3.0",
+ "description": "Ginkgo is a high-performance linear algebra library for manycore systems, with a focus on sparse solution of linear systems. Note that the OpenMP feature is not available on Windows, and the CUDA feature on Windows requires the CUDACXX environment variable to point to the CUDA nvcc.exe compiler with VCPKG_KEEP_ENV_VARS set to CUDACXX to pass its value through to the vcpkg environment.",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "cuda": {
+ "description": "Build the CUDA backend of Ginkgo",
+ "dependencies": [
+ "cuda"
+ ]
+ },
+ "openmp": {
+ "description": "Build the OpenMP backend of Ginkgo"
+ }
+ }
+}
diff --git a/ports/ginkgo/windows-iterator.patch b/ports/ginkgo/windows-iterator.patch
new file mode 100644
index 000000000..be6645f37
--- /dev/null
+++ b/ports/ginkgo/windows-iterator.patch
@@ -0,0 +1,117 @@
+diff --git a/core/base/iterator_factory.hpp b/core/base/iterator_factory.hpp
+index b7efd21dfe..5e4bddeb17 100644
+--- a/core/base/iterator_factory.hpp
++++ b/core/base/iterator_factory.hpp
+@@ -110,7 +110,7 @@ class IteratorFactory {
+
+ ~Reference() {}
+
+- Reference(IteratorFactory &parent, array_index_type array_index)
++ Reference(IteratorFactory *parent, array_index_type array_index)
+ : parent_(parent), arr_index_(array_index)
+ {}
+
+@@ -143,10 +143,10 @@ class IteratorFactory {
+ {
+ // In C++11, it is legal for a nested class to access private
+ // members of the parent class.
+- parent_.dominant_values_[arr_index_] =
+- std::move(other.parent_.dominant_values_[other.arr_index_]);
+- parent_.secondary_values_[arr_index_] =
+- std::move(other.parent_.secondary_values_[other.arr_index_]);
++ parent_->dominant_values_[arr_index_] =
++ std::move(other.parent_->dominant_values_[other.arr_index_]);
++ parent_->secondary_values_[arr_index_] =
++ std::move(other.parent_->secondary_values_[other.arr_index_]);
+ return *this;
+ }
+
+@@ -174,25 +174,25 @@ class IteratorFactory {
+ return left.dominant < right.dominant();
+ }
+
+- ToSortType &dominant() { return parent_.dominant_values_[arr_index_]; }
++ ToSortType &dominant() { return parent_->dominant_values_[arr_index_]; }
+
+ const ToSortType &dominant() const
+ {
+- return parent_.dominant_values_[arr_index_];
++ return parent_->dominant_values_[arr_index_];
+ }
+
+ SecondaryType &secondary()
+ {
+- return parent_.secondary_values_[arr_index_];
++ return parent_->secondary_values_[arr_index_];
+ }
+
+ const SecondaryType &secondary() const
+ {
+- return parent_.secondary_values_[arr_index_];
++ return parent_->secondary_values_[arr_index_];
+ }
+
+ private:
+- IteratorFactory &parent_;
++ IteratorFactory *parent_;
+ array_index_type arr_index_;
+ };
+
+@@ -214,9 +214,11 @@ class IteratorFactory {
+ using reference = Reference;
+ using iterator_category = std::random_access_iterator_tag;
+
++ Iterator() = default;
++
+ ~Iterator() {}
+
+- Iterator(IteratorFactory &parent, difference_type array_index)
++ Iterator(IteratorFactory *parent, difference_type array_index)
+ : parent_(parent), arr_index_(array_index)
+ {}
+
+@@ -298,12 +300,12 @@ class IteratorFactory {
+ }
+
+ // Comparable operators
+- bool operator==(const Iterator &other)
++ bool operator==(const Iterator &other) const
+ {
+ return arr_index_ == other.arr_index_;
+ }
+
+- bool operator!=(const Iterator &other)
++ bool operator!=(const Iterator &other) const
+ {
+ return arr_index_ != other.arr_index_;
+ }
+@@ -329,8 +331,8 @@ class IteratorFactory {
+ }
+
+ private:
+- IteratorFactory &parent_;
+- difference_type arr_index_;
++ IteratorFactory *parent_{};
++ difference_type arr_index_{};
+ };
+
+ public:
+@@ -363,7 +365,7 @@ class IteratorFactory {
+ * Creates an iterator pointing to the beginning of both arrays
+ * @returns an iterator pointing to the beginning of both arrays
+ */
+- Iterator begin() { return {*this, 0}; }
++ Iterator begin() { return {this, 0}; }
+
+ /**
+ * Creates an iterator pointing to the (excluding) end of both arrays
+@@ -371,7 +373,7 @@ class IteratorFactory {
+ */
+ Iterator end()
+ {
+- return {*this, static_cast<typename Iterator::difference_type>(size_)};
++ return {this, static_cast<typename Iterator::difference_type>(size_)};
+ }
+
+ private:
+
diff --git a/versions/baseline.json b/versions/baseline.json
index a7ac25ae1..741cca782 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2200,6 +2200,10 @@
"baseline": "5.1.4-6",
"port-version": 0
},
+ "ginkgo": {
+ "baseline": "1.3.0",
+ "port-version": 0
+ },
"gl2ps": {
"baseline": "1.4.2",
"port-version": 0
diff --git a/versions/g-/ginkgo.json b/versions/g-/ginkgo.json
new file mode 100644
index 000000000..c65080a75
--- /dev/null
+++ b/versions/g-/ginkgo.json
@@ -0,0 +1,9 @@
+{
+ "versions": [
+ {
+ "git-tree": "b204eef5f779c05c2160e28cc07f411258ddcbfc",
+ "version-semver": "1.3.0",
+ "port-version": 0
+ }
+ ]
+}