[pagmo2] Add ipopt feature (#53599)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Frazer McLean 2026-08-31 14:55:49 +02:00 committed by GitHub
parent 6ad206f2bf
commit 9f1f252e27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 59 additions and 2 deletions

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 610f968..d4a0854 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -460,7 +460,7 @@ if(PAGMO_WITH_NLOPT)
set(_PAGMO_CONFIG_OPTIONAL_DEPS "${_PAGMO_CONFIG_OPTIONAL_DEPS}find_package(NLopt 2.6 REQUIRED NO_MODULE)\n")
endif()
if(PAGMO_WITH_IPOPT)
- set(_PAGMO_CONFIG_OPTIONAL_DEPS "${_PAGMO_CONFIG_OPTIONAL_DEPS}find_package(pagmo_IPOPT REQUIRED COMPONENTS header)\n")
+ set(_PAGMO_CONFIG_OPTIONAL_DEPS "${_PAGMO_CONFIG_OPTIONAL_DEPS}find_package(pagmo_IPOPT REQUIRED COMPONENTS header libipopt)\n")
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pagmo-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/pagmo-config.cmake" @ONLY)

View File

@ -0,0 +1,13 @@
diff --git a/cmake_modules/Findpagmo_IPOPT.cmake b/cmake_modules/Findpagmo_IPOPT.cmake
index 626c33a..46136bd 100644
--- a/cmake_modules/Findpagmo_IPOPT.cmake
+++ b/cmake_modules/Findpagmo_IPOPT.cmake
@@ -53,5 +53,8 @@ if ("libipopt" IN_LIST pagmo_IPOPT_FIND_COMPONENTS)
message(STATUS "Path to libipopt: ${PAGMO_IPOPT_LIBRARY}")
add_library(pagmo::IPOPT::libipopt UNKNOWN IMPORTED)
set_target_properties(pagmo::IPOPT::libipopt PROPERTIES IMPORTED_LOCATION "${PAGMO_IPOPT_LIBRARY}")
+ find_package(LAPACK REQUIRED)
+ set_property(TARGET pagmo::IPOPT::libipopt APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES LAPACK::LAPACK ${CMAKE_DL_LIBS})
endif()
endif()

View File

@ -0,0 +1,15 @@
diff --git a/include/pagmo/algorithms/ipopt.hpp b/include/pagmo/algorithms/ipopt.hpp
index 5fea524..d275cb0 100644
--- a/include/pagmo/algorithms/ipopt.hpp
+++ b/include/pagmo/algorithms/ipopt.hpp
@@ -38,8 +38,8 @@ see https://www.gnu.org/licenses/. */
#include <tuple>
#include <vector>
-#include <IpReturnCodes.hpp>
-#include <IpTypes.hpp>
+#include <coin-or/IpReturnCodes.hpp>
+#include <coin-or/IpTypes.hpp>
#include <pagmo/algorithm.hpp>
#include <pagmo/algorithms/not_population_based.hpp>

View File

@ -10,10 +10,14 @@ vcpkg_from_github(
0003-disable-werror.patch
0004-support-eigen3-5.patch
0005-avoid-stdext-checked-array-iterator.diff # ~= https://github.com/esa/pagmo2/commit/d4daedc9f865bf9e926946c21e62c4a4eebf353e
0006-config-find-libipopt.patch
0007-ipopt-transitive-deps.patch # coin-or-ipopt provides no cmake config
0008-ipopt-header-search.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ipopt PAGMO_WITH_IPOPT
nlopt PAGMO_WITH_NLOPT
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAGMO_BUILD_STATIC_LIBRARY)

View File

@ -1,7 +1,7 @@
{
"name": "pagmo2",
"version": "2.19.1",
"port-version": 2,
"port-version": 3,
"description": "A C++ platform to perform parallel computations of optimization tasks (global and local) via the asynchronous generalized island model.",
"homepage": "https://esa.github.io/pagmo2/",
"license": "GPL-3.0-or-later OR LGPL-3.0-or-later",
@ -23,6 +23,12 @@
}
],
"features": {
"ipopt": {
"description": "Enable the Ipopt wrappers",
"dependencies": [
"coin-or-ipopt"
]
},
"nlopt": {
"description": "Enable the NLopt wrappers",
"dependencies": [

View File

@ -995,6 +995,7 @@ osg[tools]:arm64-linux=combination-fails
osg-qt:arm64-linux=cascade
osgearth:arm64-linux=cascade
osgearth[tools]:arm64-osx=feature-fails # Undefined _NSSearchPathForDirectoriesInDomains
pagmo2[ipopt](android | uwp)=cascade # coin-or-ipopt -> lapack (!android), coinutils (!uwp)
pango[introspection]:arm64-windows=skip # needs arm64 host
pangolin:arm64-linux=cascade
pangolin[core,eigen,examples,ffmpeg,gui,jpeg,lz4,module,openexr,openni2,png,realsense,tiff,tools,vars,video,zstd]:x64-windows-static-md=combination-fails

View File

@ -7702,7 +7702,7 @@
},
"pagmo2": {
"baseline": "2.19.1",
"port-version": 2
"port-version": 3
},
"paho-mqtt": {
"baseline": "1.3.16",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5a928918bc9a30e492e9b65795cb8cb18084da7b",
"version": "2.19.1",
"port-version": 3
},
{
"git-tree": "17bc4e5d8d8c28446f414b23555c22c615b3703a",
"version": "2.19.1",