Skip to content

Commit

Permalink
[workspace] Upgrade nlopt_internal to latest release v2.9.1 (#22257)
Browse files Browse the repository at this point in the history
* [workspace] Upgrade nlopt_internal to latest release v2.9.1

---------

Co-authored-by: Rick Poyner <[email protected]>
  • Loading branch information
nicolecheetham and rpoyner-tri authored Dec 5, 2024
1 parent f12b3a6 commit 1f1c684
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 46 deletions.
4 changes: 4 additions & 0 deletions tools/workspace/nlopt_internal/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ cmake_configure_file(
"SIZEOF_UNSIGNED_INT=",
"SIZEOF_UNSIGNED_LONG=",
],
undefines = [
# Avoid incompatible licensed luksan.
"NLOPT_LUKSAN",
],
)

# Make the config header available as a private library.
Expand Down
3 changes: 1 addition & 2 deletions tools/workspace/nlopt_internal/patches/gen_enums.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Reasoning for not upstreaming this patch: Drake-specific build hack.

--- src/api/nlopt-in.hpp.orig
+++ src/api/nlopt-in.hpp
@@ -46,6 +46,68 @@
@@ -46,4 +46,65 @@
// nlopt::* namespace versions of the C enumerated types
// AUTOMATICALLY GENERATED, DO NOT EDIT
// GEN_ENUMS_HERE
Expand All @@ -23,7 +23,6 @@ Reasoning for not upstreaming this patch: Drake-specific build hack.
+ GN_ORIG_DIRECT_L,
+ GD_STOGO,
+ GD_STOGO_RAND,
+ LD_LBFGS_NOCEDAL,
+ LD_LBFGS,
+ LN_PRAXIS,
+ LD_VAR1,
Expand Down
41 changes: 0 additions & 41 deletions tools/workspace/nlopt_internal/patches/remove_luksan.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Repair NLopt's configuration scheme for the Luksan dependency.

That library is licensed under LGPL-2.1+ but the rest of NLopt is
licensed under MIT or similar notice-only licenses, and we really
don't want to distribute this code using dynamic linking.

Recent versions of NLopt offer a configuration setting to remove Luksan,
but the piece shown below is missing.

This patch should probably be upstreamed.


--- nlopt_config.h.in
+++ nlopt_config.h.in
@@ -129,6 +129,9 @@
/* Define if compiled including C++-based routines */
#cmakedefine NLOPT_CXX

+/* Define if using LGPL Luksan solvers */
+#cmakedefine NLOPT_LUKSAN
+
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

6 changes: 3 additions & 3 deletions tools/workspace/nlopt_internal/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def nlopt_internal_repository(
github_archive(
name = name,
repository = "stevengj/nlopt",
commit = "v2.8.0",
sha256 = "e02a4956a69d323775d79fdaec7ba7a23ed912c7d45e439bc933d991ea3193fd", # noqa
commit = "v2.9.1",
sha256 = "1e6c33f8cbdc4138d525f3326c231f14ed50d99345561e85285638c49b64ee93", # noqa
build_file = ":package.BUILD.bazel",
patches = [
":patches/remove_luksan.patch",
":patches/upstream/repair_luksan_config.patch",
":patches/vendor.patch",
],
mirrors = mirrors,
Expand Down

0 comments on commit 1f1c684

Please sign in to comment.