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

Fix mac build error #16

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 8 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-l%:libgcc.a

# platform specific config
# Bazel will automatic pick platform config since we have enable_platform_specific_config set
build:linux --copt=-fopenmp
build:linux --linkopt=-fopenmp
build:macos --copt="-Xpreprocessor -fopenmp"
build:macos --copt=-Xclang=-fopenmp
build:macos --copt=-Wno-unused-command-line-argument
build:macos --features=-supports_dynamic_linker
build:macos --macos_minimum_os=12.0
build:macos --host_macos_minimum_os=12.0
build:macos --macos_minimum_os=13.0
build:macos --host_macos_minimum_os=13.0
build:macos --action_env MACOSX_DEPLOYMENT_TARGET=13.0

build:linux --copt=-fopenmp
build:linux --linkopt=-fopenmp

2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ workflows:
.circleci/continue-config.yml sdk-build-and-run true
dataproxy_sdk/.* sdk-build-and-run true
.bazelrc sdk-build-and-run true
WORKSPACE sdk-build-and-run true
MODULE.bazel sdk-build-and-run true
- lint
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "dataproxy_sdk_pip",
python_version = python_version,
requirements_linux = "//dataproxy_sdk/python:requirements_lock_{}.txt".format(python_version.replace(".", "_")),
requirements_lock = "//dataproxy_sdk/python:requirements_lock_{}.txt".format(python_version.replace(".", "_")),
)
for python_version in SUPPORTED_PYTHON_VERSIONS
]

use_repo(pip, "dataproxy_sdk_pip")

bazel_dep(name = "apple_support", version = "1.17.1")
bazel_dep(name = "arrow", version = "14.0.2")
bazel_dep(name = "rules_foreign_cc", version = "0.13.0")
bazel_dep(name = "spdlog", version = "1.14.1")
Expand Down
18 changes: 18 additions & 0 deletions dataproxy_sdk/python/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,28 @@ load("@rules_python//python:defs.bzl", "py_library", "py_test")

package(default_visibility = ["//visibility:public"])

exports_files(
[
"exported_symbols.lds",
"version_script.lds",
],
visibility = ["//visibility:private"],
)

pybind_extension(
name = "_dm_mock",
srcs = ["_dm_mock.cc"],
linkopts = select({
"@bazel_tools//src/conditions:darwin": [
"-Wl,-exported_symbols_list,$(location :exported_symbols.lds)",
],
"//conditions:default": [
"-Wl,--version-script,$(location :version_script.lds)",
],
}),
deps = [
":exported_symbols.lds",
":version_script.lds",
"//dataproxy_sdk/cc:exception",
"//dataproxy_sdk/test:data_mesh_mock",
],
Expand Down
1 change: 1 addition & 0 deletions dataproxy_sdk/python/test/exported_symbols.lds
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_PyInit_*
9 changes: 9 additions & 0 deletions dataproxy_sdk/python/test/version_script.lds
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VERS_1.0 {
# Export symbols in pybind.
global:
PyInit_*;

# Hide everything else.
local:
*;
};
Loading