[petsc-users] [petsc-maint] PETSc with Xcode 15

Pierre Jolivet pierre.jolivet at lip6.fr
Thu Sep 21 11:49:53 CDT 2023


This is enough to bypass most of the warnings.
There is still the "ld: warning: ignoring duplicate libraries:", but I think these should be filtered (unlike the other warnings which should be fixed).

Thanks,
Pierre



diff --git a/config/BuildSystem/config/setCompilers.py b/config/BuildSystem/config/setCompilers.py
index 152272a9709..2d73fb20660 100644
--- a/config/BuildSystem/config/setCompilers.py
+++ b/config/BuildSystem/config/setCompilers.py
@@ -2316,6 +2316,6 @@ class Configure(config.base.Configure):
       if 'with-shared-ld' in self.argDB:
-        yield (self.argDB['with-shared-ld'], ['-dynamiclib -single_module', '-undefined dynamic_lookup', '-multiply_defined suppress', '-no_compact_unwind'], 'dylib')
+        yield (self.argDB['with-shared-ld'], ['-dynamiclib', '-undefined dynamic_lookup', '-no_compact_unwind'], 'dylib')
       if hasattr(self, 'CXX') and self.mainLanguage == 'Cxx':
-        yield (self.CXX, ['-dynamiclib -single_module', '-undefined dynamic_lookup', '-multiply_defined suppress', '-no_compact_unwind'], 'dylib')
-      yield (self.CC, ['-dynamiclib -single_module', '-undefined dynamic_lookup', '-multiply_defined suppress', '-no_compact_unwind'], 'dylib')
+        yield (self.CXX, ['-dynamiclib', '-undefined dynamic_lookup', '-no_compact_unwind'], 'dylib')
+      yield (self.CC, ['-dynamiclib', '-undefined dynamic_lookup', '-no_compact_unwind'], 'dylib')
     if hasattr(self, 'CXX') and self.mainLanguage == 'Cxx':
@@ -2437,3 +2437,3 @@ class Configure(config.base.Configure):
       self.pushLanguage(language)
-      for testFlag in ['-Wl,-bind_at_load','-Wl,-multiply_defined,suppress', '-Wl,-multiply_defined -Wl,suppress', '-Wl,-commons,use_dylibs', '-Wl,-search_paths_first', '-Wl,-no_compact_unwind']:
+      for testFlag in ['-Wl,-search_paths_first', '-Wl,-no_compact_unwind']:
         if self.checkLinkerFlag(testFlag):
@@ -2536,6 +2536,6 @@ class Configure(config.base.Configure):
       if 'with-dynamic-ld' in self.argDB:
-        yield (self.argDB['with-dynamic-ld'], ['-dynamiclib -single_module -undefined dynamic_lookup -multiply_defined suppress'], 'dylib')
+        yield (self.argDB['with-dynamic-ld'], ['-dynamiclib'], 'dylib')
       if hasattr(self, 'CXX') and self.mainLanguage == 'Cxx':
-        yield (self.CXX, ['-dynamiclib -single_module -undefined dynamic_lookup -multiply_defined suppress'], 'dylib')
-      yield (self.CC, ['-dynamiclib -single_module -undefined dynamic_lookup -multiply_defined suppress'], 'dylib')
+        yield (self.CXX, ['-dynamiclib'], 'dylib')
+      yield (self.CC, ['-dynamiclib'], 'dylib')
     # Shared default
diff --git a/config/PETSc/options/sharedLibraries.py b/config/PETSc/options/sharedLibraries.py
index fae390456e8..c1e7861c290 100755
--- a/config/PETSc/options/sharedLibraries.py
+++ b/config/PETSc/options/sharedLibraries.py
@@ -68,3 +68,3 @@ class Configure(config.base.Configure):
         self.addMakeMacro('SONAME_FUNCTION', '$(1).$(2).dylib')
-        self.addMakeMacro('SL_LINKER_FUNCTION', '-dynamiclib -install_name $(call SONAME_FUNCTION,$(1),$(2)) -compatibility_version $(2) -current_version $(3) -single_module -multiply_defined suppress -undefined dynamic_lookup')
+        self.addMakeMacro('SL_LINKER_FUNCTION', '-dynamiclib -install_name $(call SONAME_FUNCTION,$(1),$(2)) -compatibility_version $(2) -current_version $(3) -undefined dynamic_lookup')
       elif self.setCompilers.CC.find('win32fe') >=0:


> On 21 Sep 2023, at 6:35 PM, Barry Smith <bsmith at petsc.dev> wrote:
> 
> 
>    Where are the flags such as -multiply_defined  being added? PETSc configure is suppose to check each flag before it adds it to the list of flags it uses. So normally I would expect these flags would just not exist in the link lines etc.
> 
>> On Sep 21, 2023, at 11:02 AM, Blaise Bourdin <bourdin at mcmaster.ca> wrote:
>> 
>> FWIW, CLT 15.0 also seems to include changes to the linker, with incompatible options etc… I was able to rebuild mpich and petsc but I get many linker warnings and have not fully tested my build
>> 
>> Before CLT 15.0 update
>> SiMini:mef90-dmplex (dmplex)$ ld -v
>> @(#)PROGRAM:ld  PROJECT:ld64-857.1
>> BUILD 23:13:29 May  7 2023
>> configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
>> LTO support using: LLVM version 14.0.3, (clang-1403.0.22.14.1) (static support for 29, runtime is 29)
>> TAPI support using: Apple TAPI version 14.0.3 (tapi-1403.0.5.1)
>> 
>> vs after:
>> bblaptop:mef90-dmplex (dmplex)$ ld -v
>> @(#)PROGRAM:ld  PROJECT:dyld-1015.7
>> BUILD 18:48:48 Aug 22 2023
>> configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
>> will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em
>> LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
>> TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.0.12.3)
>> Library search paths:
>> Framework search paths:
>> 
>> 
>> bblaptop:tutorials (main)$ pwd
>> /opt/HPC/petsc-main/src/vec/vec/tutorials
>> bblaptop:tutorials (main)$ make ex1
>> mpicc -Wl,-bind_at_load -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-search_paths_first -Wl,-no_compact_unwind -Wimplicit-function-declaration -Wunused -Wuninitialized -fPIC -g3 -O0  -I/opt/HPC/petsc-main/include -I/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/include -I/opt/X11/include      ex1.c  -Wl,-rpath,/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/lib -L/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/lib -Wl,-rpath,/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/lib -L/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/lib -Wl,-rpath,/opt/X11/lib -L/opt/X11/lib -Wl,-rpath,/opt/homebrew/Cellar/mpich/4.1.2/lib -L/opt/homebrew/Cellar/mpich/4.1.2/lib -Wl,-rpath,/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin22/13 -L/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin22/13 -Wl,-rpath,/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc -L/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc -Wl,-rpath,/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current -L/opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current -lpetsc -lHYPRE -ldmumps -lmumps_common -lpord -lpthread -lscalapack -lsuperlu -lml -llapack -lblas -lparmetis -lmetis -lexoIIv2for32 -lexodus -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -lchaco -ltriangle -lz -lctetgen -lX11 -lmpifort -lmpi -lpmpi -lgfortran -lemutls_w -lquadmath -lc++ -o ex1
>> ld: warning: -multiply_defined is obsolete
>> ld: warning: -multiply_defined is obsolete
>> ld: warning: duplicate -rpath '/opt/HPC/petsc-main/ventura-gcc13.2-arm64-g/lib' ignored
>> ld: warning: -bind_at_load is deprecated on macOS
>> ld: warning: ignoring duplicate libraries: '-lmpi', '-lpmpi'
>> 
>> 
>> 
>> That’s quite a curveball a week ahead of a major software update.
>> 
>> Blaise
>> 
>>> On Sep 20, 2023, at 10:43 PM, Ju Liu <liujuy at gmail.com> wrote:
>>> 
>>> Caution: External email.
>>> 
>>> Hi PETSc team:
>>> 
>>> I recently got my Xcode command line tools upgraded to version 15. When installing PETSc, the configure command returns an error. My configure command is 
>>> 
>>> ./configure --with-cc=gcc --with-fc=0 --with-cxx=0 --download-f2cblaslapack --download-mpich
>>> 
>>> and the message is "Cannot locate all the standard C header files needed by PETSc".
>>> 
>>> The configure.log file is attached.
>>> 
>>> How shall I fix this? 
>>> 
>>> Thanks,
>>> 
>>> Ju
>>> <configure.log>
>> 
>>>> Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)
>> Professor, Department of Mathematics & Statistics
>> Hamilton Hall room 409A, McMaster University
>> 1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada 
>> https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230921/4974275b/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230921/4974275b/attachment-0001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230921/4974275b/attachment-0003.html>


More information about the petsc-users mailing list