Opened 8 months ago

Closed 4 months ago

#68346 closed defect (fixed)

mpich-default embeds -commons into the mpicc-mpich-mp driver script, causing builds with Xcode 15's linker to fail

Reported by: murrayE Owned by: eborisch (Eric A. Borisch)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: sonoma arm64 Cc: catap (Kirill A. Korinsky), cjones051073 (Chris Jones), mascguy (Christopher Nielsen), Dave-Allured (Dave Allured), ebothmann
Port: mpich-default scotch mumps

Description

This configure failure is after I added to my ~/.profile the settings

export MACOSX_DEPLOYMENT_TARGET=12
export OTHER_LDFLAGS=-Wl,-ld_classic

From main.log:

:info:configure -- The C compiler identification is AppleClang 15.0.0.15000040
:info:configure -- The CXX compiler identification is AppleClang 15.0.0.15000040
:info:configure -- Detecting C compiler ABI info
:info:configure -- Detecting C compiler ABI info - failed
:info:configure -- Check for working C compiler: /opt/local/bin/mpicc-mpich-mp
:info:configure -- Check for working C compiler: /opt/local/bin/mpicc-mpich-mp - broken
:info:configure CMake Error at /opt/local/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
:info:configure   The C compiler
:info:configure     "/opt/local/bin/mpicc-mpich-mp"
:info:configure   is not able to compile a simple test program.
:info:configure   It fails with the following output:
:info:configure     Change Dir: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_scotch/scotch/work/build/CMakeFiles/CMakeTmp
:info:configure     
:info:configure     Run Build Command(s):/usr/bin/make -f Makefile cmTC_a7ec0/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_a7ec0.dir/build.make CMakeFiles/cmTC_a7ec0.dir/build
:info:configure     Building C object CMakeFiles/cmTC_a7ec0.dir/testCCompiler.c.o
:info:configure     /opt/local/bin/mpicc-mpich-mp   -pipe -Os -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -MD -MT CMakeFiles/cmTC_a7ec0.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_a7ec0.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_a7ec0.dir/testCCompiler.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_scotch/scotch/work/build/CMakeFiles/CMakeTmp/testCCompiler.c
:info:configure     Linking C executable cmTC_a7ec0
:info:configure     /opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a7ec0.dir/link.txt --verbose=1
:info:configure     /opt/local/bin/mpicc-mpich-mp -pipe -Os -DNDEBUG -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64  CMakeFiles/cmTC_a7ec0.dir/testCCompiler.c.o -o cmTC_a7ec0 
:info:configure     ld: unknown options: -commons 
:info:configure     clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:configure     make[1]: *** [cmTC_a7ec0] Error 1

Attachments (2)

scotch_main.log (109.5 KB) - added by murrayE 8 months ago.
main.log
mpich-4.1.1-config.log (563.0 KB) - added by murrayE 8 months ago.
mpich-4.1.1/config..og

Download all attachments as: .zip

Change History (29)

Changed 8 months ago by murrayE

Attachment: scotch_main.log added

main.log

comment:1 Changed 8 months ago by cjones051073 (Chris Jones)

As I mentioned in the email list, personal settings in your profile will never affect macports builds, as these (intentionally) do not run in your user environment but under the clean macports user environment. We really do not want port builds randomly picking up settings the user happens to have in their profile.

Instead, the port will need updating to use the classic ld option explicitly.

Last edited 8 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:2 Changed 8 months ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:3 Changed 8 months ago by cjones051073 (Chris Jones)

Keywords: sonoma added; build failure removed

comment:4 Changed 8 months ago by cjones051073 (Chris Jones)

Murray, b.t.w. Build and failure are not useful keywords, so please refrain from adding them.

comment:5 Changed 8 months ago by murrayE

Keywords: arm64 added

comment:6 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: catap eborisch mascguy added; kirill@… removed
Summary: scotch-7.0.4_0+mpich.darwin_23.arm64 configure failsscotch @7.0.4_0+mpich: ld: unknown options: -commons

Maybe this is a problem with mpich?

comment:7 Changed 8 months ago by murrayE

For what it's worth: mpich installed OK with dependency mpich-default + gcc13 also installed OK.

comment:8 Changed 8 months ago by eborisch (Eric A. Borisch)

Try re-installing mpich-default (uninstall & reinstall mpich-default which will then re-configure & build) after Xcode 15 installation. (mpich-default doesn't use buildbot packages, although the buildbot is still on Xcode 14 so it won't help currently anyway.)

The issue is ld from Xcode 15 rejecting -Wl,-commons,use_dylibs. The configure script for mpich correctly detects this when Xcode 15's ld is used, but if you configure/install mpich under Xcode 14, and then upgrade Xcode, the compiler scripts (mpicc, mpicxx, etc.) will still have the offending switch.

See also: https://github.com/pmodels/mpich/issues/6684

comment:9 in reply to:  8 Changed 8 months ago by murrayE

Replying to eborisch:

Try re-installing mpich-default (uninstall & reinstall mpich-default which will then re-configure & build) after Xcode 15 installation. (mpich-default doesn't use buildbot packages, although the buildbot is still on Xcode 14 so it won't help currently anyway.)

The issue is ld from Xcode 15 rejecting -Wl,-commons,use_dylibs. The configure script for mpich correctly detects this when Xcode 15's ld is used, but if you configure/install mpich under Xcode 14, and then upgrade Xcode, the compiler scripts (mpicc, mpicxx, etc.) will still have the offending switch.

See also: https://github.com/pmodels/mpich/issues/6684

I DID install mpich and mpich-default using Xcode 15. (This was part of reinstalling all the ports I had after upgrading macOS to Sonoma and Xcode to version 15, and reinstalling MacPorts with the Sonoma version.

comment:10 Changed 8 months ago by eborisch (Eric A. Borisch)

What does ld -v return?

Can you run sudo port configure mpich-default and attach the resulting file located at $(port work mpich-default)/mpich-4.1.1/config.log

I'm not on Sonoma, so perhaps there is yet another issue creeping in.

Changed 8 months ago by murrayE

Attachment: mpich-4.1.1-config.log added

mpich-4.1.1/config..og

comment:11 in reply to:  10 Changed 8 months ago by murrayE

Replying to eborisch:

What does ld -v return?

Can you run sudo port configure mpich-default and attach the resulting file located at $(port work mpich-default)/mpich-4.1.1/config.log

I'm not on Sonoma, so perhaps there is yet another issue creeping in.

Requested configure log for mpich-default +gcc13 is attached is attached.

Output from 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:

comment:12 Changed 8 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:13 Changed 7 months ago by davejkeith

Hi, I was wondering if there has been any progress on this issue - as I also have had the same issue:

Error: Failed to configure scotch: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_scotch/scotch/work/build/CMakeFiles/CMakeError.log
Error: Failed to configure scotch: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_scotch/scotch/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port scotch failed
Last edited 4 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:14 Changed 7 months ago by kencu (Ken)

The flag is coming in from another port, as above, mpich-default, in this exact file:

/opt/local/bin/mpicc-mpich-mp

here:

final_ldflags=" -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -Wl,-commons,use_dylibs"

There is some kind of configuration problem with mpich -- I built it on Sonoma with Xcode 15 and it still had this flag embedded, even though the linker rejects it.

Someone will sort that out, but for now you can just remove that flag from the ascii textfile driver, changing that line to this:

final_ldflags=" -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk"

and all is well:

% port -v installed scotch
The following ports are currently installed:
  scotch @7.0.4_0+mpich (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-14T14:03:33-0700'

comment:15 Changed 7 months ago by kencu (Ken)

Port: mpich-default added
Summary: scotch @7.0.4_0+mpich: ld: unknown options: -commonsmpich-default embeds -commons into the mpicc-mpich-mp driver script, causing builds with Xcode 15's linker to fail

comment:16 in reply to:  14 Changed 7 months ago by murrayE

Replying to kencu:

The flag is coming in from another port, as above, mpich-default, in this exact file:

/opt/local/bin/mpicc-mpich-mp

here:

final_ldflags=" -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -Wl,-commons,use_dylibs"

There is some kind of configuration problem with mpich -- I built it on Sonoma with Xcode 15 and it still had this flag embedded, even though the linker rejects it.

Someone will sort that out, but for now you can just remove that flag from the ascii textfile driver, changing that line to this:

final_ldflags=" -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk"

and all is well:

% port -v installed scotch
The following ports are currently installed:
  scotch @7.0.4_0+mpich (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-14T14:03:33-0700'

How does an innocent end-user like me take care of "remove[ing]that flag from the ascii textfile driver"?

comment:17 Changed 7 months ago by kencu (Ken)

This is what I did.

After the build of scotch failed:

sudo port clean scotch
bbedit /opt/local/bin/mpicc-mpich-mp

find the line mentioned, and delete this little bit: -Wl,-commons,use_dylibs

save /opt/local/bin/mpicc-mpich-mp

then

sudo port -v install scotch

and come back in 5 five minutes, and it's installed.

Now somebody will properly fix mpich-default soon enough, but it won't be me... and this gets you in business while you're waiting.

comment:18 in reply to:  17 Changed 7 months ago by catap (Kirill A. Korinsky)

Replying to kencu:

Now somebody will properly fix mpich-default soon enough, but it won't be me... and this gets you in business while you're waiting.

It can be me, but I haven't got macOS 14 because I'm blocking by https://gpgtools.com/sonoma :)

comment:20 Changed 7 months ago by barracuda156

Also #68296

comment:21 Changed 6 months ago by ebothmann

Cc: ebothmann added

comment:22 Changed 6 months ago by kencu (Ken)

Port: mumps added

comment:23 Changed 6 months ago by kencu (Ken)

has duplicate for yet another MPICH port, mumps #68691

comment:24 Changed 6 months ago by kencu (Ken)

the question to be answered is whether removing "-commons" is going to actually break any ports that are actually using that functionality.

probably only the upstreams are going to know for sure, I would think.

comment:25 Changed 4 months ago by kencu (Ken)

has duplicate #69070

comment:26 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: eborisch removed
Owner: set to eborisch
Status: newassigned

Has duplicate #69223.

Assigning to port maintainer.

comment:27 Changed 4 months ago by Eric A. Borisch <eborisch@…>

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.