From 748b3283aa409508ab406b70edf6bf9e8d00af7d Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Wed, 24 Jul 2024 09:13:19 +0200 Subject: [PATCH] Fix rpaths --- .github/workflows/main.yml | 4 ++-- scripts.py | 4 ++-- scripts.toml | 41 ++++++++++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94c0ab8..50f6168 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,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 @@ -267,7 +267,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 } diff --git a/scripts.py b/scripts.py index bcd8de3..498cfdd 100644 --- a/scripts.py +++ b/scripts.py @@ -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: diff --git a/scripts.toml b/scripts.toml index f8205c4..b4ca9e1 100644 --- a/scripts.toml +++ b/scripts.toml @@ -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', @@ -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`'