-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use Clang to build MJX #534
base: main
Are you sure you want to change the base?
Conversation
.github/container/Dockerfile.mjx
Outdated
ARG CC | ||
ARG CXX | ||
|
||
ENV CC=${CC} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of enforcing the compiler toolchain globally, can we set it only for the MPC installation step?
.github/container/Dockerfile.mjx
Outdated
RUN CC=${CC_COMPILER} CXX=${CXX_COMPILER} pip-finalize.sh /opt/pip-tools.d/requirements-mpc.in | ||
|
||
# compiler the rest dependencies | ||
RUN pip-finalize.sh /opt/pip-tools.d/requirements-mjx.in /opt/pip-tools.d/requirements-l2r.in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to run pip-finalize
twice here? Due to the use of pip-sync
in the script, the second run will erase what the first run installed.
The plan coming out of an offline discussion between @DwarKapex and me is to use multi-stage build to create the MPC wheel using clang and then bring it into the mealkit/final image to avoid interfering with the default compiler toolchain. This is similar to how we build the jaxlib wheel in the JAX core image and also how we build the tensorflow-text/lingvo packages in the T5X/Pax arm64 images. |
I got a compilation issue while compiling mujoco-mpc with GNU c++ compiler:
The developers of
mujoco-mpc
use Clang to compile (https://github.com/google-deepmind/mujoco_mpc/blob/main/.github/workflows/build.yml#L19).From now on, the default compiler for MJX is Clang, but can be changed via docker arguments.