> On 1 Apr 2024, at 23: 38, Satish Balay <balay@ mcs. anl. gov> wrote: > > On Sun, 31 Mar 2024, Zongze Yang wrote: >>> --- >>> petsc@ npro petsc % ./configure --download-bison --download-chaco --download-ctetgen
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd

> On 1 Apr 2024, at 23:38, Satish Balay <ba...@mcs.anl.gov> wrote:
> 
> On Sun, 31 Mar 2024, Zongze Yang wrote:
>>> ---
>>> petsc@npro petsc % ./configure --download-bison --download-chaco --download-ctetgen --download-eigen --download-fftw --download-hdf5 --download-hpddm --download-hwloc --download-hypre --download-libpng --download-metis --download-mmg --download-mumps --download-netcdf --download-openblas
>> --download-openblas-make-options="'USE_THREAD=0 USE_LOCKING=1 USE_OPENMP=0'" --download-p4est --download-parmmg --download-pnetcdf --download-pragmatic --download-ptscotch --download-scalapack --download-slepc --download-suitesparse --download-superlu_dist --download-tetgen --download-tri
>> angle --with-c2html=0 --with-debugging=1 --with-fortran-bindings=0 --with-shared-libraries=1 --with-x=0 --with-zlib --download-openmpi=https://urldefense.us/v3/__https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.3rc1.tar.bz2__;!!G_uCfscf7eWS!aCLPUhLfLFG5UwNlUWgGGhXZlw905gJwDd
>>AryIrltDIXJcdmOP6Is44FzBVrY5ndwzmIqMhI515mnNjTuHoR-tzq$ --download-pastix=https://urldefense.us/v3/__https://web.cels.anl.gov/projects/petsc/download/externalpackages/pastix_5.2.3-p1.tar.bz2__;!!G_uCfscf7eWS!aCLPUhLfLFG5UwNlUWgGGhXZlw905gJwDdAryIrltDIXJcdmOP6Is44FzBVrY5ndwzmIqMhI515mnNjTuA
>>fJ49xl$ && make && make check
>> 
>> There's an error encountered during configuration with the above options:
>> ```
>> TESTING: FortranMPICheck from config.packages.MPI(config/BuildSystem/config/packages/MPI.py:676)
>> *********************************************************************************************
>>           UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
>> ---------------------------------------------------------------------------------------------
>>                       Fortran error! mpi_init() could not be located!
>> *********************************************************************************************
>> ```
>> Please refer to the attached file for further information.
> 
> So I'm getting:
> 
>>>>>>> 
> *** Fortran compiler
> checking whether the compiler supports GNU Fortran... yes
> checking whether gfortran accepts -g... yes
> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
> checking the name lister (/usr/bin/nm -B) interface... BSD nm
> checking whether ln -s works... yes
> checking if Fortran compiler works... yes
> checking for extra arguments to build a shared library... impossible -- -static
> checking for gfortran warnings flags... none
> checking for Fortran flag to compile .f files... none
> checking for Fortran flag to compile .f90 files... none
> checking if Fortran compilers preprocess .F90 files without additional flag... yes
> checking to see if Fortran compilers need additional linker flags... -Wl,-flat_namespace
> checking  external symbol convention... single underscore
> checking if C and Fortran are link compatible... yes
> checking to see if Fortran compiler likes the C++ exception flags... skipped (no C++ exceptions flags)
> checking to see if mpifort compiler needs additional linker flags... none
> <<<<
> 
> However you are getting:
> 
>>>>> 
> *** Fortran compiler
> checking whether the compiler supports GNU Fortran... yes
> checking whether gfortran accepts -g... yes
> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
> checking the name lister (/usr/bin/nm -B) interface... BSD nm
> checking whether ln -s works... yes
> checking if Fortran compiler works... yes
> checking for extra arguments to build a shared library... impossible -- -static
> checking for gfortran warnings flags... none
> checking for Fortran flag to compile .f files... none
> checking for Fortran flag to compile .f90 files... none
> checking if Fortran compilers preprocess .F90 files without additional flag... yes
> checking to see if Fortran compilers need additional linker flags... -Wl,-flat_namespace
> checking  external symbol convention... single underscore
> checking if C and Fortran are link compatible... yes
> checking to see if Fortran compiler likes the C++ exception flags... skipped (no C++ exceptions flags)
> checking to see if mpifort compiler needs additional linker flags... -Wl,-commons,use_dylibs
> <<<<
> 
> So gfortran [or ld from this newer xcode?] is behaving differently - and openmpi is picking up and using this broken/unsupported option - and likely triggering subsequent errors.

I noticed this in the config.log of OpenMPI:
```
configure:30230: checking to see if mpifort compiler needs additional linker flags
configure:30247: gfortran -o conftest -fPIC -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -g -O0 -fallow-argument-mismatch  -Wl,-flat_namespace -Wl,-commons,use_dylibs  conftest.f90  >&5
ld: warning: -commons use_dylibs is no longer supported, using error treatment instead
configure:30247: $? = 0
configure:30299: result: -Wl,-commons,use_dylibs
```
So, I find it odd that this flag isn't picked up on your platform, as it only checked the exit value.

Best wishes,
Zongze
> 
>>>> 
> ld: warning: -commons use_dylibs is no longer supported, using error treatment instead
> ld: common symbol '_mpi_fortran_argv_null_' from '/private/var/folders/tf/v4zjvtw12yb3tszk813gmnvw0000gn/T/petsc-xyn64q55/config.libraries/conftest.o' conflicts with definition from dylib '_mpi_fortran_argv_null_' from '/Users/zzyang/workspace/repos/petsc/arch-darwin-c-debug/lib/libmpi_usempif08.40.dylib'
> <<<
> 
> Or perhaps openmpi configure is affected by this new warning that this newer xcode spews
>>>> 
> ld: warning: duplicate -rpath '/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc' ignored
> <<<
> 
> I'm not sure what to suggest here [other than using Linux - and avoiding these hassles with MacOS :( ]..
> 
> Satish

Reply via email to