Skip to content

Commit 93c41a2

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

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-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" >> $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"
8384
MPIRUN: mpirun
8485
MPICC: mpicc
8586
MPICXX: mpicxx

3rdparty/ff-petsc/Makefile

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

83+
ifeq ($(DARWIN),Darwin)
84+
PETSC_DOWNLOAD += --download-mpich-device=ch4:ofi
85+
LD_CLASSIC = $(shell echo $(CXX) | grep -o "\-Wl,\-ld_classic")
86+
USE_DYLIBS = $(shell echo $(CXX) | grep -o "\-Wl,\-commons,use_dylibs")
87+
ifneq ($(LD_CLASSIC)$(USE_DYLIBS),)
88+
COMMON_FLAGS += LDFLAGS='$(LD_CLASSIC) $(USE_DYLIBS)'
89+
ifeq ($(MPICC)$(MPICXX),)
90+
CC := $(shell echo $(CC) | sed 's/-Wl,-ld_classic[ ]*//' | sed 's/-Wl,-commons,use_dylibs[ ]*//' | sed 's/[ ]*$$//')
91+
CXX := $(shell echo $(CXX) | sed 's/-Wl,-ld_classic[ ]*//' | sed 's/-Wl,-commons,use_dylibs[ ]*//' | sed 's/[ ]*$$//')
92+
endif
93+
endif
94+
endif
95+
8396
ifeq ($(MPICC)$(MPICXX),)
8497
ifeq ($(WIN32DLLTARGET),)
8598
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)