Opened 8 months ago

Closed 6 months ago

Last modified 6 months ago

#68225 closed defect (fixed)

OpenBLAS @0.3.24_0: hanging when building

Reported by: kickingvegas (Charles Choi) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: ventura arm64 Cc: michaelld (Michael Dickens), catap (Kirill A. Korinsky), astroboylrx (Rixin Li), cjones051073 (Chris Jones), klausness, michaellass (Michael Lass), dsavransky (Dmitry Savransky), Dave-Allured (Dave Allured)
Port: OpenBLAS

Description

Trying to update OpenBLAS, hangs when building

OpenBLAS 0.3.23_0 < 0.3.24_0

--->  Computing dependencies for OpenBLAS
--->  Building OpenBLAS
      [ •   •   •   •   •   •   •   •   •   •   •   •  ]^C
uname -a
Darwin bingsu.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64 arm Darwin

Attachments (3)

OpenBLAS_main.log (5.5 MB) - added by michaellass (Michael Lass) 8 months ago.
Build log which shows a segfault while running tests
openblas-upgrade.log (124.1 KB) - added by kickingvegas (Charles Choi) 8 months ago.
OpenBLAS build log from Charles Choi
test.cpp (3.8 KB) - added by cjones051073 (Chris Jones) 8 months ago.

Change History (37)

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

Cc: michaelld catap added
Keywords: ventura arm64 added
Owner: set to NicosPavlov
Status: newassigned
Summary: OpenBLAS hanging when buildingOpenBLAS @0.3.24_0: hanging when building

How long did you wait? Was the [ • • • • • • • • • • • • ] indicator moving or still? Maybe it was just taking awhile to build.

According to our build logs, building this port on x86_64 could take tens of minutes but on arm64 it should only take a few minutes.

Try cleaning (sudo port clean OpenBLAS) and then try again with the debug flag (sudo port -d upgrade OpenBLAS), that way you can see what it's doing. If it really does hang at some point, show us the last things it printed.

comment:2 Changed 8 months ago by michaellass (Michael Lass)

I think I am facing the same issue. The root cause is a segfault that occurs during the tests:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGTRAP: Trace/breakpoint trap.

Backtrace for this error:

Unfortunately, the build just hangs at this point and no backtrace is ever printed.

I will attach my full build log - it ends with a SIGINT triggered by pressing Ctrl+C.

Changed 8 months ago by michaellass (Michael Lass)

Attachment: OpenBLAS_main.log added

Build log which shows a segfault while running tests

comment:3 Changed 8 months ago by kickingvegas (Charles Choi)

Can re-confirm @michaellass observation. Get the same message:

OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./cblat2 < ./cblat2.dat

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGTRAP: Trace/breakpoint trap.

Backtrace for this error:
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./zblat2 < ./zblat2.dat

Changed 8 months ago by kickingvegas (Charles Choi)

Attachment: openblas-upgrade.log added

OpenBLAS build log from Charles Choi

comment:4 Changed 8 months ago by catap (Kirill A. Korinsky)

Michael, Charles, may you report it upstream? We haven't make anything wire or special at portfile and the issue should be handled in upstream.

comment:5 Changed 8 months ago by kickingvegas (Charles Choi)

@catap - reported upstream to OpenBLAS https://github.com/OpenMathLib/OpenBLAS/issues/4239

comment:6 Changed 8 months ago by astroboylrx (Rixin Li)

Cc: astroboylrx added

comment:7 Changed 8 months ago by michaellass (Michael Lass)

Right now, it looks like the segfault issue affects macports-clang versions 13, 14 and 15 and at least the Apple clang that comes with XCode 15.0. Additionally, compilation with mp-clang 17 fails due to missing headers and building the macports port with mp-clang 16 fails with linking errors.

So a crude workaround right now is the following change of the Portfile:

--- a/math/OpenBLAS/Portfile
+++ b/math/OpenBLAS/Portfile
@@ -70,6 +70,8 @@ if {[string first "-devel" $subport] > 0} {
     }
 }
 
+configure.compiler  macports-clang-12
+
 compilers.choose    fc
 
 compilers.setup     default_fortran

comment:8 Changed 8 months ago by catap (Kirill A. Korinsky)

Here a PR to blacklist unsupported clang: https://github.com/macports/macports-ports/pull/20595

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

Kirill - I think there is more going on here than just issues specific to OpenBLAS, and as such I am not convinced just blacklisting compilers as you propose is the real fix here.

I have been seeing very similar hang ups myself, that seemed to coincide with the Xcode update to 15 that I recently picked up on my MacOS 13 arm64 machine.

For instance, I am seeing ports like libcifpp just hang up during configure, when using certain clang compilers.

Larissa ~/Projects/MacPorts/ports > sudo port -v configure libcifpp configure.compiler=macports-clang-17
--->  Computing dependencies for libcifpp.
--->  Fetching distfiles for libcifpp
--->  Verifying checksums for libcifpp
--->  Checksumming libcifpp-5.1.2.tar.gz
--->  Extracting libcifpp
--->  Extracting libcifpp-5.1.2.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/libcifpp/libcifpp-5.1.2.tar.gz' | /usr/bin/tar -xf - 
--->  Configuring libcifpp
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -DCIFPP_INSTALL_UPDATE_SCRIPT=OFF -DCIFPP_DOWNLOAD_CCD=ON -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="13.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk" /opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2 
-- The CXX compiler identification is Clang 17.0.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/clang++-mp-17 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Not trying to recreate symop_table_data.hpp since CCP4 is not defined
-- Performing Test GXX_LIBSTDCPP
-- Performing Test GXX_LIBSTDCPP - Failed
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3.#define ZLIB_VERSION "1.3"") 
-- Found Eigen3: /opt/local/include/eigen3 (Required is at least version "2.91.0") 
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Looking for C++ include atomic
-- Looking for C++ include atomic - found
-- Performing Test _CXX_ATOMIC_BUILTIN
-- Performing Test _CXX_ATOMIC_BUILTIN - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
<hangup>

I don't really believe the issue here is the compiler's themselves (which is why I am not convinced with your blacklisting PR above) as the issue is affecting clang versions and ports that have previously worked just fine, for years in some cases.

I really do suspect more the Xcode update here so before we go making changes like the above I would first like to see if anyone can reproduce the issues on machines running older OSes (and Intel machines) that are using Xcode 14 or older. I personally only have access to a new machine running macOS13(arm64) these days, so cannot do this myself (as I cannot run an y longer my collection of older OS VMs). So we need to hear from others who can do this check.

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

Cc: cjones051073 added

comment:11 Changed 8 months ago by catap (Kirill A. Korinsky)

Chris, I'm using as everyday's machine intel on macOS 12 with xcode 14 => I may try it. But when I've updated that ports a few week ago... I haven't noticed a thing.

But let me try to use MacPorts clangs

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

The issue is extremely strange... It doesn't (for me at least) seem to be repeatable.

For one, I also can get it using the Apple clang versions, so its not specific to the macports build.

Second, I can run a configure once, and it will work

Larissa ~/Projects/MacPorts/ports > sudo port -v configure libcifpp
--->  Computing dependencies for libcifpp.
--->  Configuring libcifpp
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -DCIFPP_INSTALL_UPDATE_SCRIPT=OFF -DCIFPP_DOWNLOAD_CCD=ON -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="13.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk" /opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2 
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Not trying to recreate symop_table_data.hpp since CCP4 is not defined
-- Performing Test GXX_LIBSTDCPP
-- Performing Test GXX_LIBSTDCPP - Failed
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3.#define ZLIB_VERSION "1.3"") 
-- Found Eigen3: /opt/local/include/eigen3 (Required is at least version "2.91.0") 
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Looking for C++ include atomic
-- Looking for C++ include atomic - found
-- Performing Test _CXX_ATOMIC_BUILTIN
-- Performing Test _CXX_ATOMIC_BUILTIN - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_C_COMPILER
    CMAKE_OBJCXX_COMPILER
    CMAKE_OBJC_COMPILER
    CMAKE_POLICY_DEFAULT_CMP0025
    CMAKE_POLICY_DEFAULT_CMP0060


-- Build files have been written to: /opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/build

Good. However, if I clean the port and run the exact same thing again it hangs up

Larissa ~/Projects/MacPorts/ports > sudo port -v configure libcifpp
--->  Computing dependencies for libcifpp.
--->  Fetching distfiles for libcifpp
--->  Verifying checksums for libcifpp
--->  Checksumming libcifpp-5.1.2.tar.gz
--->  Extracting libcifpp
--->  Extracting libcifpp-5.1.2.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/libcifpp/libcifpp-5.1.2.tar.gz' | /usr/bin/tar -xf - 
--->  Configuring libcifpp
Executing:  cd "/opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -DCIFPP_INSTALL_UPDATE_SCRIPT=OFF -DCIFPP_DOWNLOAD_CCD=ON -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="13.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk" /opt/local/var/macports/build/_Users_chris_Projects_MacPorts_ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2 
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Not trying to recreate symop_table_data.hpp since CCP4 is not defined
-- Performing Test GXX_LIBSTDCPP
-- Performing Test GXX_LIBSTDCPP - Failed
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3.#define ZLIB_VERSION "1.3"") 
-- Found Eigen3: /opt/local/include/eigen3 (Required is at least version "2.91.0") 
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Looking for C++ include atomic
-- Looking for C++ include atomic - found
-- Performing Test _CXX_ATOMIC_BUILTIN
-- Performing Test _CXX_ATOMIC_BUILTIN - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
<hangup>

I'm am struggling to understand what's going on here...

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

OK, so I have switched to testing with another port (xrootd) that I happen to know doesn't use anything built with gcc. With that port, I do not get any issues with configure etc. I have tried numerous times in a row, with various clang versions (both system and macports) and no problems.

libcifpp uses eigen3, which was built in part with gcc.

So I suspect what is the issue here is Xcode 15 changed the default linker to something new which currently has issues with anything built with GCC. See the recent mails to the user list

https://lists.macports.org/pipermail/macports-users/2023-September/052224.html

Switching to use the 'classic' link option seems to help, but getting ports to do this isn't trivial in some cases. In theory

configure.ldflags-append -Wl,-ld_classic

should do it, but that doesn't always find its way to everywhere that needs it. In particular tests that are run during configure usually don't respect settings this way...

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

comment:14 Changed 8 months ago by catap (Kirill A. Korinsky)

Chris, I able to reproduce it on libcifpp port with enforcing macports-clang-16:

--->  Extracting libcifpp-5.1.2.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/libcifpp/libcifpp-5.1.2.tar.gz' | /usr/bin/tar -xf - 
--->  Configuring libcifpp
        (using ccache)
Executing:  cd "/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_Fortran_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_ISPC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -DCIFPP_INSTALL_UPDATE_SCRIPT=OFF -DCIFPP_DOWNLOAD_CCD=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="12.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk" /opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2 
-- The CXX compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/clang++-mp-16 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Not trying to recreate symop_table_data.hpp since CCP4 is not defined
-- Performing Test GXX_LIBSTDCPP
-- Performing Test GXX_LIBSTDCPP - Failed
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3.#define ZLIB_VERSION "1.3"") 
-- Found Eigen3: /opt/local/include/eigen3 (Required is at least version "2.91.0") 
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Looking for C++ include atomic
-- Looking for C++ include atomic - found
-- Performing Test _CXX_ATOMIC_BUILTIN
-- Performing Test _CXX_ATOMIC_BUILTIN - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success


I'm using:

macOS 12.6.8 21G725 x86_64
Xcode 14.2 14C18

=> it isn't arm64 specified

Last edited 8 months ago by catap (Kirill A. Korinsky) (previous) (diff)

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

Hmmm. I didn't think it was arm64 specific, but I was hoping it was due to Xcode 15....

Changed 8 months ago by cjones051073 (Chris Jones)

Attachment: test.cpp added

comment:16 Changed 8 months ago by catap (Kirill A. Korinsky)

Chris, I've added --trace to cmake options and it reveals that it's doing:

/opt/local/share/cmake-3.24/Modules/GenerateExportHeader.cmake(398):  if(_GEH_CUSTOM_CONTENT_FROM_VARIABLE )
/opt/local/share/cmake-3.24/Modules/GenerateExportHeader.cmake(406):  configure_file(${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in ${EXPORT_FILE_NAME} @ONLY )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(278):  if(BOOST_REGEX )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(283):  if(MSVC )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(287):  set_target_properties(cifpp PROPERTIES POSITION_INDEPENDENT_CODE ON )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(289):  target_include_directories(cifpp PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include;${PROJECT_BINARY_DIR};${EIGEN3_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(295):  target_link_libraries(cifpp PUBLIC Threads::Threads ZLIB::ZLIB Eigen3::Eigen ${CIFPP_REQUIRED_LIBRARIES} )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(297):  if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(301):  if(CIFPP_DOWNLOAD_CCD )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(303):  set(COMPONENTS_CIF ${PROJECT_SOURCE_DIR}/data/components.cif )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(305):  if(NOT EXISTS ${COMPONENTS_CIF} )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(306):  if(NOT EXISTS ${PROJECT_SOURCE_DIR}/data )
/opt/local/var/macports/build/_Users_catap_src_macports-ports_science_libcifpp/libcifpp/work/libcifpp-5.1.2/CMakeLists.txt(310):  file(DOWNLOAD https://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif ${COMPONENTS_CIF} SHOW_PROGRESS )

=> it is downloading from ftp.wwpdb.org to which I can't connect rigth now.

Last edited 8 months ago by catap (Kirill A. Korinsky) (previous) (diff)

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

Kirill - What do you get if you use macports clang 12 with the above - I was not able to get a hangup with that ??

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

Kirill Would you mind running a few tests with the text c++ file I just attached here. i.e.

Larissa ~/cernbox/MacPorts/c++17 > g++-mp-12 -std=c++17 ./test.cpp
-macosx_version_min has been renamed to -macos_version_min
ld: warning: ignoring duplicate libraries: '-lgcc'
0  0x102187648  __assert_rtn + 72
1  0x1020bbfac  ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204
2  0x1020d1924  ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164
3  0x1020dee30  ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420
4  0x18a868440  _dispatch_client_callout2 + 20
5  0x18a87bf1c  _dispatch_apply_invoke + 224
6  0x18a868400  _dispatch_client_callout + 20
7  0x18a879fb8  _dispatch_root_queue_drain + 684
8  0x18a87a6c0  _dispatch_worker_thread2 + 164
9  0x18aa14038  _pthread_wqthread + 228
ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
collect2: error: ld returned 1 exit status

Until Xcode 15 came along that test worked fine with gcc12.

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

comment:19 Changed 8 months ago by catap (Kirill A. Korinsky)

Chris, it works:

√ /tmp % g++-mp-12 -v -std=c++17 ./test.cpp
Using built-in specs.
COLLECT_GCC=g++-mp-12
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin21/12.3.0/lto-wrapper
Target: x86_64-apple-darwin21
Configured with: /opt/local/var/macports/build/_Users_catap_src_macports-ports_lang_gcc12/gcc12/work/gcc-12.3.0/configure --prefix=/opt/local --build=x86_64-apple-darwin21 --enable-languages=c,c++,objc,obj-c++,lto,fortran,jit --libdir=/opt/local/lib/gcc12 --includedir=/opt/local/include/gcc12 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-12 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-12 --with-gxx-include-dir=/opt/local/include/gcc12/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --with-zstd=/opt/local --enable-checking=release --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --with-darwin-extra-rpath=/opt/local/lib/libgcc --with-libiconv-prefix=/opt/local --disable-tls --with-gxx-libcxx-include-dir=/opt/local/libexec/gcc12/libc++/include/c++/v1 --with-pkgversion='MacPorts gcc12 12.3.0_0+stdlib_flag' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.3.0 (MacPorts gcc12 12.3.0_0+stdlib_flag) 
COLLECT_GCC_OPTIONS='-v' '-std=c++17' '-mmacosx-version-min=12.0.0' '-asm_macosx_version_min=12.0' '-nodefaultexport' '-shared-libgcc' '-mtune=core2' '-dumpdir' 'a-'
 /opt/local/libexec/gcc/x86_64-apple-darwin21/12.3.0/cc1plus -quiet -v -D__DYNAMIC__ ./test.cpp -fPIC -quiet -dumpdir a- -dumpbase test.cpp -dumpbase-ext .cpp -mmacosx-version-min=12.0.0 -mtune=core2 -std=c++17 -version -o /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccm4SMYJ.s
GNU C++17 (MacPorts gcc12 12.3.0_0+stdlib_flag) version 12.3.0 (x86_64-apple-darwin21)
	compiled by GNU C version 12.3.0, GMP version 6.2.1, MPFR version 4.2.0, MPC version 1.3.1, isl version isl-0.24-GMP

warning: MPFR header version 4.2.0 differs from library version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/opt/local/include"
ignoring nonexistent directory "/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/../../../../../x86_64-apple-darwin21/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /opt/local/include/gcc12/c++/
 /opt/local/include/gcc12/c++//x86_64-apple-darwin21
 /opt/local/include/gcc12/c++//backward
 /opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/include
 /opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/include-fixed
 /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks
End of search list.
GNU C++17 (MacPorts gcc12 12.3.0_0+stdlib_flag) version 12.3.0 (x86_64-apple-darwin21)
	compiled by GNU C version 12.3.0, GMP version 6.2.1, MPFR version 4.2.0, MPC version 1.3.1, isl version isl-0.24-GMP

warning: MPFR header version 4.2.0 differs from library version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b8f5fa9075c8a60580601554aa96f557
COLLECT_GCC_OPTIONS='-v' '-std=c++17' '-mmacosx-version-min=12.0.0'  '-nodefaultexport' '-shared-libgcc' '-mtune=core2' '-dumpdir' 'a-'
 /opt/local/bin/as -arch x86_64 -v -mmacosx-version-min=12.0 -mllvm -x86-pad-for-align=false -force_cpusubtype_ALL -o /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccoIJfHr.o /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccm4SMYJ.s
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx12.0.0 -filetype obj -main-file-name ccm4SMYJ.s -target-cpu penryn -fdebug-compilation-dir=/tmp -dwarf-debug-producer "Apple clang version 14.0.0 (clang-1400.0.29.202)" -dwarf-version=4 -mrelocation-model pic --mrelax-relocations -mllvm -x86-pad-for-align=false -mllvm -disable-aligned-alloc-awareness=1 -o /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccoIJfHr.o /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccm4SMYJ.s
COMPILER_PATH=/opt/local/libexec/gcc/x86_64-apple-darwin21/12.3.0/:/opt/local/libexec/gcc/x86_64-apple-darwin21/12.3.0/:/opt/local/libexec/gcc/x86_64-apple-darwin21/:/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/:/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/
LIBRARY_PATH=/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/:/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/../../../
COLLECT_GCC_OPTIONS='-v' '-std=c++17' '-mmacosx-version-min=12.0.0'  '-nodefaultexport' '-shared-libgcc' '-mtune=core2' '-dumpdir' 'a.'
 /opt/local/libexec/gcc/x86_64-apple-darwin21/12.3.0/collect2 -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/ -dynamic -arch x86_64 -macosx_version_min 12.0.0 -o a.out -L/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0 -L/opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0/../../.. /var/folders/rq/wqy42lq543z9rwrlj7vf1h4r0000gn/T//ccoIJfHr.o -lstdc++ -lgcc_s.1.1 -lgcc -lSystem -no_compact_unwind -rpath /opt/local/lib/libgcc -rpath @loader_path -rpath /opt/local/lib/gcc12/gcc/x86_64-apple-darwin21/12.3.0 -rpath /opt/local/lib/gcc12
√ /tmp % 

comment:20 Changed 8 months ago by catap (Kirill A. Korinsky)

clang-16 and clang-15 also works fine

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

Ok... Then I think we probably do have two separately things going on here..

  • Xcode 15 linker issue with gcc built binaries
  • That web resource above causing a hang up due to not responding...

comment:22 in reply to:  20 Changed 8 months ago by cjones051073 (Chris Jones)

Replying to catap:

clang-16 and clang-15 also works fine

OK, then likely You don't have the linker issue - Not a surprise as that came in with Xcode 15 but do have the web resource problem.

comment:23 in reply to:  18 Changed 8 months ago by kencu (Ken)

The linker issue is a known bug, already reported to Apple as FB13038083.

current workaround is to add -ld_classic to linker flags, which forces the older linker to be used.

See:

https://developer.apple.com/forums/thread/737707

https://discussions.apple.com/thread/255137447

https://github.com/Homebrew/homebrew-core/issues/145991

https://stackoverflow.com/questions/77153800/xcode-15-c-compilation-errors/77172735

comment:24 Changed 8 months ago by klausness

Cc: klausness added

comment:25 Changed 8 months ago by michaellass (Michael Lass)

Cc: michaellass added

comment:26 Changed 8 months ago by dsavransky (Dmitry Savransky)

Cc: dsavransky added

comment:27 Changed 8 months ago by murrayE

So is there something I, as an "end user," can do to get the port command to install it? Exactly what, where, and how?

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

Your simplest fix, that would cure all issue Xcode15 has brought, would be to downgrade your Xcode back to 14.x.

comment:29 in reply to:  28 Changed 8 months ago by murrayE

Replying to cjones051073:

Your simplest fix, that would cure all issue Xcode15 has brought, would be to downgrade your Xcode back to 14.x.

Ouch!

comment:30 Changed 8 months ago by klausness

Note that in #68234 (which was also caused by the new Xcode 15 loader), it's reported that installing both Xcode 14 and 15 and using xcode-select to choose Xcode 14 does not work. Perhaps a full uninstall of Xcode 15 and reinstall of Xcode 14 would work. #68234 was fixed (or worked around) by the maintainer adding the -ld_classic flag to the port. Since this flag will be desupported eventually, it's only a temporary fix, but (as noted above) it does seem to work.

comment:31 Changed 6 months ago by klausness

Still failing for me. Hanging with dblat3 at 99.9% CPU.

Here's the end of the debug output:

rm -f ?BLAT2.SUMM
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat2 < ./sblat2.dat
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat2 < ./dblat2.dat
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./cblat2 < ./cblat2.dat
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./zblat2 < ./zblat2.dat
rm -f ?BLAT2.SUMM
OPENBLAS_NUM_THREADS=2 ./sblat2 < ./sblat2.dat
OPENBLAS_NUM_THREADS=2 ./dblat2 < ./dblat2.dat
OPENBLAS_NUM_THREADS=2 ./cblat2 < ./cblat2.dat
OPENBLAS_NUM_THREADS=2 ./zblat2 < ./zblat2.dat
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin/gfortran-mp-13 -m64 -Os -O3 -Wall -frecursive -fno-optimize-sibling-calls  -march=armv8.3-a -O3 -Wall -frecursive -fno-optimize-sibling-calls  -march=armv8.3-a -fno-tree-vectorize -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -o cblat3 cblat3.o ../libopenblas-r1.a -lpthread -lgfortran -lpthread -lgfortran 
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin/gfortran-mp-13 -m64 -Os -O3 -Wall -frecursive -fno-optimize-sibling-calls  -march=armv8.3-a -O3 -Wall -frecursive -fno-optimize-sibling-calls  -march=armv8.3-a -fno-tree-vectorize -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -o zblat3 zblat3.o ../libopenblas-r1.a -lpthread -lgfortran -lpthread -lgfortran 
ld: warning: duplicate -rpath '/opt/local/lib/libgcc' ignored
ld: warning: duplicate -rpath '/opt/local/lib/libgcc' ignored
ld: warning: ignoring duplicate libraries: '-lemutls_w', '-lgcc', '-lgfortran'
ld: warning: ignoring duplicate libraries: '-lemutls_w', '-lgcc', '-lgfortran'
rm -f ?BLAT3.SUMM
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat3 < ./dblat3.dat

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGBUS: Access to an undefined portion of a memory object.

Backtrace for this error:

comment:33 Changed 6 months ago by catap (Kirill A. Korinsky)

Resolution: fixed
Status: assignedclosed

In 8cc069f9efff2bd0bf4e616389c13a3eaa9a1d7c/macports-ports (master):

OpenBLAS: fix build with Xcode 15

OpenBLAS-devel is updated to 20231119-864c65b5, and non-devel subport
had backported patch.

Anyway, to fix all issue I was forced to switch to cmake-based build.

Closes: #68225

See: https://github.com/macports/macports-ports/pull/21452

comment:34 Changed 6 months ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added
Note: See TracTickets for help on using tickets.