Skip to content

Commit

Permalink
feat: improve build efficiency and platform compatibility
Browse files Browse the repository at this point in the history
- Modify make to ignore two cores to mitigate the memory leak issue
- Print number of available cores before the make command
- Add Dockerfile support for multi-platform builds by introducing TARGETPLATFORM and TARGETARCH arguments

Issue NMO-589
  • Loading branch information
RedLeader962 committed Sep 12, 2024
1 parent ef84a0b commit 862e454
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build_system/ubuntu/Dockerfile.libpointmatcher.ci_PR
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ ARG PROJECT_HUB=norlabulaval
ARG BASE_IMAGE=libpointmatcher-dependencies
ARG BASE_IMAGE_TAG
FROM ${PROJECT_HUB}/${BASE_IMAGE}:${BASE_IMAGE_TAG:?err} AS libpointmatcher-dependencies
ARG TARGETPLATFORM
ARG TARGETARCH

LABEL org.opencontainers.image.authors="luc.coupal.1@ulaval.ca"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ else

cmake "${CMAKE_FLAGS[@]}" "${NBS_LIB_INSTALL_PATH}/libnabo"

make -j $(nproc)
print_msg "Nb of available core in the current process $(nproc)"
make -j $(nproc --ignore=2)
sudo make install

# (NICE TO HAVE) ToDo: refactor (ref task NMO-428 refactor: drop libnabo `make test` step after libnabo-build-system deployment)
Expand Down
3 changes: 2 additions & 1 deletion build_system/ubuntu/lpm_install_libpointmatcher_ubuntu.bash
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ else

BUILD_EXIT_CODE=$?

make -j $(nproc)
print_msg "Nb of available core in the current process $(nproc)"
make -j $(nproc --ignore=2)
sudo make install

INSTALL_EXIT_CODE=$?
Expand Down

0 comments on commit 862e454

Please sign in to comment.