Open hmenke opened 2 months ago
I'm using an M1 Mac and encountered the following issues when installing TRIQS:
The following tests FAILED:
30 - h5_file (SIGTRAP)
31 - h5_group (SIGTRAP)
42 - Py_archive (SIGTRAP)
58 - nda_bound_check (SIGTRAP)
91 - nda_str_indices (SIGTRAP)
106 - imtime_ops (SIGTRAP)
113 - atom_diag_h5 (SIGTRAP)
141 - fourier_matsubara (SIGTRAP)
145 - g_tau_mul (SIGTRAP)
149 - gf_density (SIGTRAP)
200 - different_moves_mc_np2 (Failed)
202 - different_moves_mc_np3 (Failed)
203 - different_moves_mc_np4 (Failed)
206 - extractors_test (SIGTRAP)
213 - histograms2 (SIGTRAP)
235 - real_or_complex (SIGTRAP)
267 - py_bug_tight_binding (SIGTRAP)
LDFLAGS=-ld_classic cmake ...
solves the problem too.
A similar thing goes for triqs_nevalinna and LDFLAGS=-ld_classic cmake ...
also solves the problem.
I can reproduce the issue on my Mac with an M2 chip if I do the exports as suggested in Step 7 in the docs. It seems to be an issue of the Xcode version, since they introduced a new linker with Xcode 15 (see here).
I don't really understand what the problem is but the following works for me (assuming the exports in Step 7 have been done):
Use the old linker, i.e.
export LDFLAGS=-ld_classic
cmake ...
Use the default (new) linker but unset LIBRARY_PATH
, i.e.
unset LIBRARY_PATH
cmake ...
Use the default (new) linker together with llvm's libc++
, i.e.
export LDFLAGS="-L$(brew --prefix)/opt/llvm/lib/c++ -Wl,-rpath,$(brew --prefix)/opt/llvm/lib/c++"
cmake ...
-ld_classic
will be deprecated and removed in future Xcode versions (see here). Maybe we should advertise the third option?
Prerequisites
Description
Tests that use
EXPECT_THROW
fail on macOS with Apple Silicon M3. Uponcatch
the tests segfault (aka bus error on macOS) somewhere in libunwind when encountering theautib
instruction.Steps to Reproduce
ctest -R '^gf_density$'
Expected behavior: No bus error.
Actual behavior: bus error
Versions
https://github.com/TRIQS/triqs/commit/706967b6fba80df7f69fb7a2c397d9fd73598abb
Formatting
Please use markdown in your issue message. A useful summary of commands can be found here.
Additional Information
As a workaround one can configure TRIQS with
As to why that works I have no idea.
@michimeix