Skip to content

Commit 9f2875b

Browse files
nimrod-gileadicopybara-github
authored andcommitted
Use system zlib instead of building from source.
ZLIB has some issues with building with CMake, which mean we had to explicitly list all targets to build, instead of just running cmake as usual. If we use zlib from the system, this is not necessary. Also in this CL: - Remove the explicit list of targets to build with GH Actions. - Run the tests from the correct directory. PiperOrigin-RevId: 604978828 Change-Id: I36f596c6be433e643670dd8055674c4daebcf2c8
1 parent 32309a8 commit 9f2875b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ jobs:
1919
-DCMAKE_C_COMPILER:STRING=clang-12
2020
-DCMAKE_CXX_COMPILER:STRING=clang++-12
2121
-DMJPC_BUILD_GRPC_SERVICE:BOOL=ON
22-
additional_targets: "agent_server direct_server filter_server"
2322
tmpdir: "/tmp"
2423
- os: macos-12
2524
cmake_args: >-
2625
-G Ninja
2726
-DMJPC_BUILD_GRPC_SERVICE:BOOL=ON
28-
additional_targets: "agent_server direct_server filter_server"
2927
tmpdir: "/tmp"
3028

3129
name: "MuJoCo MPC on ${{ matrix.os }} ${{ matrix.additional_label }}"
@@ -43,9 +41,10 @@ jobs:
4341
libxrandr-dev
4442
libxi-dev
4543
ninja-build
44+
zlib1g-dev
4645
- name: Prepare macOS
4746
if: ${{ runner.os == 'macOS' }}
48-
run: brew install ninja
47+
run: brew install ninja zlib
4948
- name: Prepare Windows
5049
if: ${{ runner.os == 'Windows' }}
5150
# Install llvm 16 manually, remove after
@@ -68,10 +67,12 @@ jobs:
6867
$cmake_extra_args
6968
- name: Build MuJoCo MPC
7069
working-directory: build
71-
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }} --target mjpc agent_test agent_utilities_test cost_derivatives_test norm_test rollout_test threadpool_test trajectory_test direct_force_test direct_optimize_test direct_parameter_test direct_sensor_test direct_trajectory_test direct_utilities_test batch_filter_test batch_prior_test kalman_test spline_test unscented_test cubic_test gradient_planner_test gradient_test linear_test zero_test backward_pass_test ilqg_test robust_planner_test sampling_planner_test state_test task_test utilities_test ${{ matrix.additional_targets }}
70+
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
7271
- name: Test MuJoCo MPC
7372
working-directory: build
74-
run: ctest -C Release --output-on-failure .
73+
run: >
74+
cd mjpc/test &&
75+
ctest -C Release --output-on-failure .
7576
- name: Notify team chat
7677
shell: bash
7778
env:

mjpc/grpc/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set(BUILD_SHARED_LIBS
2020
CACHE INTERNAL "Build SHARED libraries"
2121
)
2222

23+
find_package(ZLIB REQUIRED)
24+
set(gRPC_ZLIB_PROVIDER "package" CACHE INTERNAL "")
25+
set(ZLIB_BUILD_EXAMPLES OFF)
26+
2327
findorfetch(
2428
USE_SYSTEM_PACKAGE
2529
OFF
@@ -35,9 +39,6 @@ findorfetch(
3539
gRPC
3640
)
3741

38-
find_package(ZLIB REQUIRED)
39-
set(gRPC_ZLIB_PROVIDER "package" CACHE INTERNAL "")
40-
set(ZLIB_BUILD_EXAMPLES OFF)
4142
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
4243
set(_REFLECTION grpc++_reflection)
4344
set(_PROTOBUF_PROTOC $<TARGET_FILE:protoc>)

0 commit comments

Comments
 (0)