-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workspace] Deprecate the csdp external
Switch the csdp_internal C code to build using hidden visibility.
- Loading branch information
1 parent
c3fee1d
commit db8400d
Showing
10 changed files
with
129 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load("//tools/lint:lint.bzl", "add_lint_tests") | ||
|
||
add_lint_tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# -*- bazel -*- | ||
|
||
load("@drake//tools/install:install.bzl", "install") | ||
|
||
licenses(["notice"]) # EPL-2.0 | ||
|
||
package(default_visibility = ["//visibility:private"]) | ||
|
||
cc_library( | ||
name = "csdp", | ||
srcs = [ | ||
"lib/Fnorm.c", | ||
"lib/add_mat.c", | ||
"lib/addscaledmat.c", | ||
"lib/allocmat.c", | ||
"lib/calc_dobj.c", | ||
"lib/calc_pobj.c", | ||
"lib/chol.c", | ||
"lib/copy_mat.c", | ||
"lib/easysdp.c", | ||
"lib/freeprob.c", | ||
"lib/initparams.c", | ||
"lib/initsoln.c", | ||
"lib/linesearch.c", | ||
"lib/make_i.c", | ||
"lib/makefill.c", | ||
"lib/mat_mult.c", | ||
"lib/mat_multsp.c", | ||
"lib/matvec.c", | ||
"lib/norms.c", | ||
"lib/op_a.c", | ||
"lib/op_at.c", | ||
"lib/op_o.c", | ||
"lib/packed.c", | ||
"lib/psd_feas.c", | ||
"lib/qreig.c", | ||
"lib/readprob.c", | ||
"lib/readsol.c", | ||
"lib/sdp.c", | ||
"lib/solvesys.c", | ||
"lib/sortentries.c", | ||
"lib/sym_mat.c", | ||
"lib/trace_prod.c", | ||
"lib/tweakgap.c", | ||
"lib/user_exit.c", | ||
"lib/writeprob.c", | ||
"lib/writesol.c", | ||
"lib/zero_mat.c", | ||
], | ||
hdrs = [ | ||
"includes/csdp/blockmat.h", | ||
"includes/csdp/declarations.h", | ||
"includes/csdp/index.h", | ||
"includes/csdp/parameters.h", | ||
], | ||
copts = [ | ||
"-Wno-unknown-pragmas", | ||
"-Wno-unused-variable", | ||
"-fvisibility=hidden", | ||
# CSDP calls exit() for error handling. That doesn't suit our needs for | ||
# embedding it within Drake, so we'll redirect calls to exit() to our | ||
# own setjmp/longjmp handler instead. | ||
"-Dexit=drake_csdp_cpp_wrapper_exit", | ||
# Because we use longjmp, we must forbid CSDP's OpenMP-based threads. | ||
"-fno-openmp", | ||
], | ||
includes = ["includes"], | ||
linkstatic = 1, | ||
deps = [ | ||
"@blas", | ||
"@drake//solvers:csdp_solver_error_handling", | ||
"@lapack", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# We do not install the header file (its a private dependency), but we still | ||
# need to install its license file. | ||
install( | ||
name = "install", | ||
docs = ["LICENSE"], | ||
visibility = ["//visibility:public"], | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@drake//tools/workspace:github.bzl", "github_archive") | ||
|
||
def csdp_internal_repository( | ||
name, | ||
mirrors = None): | ||
github_archive( | ||
name = name, | ||
repository = "coin-or/Csdp", | ||
commit = "releases/6.2.0", | ||
sha256 = "3d341974af1f8ed70e1a37cc896e7ae4a513375875e5b46db8e8f38b7680b32f", # noqa | ||
build_file = ":package.BUILD.bazel", | ||
patches = [ | ||
":patches/params_pathname.patch", | ||
":patches/printlevel.patch", | ||
], | ||
patch_cmds = [ | ||
# Move the headers into a subdirectory, so they don't pollute the | ||
# top-level include path. | ||
"mkdir includes", | ||
"mv include includes/csdp", | ||
"sed -i -e 's|^#include \"|#include \"csdp/|g;' lib/*.c", | ||
# Add include guards. | ||
"sed -i -e $'1s/^/#pragma once\\\n/' includes/csdp/*.h", | ||
], | ||
mirrors = mirrors, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters