Skip to content

Commit

Permalink
fix ldflags and other things
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed May 6, 2024
1 parent 28567de commit f7afa5a
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clingo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
git -C spack checkout -b docker-reference 9b4ca0be40edb02115be94bbc428ac546d63030e
. spack/share/spack/setup-env.sh
spack external find --not-buildable cmake bison
spack config add "config:install_tree:padded_length:256"
spack config add config:install_tree:padded_length:256
- name: Install clingo
run: |
. spack/share/spack/setup-env.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gnupg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
. spack/share/spack/setup-env.sh
spack external find --not-buildable gawk perl
spack config add "config:concretizer:original"
spack config add "config:install_tree:padded_length:256"
spack config add config:concretizer:original
spack config add config:install_tree:padded_length:256
mkdir -p binary-mirror
# Inject flags to have compatibility with MacOSX version 10.13 or higher
Expand Down
47 changes: 22 additions & 25 deletions clingo/Dockerfile.manylinux2014
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
FROM ghcr.io/spack/manylinux2014:v2023-10-03

RUN cd /opt/_internal && tar xvf static-libs-for-embedding-only.tar.xz && cd -
RUN tar -C /opt/_internal -xvf static-libs-for-embedding-only.tar.xz

RUN adduser -m spack

# Switch to a non-root user
USER spack
ENV SPACK_CMD="/opt/python/cp311-cp311/bin/python /home/spack/spack/bin/spack"
WORKDIR /home/spack
ENV SPACK_PYTHON=/opt/python/cp311-cp311/bin/python
ENV PATH="/root/spack/bin/:$PATH"
WORKDIR /root

# Clone the repo and install Spack
RUN git clone https://www.github.com/spack/spack.git && \
RUN git clone https://github.com/spack/spack.git && \
git -C spack checkout -b docker-reference 9b4ca0be40edb02115be94bbc428ac546d63030e

# Set externals, locate compilers
RUN ${SPACK_CMD} external find -j 1 --not-buildable bison cmake
RUN ${SPACK_CMD} compiler find
RUN ${SPACK_CMD} config add "config:concretizer:original"
RUN ${SPACK_CMD} config add "config:install_tree:padded_length:256"
RUN spack external find -j 1 --not-buildable bison cmake
RUN spack compiler find
RUN spack config add config:concretizer:original
RUN spack config add config:install_tree:padded_length:256

# Run a script to build all the versions of clingo we could
COPY --chown=spack:spack clingo/scripts/bootstrap_clingo_manylinux2014.sh /home/spack/bootstrap_clingo2014.sh
COPY --chown=spack:spack clingo/scripts/install_clingo.py /home/spack/install_clingo.py

RUN ${HOME}/bootstrap_clingo2014.sh 36
RUN ${HOME}/bootstrap_clingo2014.sh 37
RUN ${HOME}/bootstrap_clingo2014.sh 38
RUN ${HOME}/bootstrap_clingo2014.sh 39
RUN ${HOME}/bootstrap_clingo2014.sh 310
RUN ${HOME}/bootstrap_clingo2014.sh 311
RUN ${HOME}/bootstrap_clingo2014.sh 312

COPY --chown=spack:spack clingo/scripts/create_binary_mirror.sh /home/spack/create_binary_mirror.sh
RUN ${HOME}/create_binary_mirror.sh
COPY clingo/scripts/bootstrap_clingo_manylinux2014.sh /root/bootstrap_clingo2014.sh
COPY clingo/scripts/install_clingo.py /root/install_clingo.py

RUN ./bootstrap_clingo2014.sh 36
RUN ./bootstrap_clingo2014.sh 37
RUN ./bootstrap_clingo2014.sh 38
RUN ./bootstrap_clingo2014.sh 39
RUN ./bootstrap_clingo2014.sh 310
RUN ./bootstrap_clingo2014.sh 311
RUN ./bootstrap_clingo2014.sh 312

COPY clingo/scripts/create_binary_mirror.sh /root/create_binary_mirror.sh
RUN ./create_binary_mirror.sh
21 changes: 9 additions & 12 deletions gnupg/Dockerfile.manylinux2014
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
FROM ghcr.io/spack/manylinux2014:v2023-10-03

RUN adduser -m spack

# Switch to a non-root user
USER spack
ENV SPACK_CMD="/opt/python/cp311-cp311/bin/python /home/spack/spack/bin/spack"
WORKDIR /home/spack
ENV SPACK_PYTHON="/opt/python/cp311-cp311/bin/python"
ENV PATH="/root/spack/bin/spack:$PATH"
WORKDIR /root

# Clone the repo and install Spack
RUN git clone https://www.github.com/spack/spack.git && \
RUN git clone https://github.com/spack/spack.git && \
git -C spack checkout -b docker-reference 9b4ca0be40edb02115be94bbc428ac546d63030e

# Set externals, locate compilers
RUN ${SPACK_CMD} external find --not-buildable gawk perl
RUN ${SPACK_CMD} compiler find
RUN spack external find --not-buildable gawk perl
RUN spack compiler find

RUN ${SPACK_CMD} python -c "import archspec.cpu;print(archspec.cpu.host().family)" > target.txt
RUN ${SPACK_CMD} -c "config:install_tree:padded_length:256" install gnupg "target=$(cat target.txt)"
RUN spack python -c "import archspec.cpu;print(archspec.cpu.host().family)" > target.txt
RUN spack -c config:install_tree:padded_length:256 install gnupg "target=$(cat target.txt)"

RUN mkdir -p /home/spack/binary-mirror && \
${SPACK_CMD} -c "config:install_tree:padded_length:256" buildcache push --unsigned --force /home/spack/binary-mirror gnupg "target=$(cat target.txt)"
spack -c config:install_tree:padded_length:256 buildcache push --unsigned --force /home/spack/binary-mirror gnupg "target=$(cat target.txt)"
22 changes: 10 additions & 12 deletions patchelf/Dockerfile.manylinux2014
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM ghcr.io/spack/manylinux2014:v2023-10-03

RUN adduser -m spack

# Switch to a non-root user
USER spack
ENV SPACK_CMD="/opt/python/cp311-cp311/bin/python /home/spack/spack/bin/spack"
WORKDIR /home/spack
ENV SPACK_PYTHON=/opt/python/cp311-cp311/bin/python
ENV PATH="/root/spack/bin/spack:$PATH"
WORKDIR /root

# Clone the repo and install Spack
RUN git clone https://www.github.com/spack/spack.git && \
RUN git clone https://github.com/spack/spack.git && \
git -C spack checkout -b docker-reference 9b4ca0be40edb02115be94bbc428ac546d63030e

# Set externals, locate compilers
RUN ${SPACK_CMD} external find --not-buildable cmake
RUN ${SPACK_CMD} compiler find
RUN spack external find --not-buildable cmake
RUN spack compiler find

RUN ${SPACK_CMD} python -c "import archspec.cpu;print(archspec.cpu.host().family)" > target.txt
RUN ${SPACK_CMD} -c "config:install_tree:padded_length:256" install patchelf 'ldflags="-static-libstdc++ -static-libgcc"' "target=$(cat target.txt)"
RUN spack python -c "import archspec.cpu;print(archspec.cpu.host().family)" > target.txt
RUN spack -c config:install_tree:padded_length:256 install patchelf "ldflags=-static-libstdc++ -static-libgcc" "target=$(cat target.txt)"

RUN mkdir -p /home/spack/binary-mirror && \
${SPACK_CMD} -c "config:install_tree:padded_length:256" buildcache push --unsigned --force /home/spack/binary-mirror patchelf
RUN mkdir -p /root/binary-mirror && \
spack -c config:install_tree:padded_length:256 buildcache push --unsigned --force /root/binary-mirror patchelf

0 comments on commit f7afa5a

Please sign in to comment.