Opened 10 months ago

Last modified 10 months ago

#61692 assigned defect

gromacs: clang: error: invalid version number in '-mmacosx-version-min=11.0'

Reported by: btywoniuk (Bart) Owned by: dstrubbe (David Strubbe)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc:
Port: gromacs gromacs-plumed

Description

When installing gromacs I'm getting:

:info:configure     /opt/local/bin/clang-mp-5.0   -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk  -arch x86_64 -o CMakeFiles/cmTC_da04d.dir/testCCompiler.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_gromacs/gromacs/work/gromacs-2019.2/CMakeFiles/CMakeTmp/testCCompiler.c
:info:configure     clang: error: invalid version number in '-mmacosx-version-min=11.0'
:info:configure     make[1]: *** [CMakeFiles/cmTC_da04d.dir/testCCompiler.c.o] Error 1
:info:configure     make: *** [cmTC_da04d/fast] Error 2

and:

Warning: -----------------------------------------------------------------------
Warning: The port 'gromacs' uses the cxx11 PortGroup which is deprecated.
Warning: Please instead specify the required c++ standard directly using
Warning:     compiler.cxx_standard  2011
Warning: replacing 2011 with newer standards (e.g. 2014, 2017) as required.
Warning: For more details see https://trac.macports.org/wiki/CompilerSelection
Warning: -----------------------------------------------------------------------

Change History (1)

comment:1 Changed 10 months ago by ryandesign (Ryan Schmidt)

Cc: dstrubbe removed
Keywords: bigsur added; BigSur Gromacs clang removed
Owner: set to dstrubbe
Port: gromacs; gromacs-plumedgromacs gromacs-plumed
Status: newassigned
Summary: clang invalid version numbergromacs: clang: error: invalid version number in '-mmacosx-version-min=11.0'

The two messages are probably related. The deprecated cxx11 1.1 portgroup whitelists a number of C++11-compatible compilers, starting with clang 5.0. Whitelisting compatible compilers is not recommended; we recommend blacklisting incompatible compilers instead. MacPorts will choose the first whitelisted compiler that is not blacklisted, so even though newer clang versions are also whitelisted, MacPorts will pick clang 5.0 because it is the first in the list, even though it is too old for macOS 11.

Usually one would replace the PortGroup cxx11 1.1 line with compiler.cxx_standard 2011 (or whatever version the software requires) but I am also concerned by these nearby lines:

# this line is needed to allow use of gcc
configure.cxx_stdlib   libstdc++

We usually don't want to force the use of libstdc++ nor do we usually want ports to use gcc/g++. The entire codepath that whitelists clang 5.0 is only entered when libstdc++ is used; it was expected that this would only occur on very old versions of Mac OS X where clang 5.0 would be comparatively new and would work fine. The port subverts that assumption by forcing the use of libstdc++.

Note: See TracTickets for help on using tickets.