static builds working

This commit is contained in:
Cassandra Heart 2025-01-20 07:31:41 -06:00
parent 5249107e63
commit d3f6b471c2
No known key found for this signature in database
GPG Key ID: 6352152859385958
3 changed files with 40 additions and 4 deletions

View File

@ -4,8 +4,23 @@ ENV PATH="${PATH}:/root/.cargo/bin/"
# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable)
RUN apt-get update && apt-get install -y \
libgmp-dev libflint-dev g++ \
&& rm -rf /var/lib/apt/lists/*
build-essential \
curl \
git \
cmake \
libgmp-dev \
libmpfr-dev \
libmpfr6 \
wget \
m4 \
pkg-config \
gcc \
g++ \
make \
autoconf \
automake \
libtool \
&& rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y wget && \
ARCH=$(dpkg --print-architecture) && \
@ -21,6 +36,22 @@ RUN apt update && apt install -y wget && \
ENV PATH=$PATH:/usr/local/go/bin
RUN git clone https://github.com/flintlib/flint.git && \
cd flint && \
git checkout flint-3.0 && \
./bootstrap.sh && \
./configure \
--prefix=/usr/local \
--with-gmp=/usr/local \
--with-mpfr=/usr/local \
--enable-static \
--disable-shared \
CFLAGS="-O3" && \
make && \
make install && \
cd .. && \
rm -rf flint
COPY docker/rustup-init.sh /opt/rustup-init.sh
RUN /opt/rustup-init.sh -y --profile minimal
@ -90,7 +121,6 @@ LABEL org.opencontainers.image.revision=$GIT_COMMIT
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=build /usr/bin/node /usr/local/bin
COPY --from=build /usr/local/go/bin/grpcurl /usr/local/bin
COPY --from=build /opt/ceremonyclient/client/qclient /usr/local/bin
WORKDIR /root

View File

@ -60,6 +60,11 @@ tasks:
cmds:
- docker build --platform linux/amd64 -f Dockerfile.source --output node/build/amd64_linux --target=node .
build_node_amd64_avx512_linux:
desc: Build the Quilibrium node binary for AMD64 Linux with AVX-512 extensions. Outputs to node/build.
cmds:
- docker build --platform linux/amd64 -f Dockerfile.sourceavx512 --output node/build/amd64_avx512_linux --target=node .
build_qclient_amd64_linux:
desc: Build the QClient node binary for AMD64 Linux. Outputs to node/build.
cmds:

View File

@ -26,7 +26,8 @@ case "$os_type" in
fi
;;
"Linux")
go build -ldflags "-linkmode 'external' -extldflags '-L$BINARIES_DIR -Wl,-Bstatic -lvdf -lbls48581 -Wl,-Bdynamic -lstdc++ -ldl -lm -lflint -lgmp -lmpfr'" "$@"
export CGO_LDFLAGS="-L/usr/local/lib -lflint -lgmp -lmpfr -ldl -lm -L$BINARIES_DIR -lvdf -lbls48581 -static"
go build -ldflags "-linkmode 'external'" "$@"
;;
*)
echo "Unsupported platform"