Skip to content

Commit

Permalink
Fix rpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Jul 24, 2024
1 parent 9b94507 commit c1c69df
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
--bash-syntax
--enable-backslash-escapes
- name: Print some build-specific variables
- name: Print build-specific variables
shell: bash
run: scripts/print_build_variables.sh # bash -x scripts/print_build_variables.sh for printing commands

Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-12, macos-14]
os: [macos-12, macos-14]
python-version: ['3.10', '3.11', '3.12']
toolchain:
- { exe: gfortran, compiler: gcc, version: 13 }
Expand Down
4 changes: 2 additions & 2 deletions scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,8 @@ def change_runpath_for_built_pycfml():
# install_name_tool -rpath /opt/intel/oneapi/compiler/2023.2.0/mac/bin/intel64/../../compiler/lib @loader_path dist/pyCFML/pycrysfml/crysfml08lib.so
# install_name_tool -delete_rpath /usr/local/Cellar/gcc/13.2.0/lib/gcc/current dist/pyCFML/pycrysfml/crysfml08lib.so
# install_name_tool -change /usr/local/opt/gcc/lib/gcc/current/libgfortran.5.dylib @rpath/libgfortran.5.dylib dist/pyCFML/pycrysfml/crysfml08lib.so
# otool -l dist/pyCFML/pycrysfml/crysfml08lib.so | grep RPATH -A2
# otool -L dist/pyCFML/pycrysfml/crysfml08lib.so
# otool -l dist/pyCFML/pycrysfml/crysfml08lib.so | grep RPATH -A2 # build.rpaths in in scripts.toml
# otool -L dist/pyCFML/pycrysfml/crysfml08lib.so # build.dependent-libs in scripts.toml
try:
rpaths = CONFIG['build']['rpaths'][_platform()][_processor()][_compiler_name()]
except KeyError:
Expand Down
41 changes: 30 additions & 11 deletions scripts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,24 @@ shared-lib-ext = { macos = 'so', linux = 'so', windows = 'pyd' } # *.dylib does
ifport-lib.linux.ifort = '-L/opt/intel/oneapi/compiler/2023.2.0/linux/compiler/lib/intel64_lin -lifport'
ifport-lib.linux.ifx = '-L/opt/intel/oneapi/compiler/2023.2.0/linux/compiler/lib/intel64_lin -lifport'
extra-libs.macos.i386.gfortran = [
'/usr/local/opt/gcc/lib/gcc/current/libgfortran.5.dylib',
'/usr/local/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib',
'/usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib',
# current gcc
#'/usr/local/opt/gcc/lib/gcc/current/libgfortran.5.dylib',
#'/usr/local/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib',
#'/usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib',
# gcc 13
'/usr/local/opt/gcc@13/lib/gcc/13/libgfortran.5.dylib',
'/usr/local/opt/gcc@13/lib/gcc/13/libgcc_s.1.1.dylib',
'/usr/local/opt/gcc@13/lib/gcc/13/libquadmath.0.dylib',
]
extra-libs.macos.arm.gfortran = [
'/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib',
'/opt/homebrew/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib',
'/opt/homebrew/opt/gcc/lib/gcc/current/libquadmath.0.dylib'
# current gcc
#'/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib',
#'/opt/homebrew/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib',
#'/opt/homebrew/opt/gcc/lib/gcc/current/libquadmath.0.dylib'
# gcc 13
'/opt/homebrew/opt/gcc@13/lib/gcc/13/libgfortran.5.dylib',
'/opt/homebrew/opt/gcc@13/lib/gcc/13/libgcc_s.1.1.dylib',
'/opt/homebrew/opt/gcc@13/lib/gcc/13/libquadmath.0.dylib',
]
extra-libs.macos.i386.ifort = [
'/System/Volumes/Data/opt/intel/oneapi/compiler/2023.2.0/mac/compiler/lib/libifport.dylib',
Expand Down Expand Up @@ -230,13 +240,22 @@ rpaths.macos.arm.ifort = [
{ old = '/opt/intel/oneapi/compiler/2023.2.0/mac/bin/intel64/../../compiler/lib', new = '@loader_path' },
]
dependent-libs.macos.i386.gfortran = [
{ old = '/usr/local/opt/gcc/lib/gcc/current/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
{ old = '/usr/local/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib', new = '@rpath/libgcc_s.1.1.dylib' },
{ old = '/usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
# current gcc
#{ old = '/usr/local/opt/gcc/lib/gcc/current/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
#{ old = '/usr/local/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib', new = '@rpath/libgcc_s.1.1.dylib' },
#{ old = '/usr/local/opt/gcc/lib/gcc/current/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
# gcc 13
{ old = '/usr/local/opt/gcc@13/lib/gcc/13/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
{ old = '/usr/local/opt/gcc@13/lib/gcc/13/libgcc_s.1.1.dylib', new = '@rpath/libgcc_s.1.1.dylib' },
{ old = '/usr/local/opt/gcc@13/lib/gcc/13/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
]
dependent-libs.macos.arm.gfortran = [
{ old = '/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
{ old = '/opt/homebrew/opt/gcc/lib/gcc/current/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
# current gcc
#{ old = '/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
#{ old = '/opt/homebrew/opt/gcc/lib/gcc/current/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
# gcc 13
{ old = '/opt/homebrew/opt/gcc@13/lib/gcc/13/libgfortran.5.dylib', new = '@rpath/libgfortran.5.dylib' },
{ old = '/opt/homebrew/opt/gcc@13/lib/gcc/13/libquadmath.0.dylib', new = '@rpath/libquadmath.0.dylib' },
]
# Examples of GitHub values for Python 3.11
#python-lib.macos = '`python3-config --ldflags --embed`'
Expand Down

0 comments on commit c1c69df

Please sign in to comment.