Reputation: 1
I am trying to install the python-binding of drake. After make --j it freezes. I believe I have done everything correctly for the previous steps. Can anyone help? I am running on Ubuntu 18.04 with python 3.6.9.
Thank you in advance. It looks like this.
Upvotes: 0
Views: 99
Reputation: 5566
Possibly out of memory..
A hacky solution is to change the CMakeLists.txt
file to set the max number of jobs bazel uses by adding --jobs N
(where N is the number of jobs you allow concurrently) after ${BAZEL_TARGETS}
like so
ExternalProject_Add(drake_cxx_python
SOURCE_DIR "${PROJECT_SOURCE_DIR}"
CONFIGURE_COMMAND :
BUILD_COMMAND
${BAZEL_ENV}
"${Bazel_EXECUTABLE}"
${BAZEL_STARTUP_ARGS}
build
${BAZEL_ARGS}
${BAZEL_TARGETS}
--jobs 1
BUILD_IN_SOURCE ON
BUILD_ALWAYS ON
INSTALL_COMMAND
${BAZEL_ENV}
"${Bazel_EXECUTABLE}"
${BAZEL_STARTUP_ARGS}
run
${BAZEL_ARGS}
${BAZEL_TARGETS}
--
${BAZEL_TARGETS_ARGS}
USES_TERMINAL_BUILD ON
USES_TERMINAL_INSTALL ON
)
Upvotes: 0
Reputation: 56
Use make
(no -j
flag) or make -j1
because bazel
(which is called internally during the build) handles the parallelism of the build (and of tests) and will set the number of jobs to the number of cores by default (appears to be 8 in your case).
To adjust the parallelism to reduce the number of jobs to less than the number of cores, create a file named user.bazelrc
at the root of the repository (same level as the WORKSPACE
file) with the content
test --jobs=N
for some N
less than the number of cores that you have.
See also https://docs.bazel.build/versions/master/guide.html#bazelrc.
Upvotes: 1
Reputation: 5533
From the screen shot, it doesn't look like the drake build system is doing anything wrong. But make -j
is probably trying to do too many things in parallel. Try starting with -j4
and if it still freezes, go down to 2
, etc.
Upvotes: 0