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

[pagmo2] Add new port #15682

Merged
merged 11 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
4 changes: 4 additions & 0 deletions port_versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4356,6 +4356,10 @@
"baseline": "2020-12-14",
"port-version": 0
},
"pagmo2": {
"baseline": "2.16.1",
"port-version": 0
},
"paho-mqtt": {
"baseline": "1.3.8",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions port_versions/p-/pagmo2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "1ee0bfbbddae450b0ddc6efd20471aaae51e8cdc",
"version-string": "2.16.1",
"port-version": 0
}
]
}
9 changes: 9 additions & 0 deletions ports/pagmo2/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Source: pagmo2
Version: 2.16.1
Homepage: https://esa.github.io/pagmo2/
Description: A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
Build-Depends: boost-any, boost-graph, boost-serialization, eigen3, tbb

Feature: nlopt
Description: Enable the NLopt wrappers
Build-Depends: nlopt
13 changes: 13 additions & 0 deletions ports/pagmo2/disable-C4701.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96653ba..1afaafa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,7 +80,7 @@ endif()
if(YACMA_COMPILER_IS_MSVC)
# Disable the idiotic minmax macros on MSVC, some annoying warnings,
# enable the bigobj option and the WIN32_LEAN_AND_MEAN definition.
- list(APPEND PAGMO_CXX_FLAGS_DEBUG "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
+ list(APPEND PAGMO_CXX_FLAGS_DEBUG "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/wd4701" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
list(APPEND PAGMO_CXX_FLAGS_RELEASE "-DNOMINMAX" "/wd4459" "/wd4127" "/wd4702" "/wd4251" "/bigobj" "-DWIN32_LEAN_AND_MEAN")
# Enable strict conformance mode, if supported.
set(CMAKE_REQUIRED_QUIET TRUE)
32 changes: 32 additions & 0 deletions ports/pagmo2/disable-md-override.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 96653ba..b572ab5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -141,27 +141,6 @@ endif()
# Boost setup.
include(PagmoFindBoost)

-# Explanation: on MSVC, when building static libraries, it is good practice to link
-# to the static runtime. CMake, however, is hard-coded to link to the dynamic runtime.
-# Hence we hackishly replace the /MD flag with /MT. This is the approach suggested
-# in the CMake FAQ:
-#
-# https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime
-#
-# Note that at one point CMake added the possiblity to set this as a target property,
-# so in the future we should definitely migrate to that approach:
-#
-# https://cmake.org/cmake/help/git-master/prop_tgt/MSVC_RUNTIME_LIBRARY.html
-if(YACMA_COMPILER_IS_MSVC AND PAGMO_BUILD_STATIC_LIBRARY)
- foreach(flag_var
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- if(${flag_var} MATCHES "/MD")
- string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
- endif()
- endforeach()
-endif()
-
# List of source files.
set(PAGMO_SRC_FILES
# Core classes.
12 changes: 12 additions & 0 deletions ports/pagmo2/find-tbb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/pagmo-config.cmake.in b/pagmo-config.cmake.in
index 9553fc8..cb5e90b 100644
--- a/pagmo-config.cmake.in
+++ b/pagmo-config.cmake.in
@@ -8,6 +8,7 @@ set(THREADS_PREFER_PTHREAD_FLAG YES)
find_package(Threads REQUIRED)
unset(THREADS_PREFER_PTHREAD_FLAG)
include(PagmoFindBoost)
+find_package(TBB REQUIRED)
@_PAGMO_CONFIG_OPTIONAL_DEPS@
# Restore original module path.
set(CMAKE_MODULE_PATH "${_PAGMO_CONFIG_OLD_MODULE_PATH}")
36 changes: 36 additions & 0 deletions ports/pagmo2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO esa/pagmo2
REF v2.16.1
SHA512 dac85a8525316e827df809d187d40f14dc20db7119796b7384d7855f83ba37e0bb595f6d8199053aac857460816929dd599c9d43802f2ed920a6f42dd2f16a03
HEAD_REF master
PATCHES
"disable-C4701.patch"
"disable-md-override.patch"
"find-tbb.patch"
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
nlopt PAGMO_WITH_NLOPT
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAGMO_BUILD_STATIC_LIBRARY)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DPAGMO_WITH_EIGEN3=ON
-DPAGMO_BUILD_STATIC_LIBRARY=${PAGMO_BUILD_STATIC_LIBRARY}
)

vcpkg_install_cmake()

vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/pagmo)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(INSTALL ${SOURCE_PATH}/COPYING.lgpl3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)