From f0d04abc6ebef98383d7a7d368901ea47e468ed2 Mon Sep 17 00:00:00 2001 From: Cameron Earle Date: Sat, 17 Feb 2024 10:55:35 -0500 Subject: [PATCH] Do not use clang on x86 --- trajectory_native/Earthfile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/trajectory_native/Earthfile b/trajectory_native/Earthfile index f18e3ee7..9c711a99 100644 --- a/trajectory_native/Earthfile +++ b/trajectory_native/Earthfile @@ -12,8 +12,10 @@ grpc: RUN git clone --recurse-submodules -b v1.60.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc RUN mkdir grpc/build WORKDIR grpc/build - ENV CC=clang - ENV CXX=clang++ + IF [ "$TARGETARCH" = "arm64" ] + ENV CC=clang + ENV CXX=clang++ + END RUN cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF .. RUN make -j4 RUN make DESTDIR=$(pwd)/installroot_top install @@ -27,11 +29,13 @@ trajoptlib: GIT CLONE --branch 95c20be79be7557673d75d631703dc92fe6a191e https://github.com/SleipnirGroup/TrajoptLib TrajoptLib WORKDIR TrajoptLib COPY trajoptlib-aarch64.patch . - RUN git apply trajoptlib-aarch64.patch + RUN git apply --ignore-space-change --ignore-whitespace trajoptlib-aarch64.patch RUN mkdir build WORKDIR build - ENV CC=clang - ENV CXX=clang++ + IF [ "$TARGETARCH" = "arm64" ] + ENV CC=clang + ENV CXX=clang++ + END RUN cmake -DOPTIMIZER_BACKEND=casadi -DBUILD_TESTING=OFF .. RUN make -j4 RUN make DESTDIR=$(pwd)/installroot_top install @@ -45,8 +49,10 @@ dev-image: BUILD +trajoptlib COPY +grpc/installroot /usr/local/ COPY +trajoptlib/installroot /usr/local/ - ENV CC=clang - ENV CXX=clang++ + IF [ "$TARGETARCH" = "arm64" ] + ENV CC=clang + ENV CXX=clang++ + END SAVE IMAGE littletonrobotics/vts-dev vts: @@ -56,6 +62,10 @@ vts: COPY CMakeLists.txt CMakeLists.txt RUN mkdir build WORKDIR build + IF [ "$TARGETARCH" = "arm64" ] + ENV CC=clang + ENV CXX=clang++ + END RUN cmake .. RUN make -j4 EXPOSE 56328