[petsc-users] dyld[19098]: Library not loaded: @rpath/libHYPRE-2.32.0.dylib
Satish Balay
balay.anl at fastmail.org
Fri May 9 10:37:31 CDT 2025
>>>
Configure Options: --configModules=PETSc.Configure --optionsModule=config.compilerOptions --with-debugging=0 --download-make --download-cmake --download-hypre --download-parmetis --download-metis --download-ptscotch --download-mumps --download-scalapack --with-precision=double --with-shared-libraries=1 --with-scalar-type=real --with-fc=mpifort --with-cc=mpicc --with-cxx=mpicxx CXX_LINKER_FLAGS=-Wl,-rpath,/opt/homebrew/lib CFLAGS="-g -O2 -fPIC" CXXFLAGS="-g -O2 -fPIC" FCFLAGS="-g -O2" FFLAGS="-g -O2" LDFLAGS="-Wl,-ld_classic -Wl,-commons,use_dylibs" MAKEFLAGS=w --download-bison
<<<
Hm LDFLAGS="-Wl,-ld_classic -Wl,-commons,use_dylibs" should be needed anymore - well atleast with latest --download-mpich.
>>>
Executing: mpicc -show
stdout: clang -I/opt/homebrew/Cellar/open-mpi/5.0.7/include -L/opt/homebrew/Cellar/open-mpi/5.0.7/lib -lmpi
Executing: mpicc --version
stdout:
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.4.0
<<<<
We use the same xcode/clang version for our CI - and this issue doesn't come up here.
>>>
balay at npro ~ % clang --version
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
<<<
Ok - just tried:
>>>
balay at npro petsc % ./configure --with-debugging=0 --download-make --download-cmake --download-hypre --download-parmetis --download-metis --download-ptscotch --download-mumps --download-scalapack --with-precision=double --with-shared-libraries=1 --with-scalar-type=real --download-mpich CC=clang CXX=clang++ FC=gfortran COPTFLAGS="-g -O2 -fPIC" CXXFOPTLAGS="-g -O2 -fPIC" FOPTFLAGS="-g -O2" --download-bison
<snip>
xxx=======================================================================================xxx
Configure stage complete. Now build PETSc libraries with:
make PETSC_DIR=/Users/balay/petsc PETSC_ARCH=arch-darwin-c-opt all
xxx=======================================================================================xxx
balay at npro petsc % make && make check
<snip>
FC arch-darwin-c-opt/obj/src/snes/ftn-mod/petscsnesmod.o
FC arch-darwin-c-opt/obj/src/ts/ftn-mod/petsctsmod.o
FC arch-darwin-c-opt/obj/src/tao/ftn-mod/petsctaomod.o
CLINKER arch-darwin-c-opt/lib/libpetsc.3.23.1.dylib
ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment
DSYMUTIL arch-darwin-c-opt/lib/libpetsc.3.23.1.dylib
make[3]: Leaving directory '/Users/balay/petsc'
make[2]: Leaving directory '/Users/balay/petsc'
=========================================
Now to check if the libraries are working do:
make PETSC_DIR=/Users/balay/petsc PETSC_ARCH=arch-darwin-c-opt check
=========================================
Running PETSc check examples to verify correct installation
Using PETSC_DIR=/Users/balay/petsc and PETSC_ARCH=arch-darwin-c-opt
C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process
C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes
C/C++ example src/snes/tutorials/ex19 run successfully with HYPRE
C/C++ example src/snes/tutorials/ex19 run successfully with MUMPS
Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process
Completed PETSc check examples
balay at npro petsc %
<<<<
Would this alternate work for you?
Satish
On Thu, 8 May 2025, Matthew Knepley wrote:
> On Thu, May 8, 2025 at 6:22 PM Juan Salazar <jp.salazar at pm.me> wrote:
>
> > Thank you for the feedback Matthew,
> >
> > I should explain why there is a difference in the path variables. I am
> > compiling PETSc on case-sensitive Apple File System as a volume mounted at
> > /Volume/OpenFOAM. This is because I compile OpenFOAM natively (it is
> > developed for Linux, but with some tweaks it can be compiled on macOS). I
> > use the PETSc library within custom OpenFOAM applications (solvers).
> > Therefore I install PETSc in the same volume.
> >
>
> I believe it is as David said. The dynamic linker cannot load it due to
> multiple paths. You should be able to see that with otool -L on the
> executable. Did you see his message?
>
> Thanks,
>
> Matt
>
> Reason: tried:
> '/Volumes/OpenFOAM/jsalazar-9/ThirdParty/petsc-3.23.1/arch-darwin-c-opt/lib/libHYPRE-2.32.0.dylib'
> (duplicate LC_RPATH '/opt/homebrew/Cellar/open-mpi/5.0.7/lib'),
>
>
> > Depending on how I reach the installation folder, the PWD variable will be
> > set differently.
> >
> > Last login: Thu May 8 19:05:51 on ttys004
> > √ ~ % cd /Volumes/OpenFOAM/jsalazar-9/ThirdParty/petsc-3.23.1
> > √ petsc-3.23.1 % pwd
> > /Volumes/OpenFOAM/jsalazar-9/ThirdParty/petsc-3.23.1
> >
> > Last login: Thu May 8 19:07:38 on ttys004
> > √ ~ % cd ~/openfoam/jsalazar-9/ThirdParty/petsc-3.23.1
> > √ petsc-3.23.1 % pwd
> > /Users/jsalazar/openfoam/jsalazar-9/ThirdParty/petsc-3.23.1
> >
> > I noticed that within the python configure script the path is obtained
> > invariably through the command os.getcwd().
> >
> > √ petsc-3.23.1 % python
> > Python 3.12.10 (main, Apr 8 2025, 11:35:47) [Clang 16.0.0
> > (clang-1600.0.26.6)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import os
> > >>> os.getcwd()
> > '/Volumes/OpenFOAM/jsalazar-9/ThirdParty/petsc-3.23.1'
> >
> > This result is the same independent of how I got to the folder.
> >
> > So I ran ./configure again making sure that PWD is the same as
> > os.getcwd(). Unfortunately this did not solve the problem. I believe the
> > paths are consistent now.
> >
> > Thanks again,
> > Juan S.
> >
> >
> >
> >
> >
> >
> >
>
>
More information about the petsc-users
mailing list