Skip to content

Commit

Permalink
Compile dependencies in container always with PIC
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Mar 28, 2024
1 parent 94ae9eb commit b4460ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ jobs:
cc -Q -v test.c
- name: Build CLI
env:
# this flag shouldn't make a difference according to
# https://doc.rust-lang.org/rustc/codegen-options/index.html#special-relocation-models,
# but run in a container on my laptop it makes the following errors go away:
# "relocation R_X86_64_32 against `...' can not be used when making a PIE object; recompile with -fPIE"
RUSTFLAGS: '-Crelocation-model=dynamic-no-pic'
run: |
cargo install --features=static --path pineappl_cli --locked -vvv
# result is in /usr/local/cargo/bin/pineappl
Expand Down
9 changes: 6 additions & 3 deletions maintainer/pineappl-ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ rm -r /usr/local/cargo/registry
( curl "https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${LHAPDF_V}.tar.gz" || \
curl "https://web.archive.org/web/20211018095814/https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.4.0.tar.gz" ) | tar xzf -
cd LHAPDF-${LHAPDF_V}
./configure --disable-python
# compile static libraries with PIC to make statically linking PineAPPL's CLI work
./configure --disable-python --with-pic=yes
make -j V=1
make install
ldconfig
Expand All @@ -48,7 +49,8 @@ done
# install APPLgrid
curl "https://applgrid.hepforge.org/downloads?f=applgrid-${APPLGRID_V}.tgz" | tar xzf -
cd applgrid-${APPLGRID_V}
./configure --without-root
# compile static libraries with PIC to make statically linking PineAPPL's CLI work
./configure --without-root --with-pic=yes
make -j
make install
ldconfig
Expand All @@ -60,7 +62,8 @@ cd ..
# install fastNLO
curl "https://fastnlo.hepforge.org/code/v25/fastnlo_toolkit-${FASTNLO_V}.tar.gz" | tar xzf -
cd fastnlo_toolkit-${FASTNLO_V}
./configure --prefix=/usr/local/
# compile static libraries with PIC to make statically linking PineAPPL's CLI work
./configure --prefix=/usr/local/ --with-pic=yes
make -j V=1
make install
ldconfig
Expand Down

0 comments on commit b4460ff

Please sign in to comment.