Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker issue on Xcode 15 and PETSc v 3.19 on macOS Sonoma(intel) #368

Open
okaragoz opened this issue Nov 20, 2023 · 1 comment
Open

Linker issue on Xcode 15 and PETSc v 3.19 on macOS Sonoma(intel) #368

okaragoz opened this issue Nov 20, 2023 · 1 comment

Comments

@okaragoz
Copy link

okaragoz commented Nov 20, 2023

When attempting to configure PETSc (version 3.18.6 or 3.19) on macOS Sonoma (intel), I encountered an error related to linking Fortran libraries. The error message indicates that Fortran libraries cannot be used with C as the linker. I am using Apple Clang version 15.0.0 for C compilation and GNU Fortran (Homebrew GCC 13.2.0) version 13.2.0 for Fortran.

The following issue addresses this situation: https://gitlab.com/petsc/petsc/-/issues/1500#note_1658121055 (xcode-15 removed some ld options - compatible fixes for this are in petsc-3.20 [so 3.18, 3.19 are unlikely to compile/work with xcode-15]).

When I tried Petsc 3.20 it worked, is there any plan to update packages for 3.20?

Thanks.

@cgw0814
Copy link

cgw0814 commented Dec 4, 2023

Hi~ @okaragoz
I'm using M2 Mac to test the petsc

as direction on https://github.com/dealii/candi/blob/master/deal.II-toolchain/platforms/supported/macos.platform

first, type "brew install openmpi"

second, set environments in .zshrc
export OMPI_CC="/opt/homebrew/bin/gcc-13" export OMPI_CXX="/opt/homebrew/bin/g++-13" export OMPI_FC="/opt/homebrew/bin/gfortran-13" export CC="/opt/homebrew/bin/mpicc" export CXX="/opt/homebrew/bin/mpic++" export FF="/opt/homebrew/bin/mpifort" export FC="/opt/homebrew/bin/mpifort"

third. Test the fortran links with C, type in terminal
mpicc -showme

if shows
/opt/homebrew/bin/gcc-13 -I/opt/homebrew/Cellar/open-mpi/5.0.0/include -L/opt/homebrew/Cellar/open-mpi/5.0.0/lib -lmpi

It means that the problem about "Fortran libraries cannot be used with C as the linker" is resolved

In this condition, install from petsc-lite-3.18.0 to petsc-3.20.2 with ./candi.sh would work.

As for downloading petsc-3.20.2 with ./candi.sh, you can add

VERSION=3.20.2 CHECKSUM=1e170a5f096433ca21aa643c80c749eb
in /deal.II-toolchain/packages/petsc.package

and modify the NAME and SOURCE of petsc as

NAME=petsc-${VERSION} SOURCE=https://web.cels.anl.gov/projects/petsc/download/release-snapshots/

after you download candi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants