* [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>
This commit is contained in:
Tobias Ribizel 2021-03-29 18:52:37 +02:00 коммит произвёл GitHub
Родитель 2980294114
Коммит 286fa50cbd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 282 добавлений и 0 удалений

Просмотреть файл

@ -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()

Просмотреть файл

@ -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")

26
ports/ginkgo/vcpkg.json Normal file
Просмотреть файл

@ -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"
}
}
}

Просмотреть файл

@ -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:

Просмотреть файл

@ -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

9
versions/g-/ginkgo.json Normal file
Просмотреть файл

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "b204eef5f779c05c2160e28cc07f411258ddcbfc",
"version-semver": "1.3.0",
"port-version": 0
}
]
}