Skip to content

Commit daba3d8

Browse files
committed
Force -ld_classic when necessary?
1 parent e90b169 commit daba3d8

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/workflows/full-mpich.yml

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ jobs:
8888
8989
- name: Symlink GCC & Fortran
9090
run: ./etc/actions/macos/link_fortran.sh "$(uname -p)"
91+
92+
- name: Set ld_classic based on macOS version
93+
run: |
94+
if [ "${{ matrix.version }}" -ne "15" ]; then
95+
echo "CXX=g++ -Wl,-ld_classic -Wl,-commons,use_dylibs -Wno-unused-command-line-argument" >> $GITHUB_ENV
96+
fi
9197
9298
- name: Configure
9399
run: |

.github/workflows/full-openmpi.yml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
runs-on: macos-${{ matrix.version }}
8181

8282
env:
83+
CXX: "g++ -Wl,-ld_classic -Wl,-commons,use_dylibs -Wno-unused-command-line-argument"
8384
MPIRUN: mpirun
8485
MPICC: mpicc
8586
MPICXX: mpicxx

3rdparty/ff-petsc/Makefile

+12
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ PETSC_DOWNLOAD += --download-superlu_dist
8080
PETSC_DOWNLOAD_C += --with-superlu_dist-dir=$(DIR_INSTALL_REAL)
8181
endif
8282

83+
ifeq ($(DARWIN),Darwin)
84+
LD_CLASSIC = $(shell echo $(CXX) | grep -o "\-Wl,\-ld_classic")
85+
USE_DYLIBS = $(shell echo $(CXX) | grep -o "\-Wl,\-commons,use_dylibs")
86+
ifneq ($(LD_CLASSIC)$(USE_DYLIBS),)
87+
COMMON_FLAGS += LDFLAGS='$(LD_CLASSIC) $(USE_DYLIBS)'
88+
ifeq ($(MPICC)$(MPICXX),)
89+
CC := $(shell echo $(CC) | sed 's/[ ]*-Wl,-ld_classic//' | sed 's/[ ]*-Wl,-commons,use_dylibs//')
90+
CXX := $(shell echo $(CXX) | sed 's/[ ]*-Wl,-ld_classic//' | sed 's/[ ]*-Wl,-commons,use_dylibs//')
91+
endif
92+
endif
93+
endif
94+
8395
ifeq ($(MPICC)$(MPICXX),)
8496
ifeq ($(WIN32DLLTARGET),)
8597
PETSC_DOWNLOAD += --with-cc='$(CC)' --with-cxx='$(CXX)' --download-mpich=https://www.mpich.org/static/downloads/4.3.0/mpich-4.3.0.tar.gz

0 commit comments

Comments
 (0)