Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on Mac for the Julia interface #369

Open
amontoison opened this issue Jan 13, 2025 · 16 comments
Open

Errors on Mac for the Julia interface #369

amontoison opened this issue Jan 13, 2025 · 16 comments
Assignees

Comments

@amontoison
Copy link
Member

@nimgould

libc++abi: terminating due to uncaught exception of type std::bad_alloc: std::bad_alloc

[2403] signal 6: Abort trap: 6
in expression starting at /Users/runner/work/GALAHAD/GALAHAD/GALAHAD.jl/test/test_ccqp.jl:229
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
pthread_kill at /usr/lib/system/libsystem_pthread.dylib (unknown line)
abort at /usr/lib/system/libsystem_c.dylib (unknown line)
abort_message at /usr/lib/libc++abi.dylib (unknown line)
_ZL28demangling_terminate_handlerv at /usr/lib/libc++abi.dylib (unknown line)
_ZL15_objc_terminatev at /usr/lib/libobjc.A.dylib (unknown line)
_ZSt11__terminatePFvvE at /usr/lib/libc++abi.dylib (unknown line)
_ZN10__cxxabiv1L12failed_throwEPNS_15__cxa_exceptionE at /usr/lib/libc++abi.dylib (unknown line)
__cxa_throw at /usr/lib/libc++abi.dylib (unknown line)
_Znwm at /usr/lib/libc++abi.dylib (unknown line)
_ZN5spral5ssids3cpu14NumericSubtreeILb0EfLm8388608ENS1_11AppendAllocIfEEEC1ERKNS1_15SymbolicSubtreeEPKfSA_PPvRKNS1_18cpu_factor_optionsERNS1_11ThreadStatsE at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single.dylib (unknown line)
spral_ssids_cpu_create_num_subtree_sgl at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__spral_ssids_cpu_subtree_single_64_MOD_factor at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__spral_ssids_fkeep_single_64_MOD_inner_factor_cpu._omp_fn.2 at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
GOMP_taskgroup_end at /Users/runner/hostedtoolcache/julia/1.11.2/x64/lib/julia/libgomp.1.dylib (unknown line)
__spral_ssids_fkeep_single_64_MOD_inner_factor_cpu._omp_fn.1 at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
GOMP_parallel at /Users/runner/hostedtoolcache/julia/1.11.2/x64/lib/julia/libgomp.1.dylib (unknown line)
__spral_ssids_fkeep_single_64_MOD_inner_factor_cpu._omp_fn.0 at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
GOMP_parallel at /Users/runner/hostedtoolcache/julia/1.11.2/x64/lib/julia/libgomp.1.dylib (unknown line)
__spral_ssids_fkeep_single_64_MOD_inner_factor_cpu at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__spral_ssids_single_64_MOD_ssids_factor_ptr64_single at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__galahad_sls_single_64_MOD_sls_factorize at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__galahad_fdc_single_64_MOD_fdc_find_dependent_sls at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__galahad_fdc_single_64_MOD_fdc_find_dependent at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__galahad_ccqp_single_64_MOD_ccqp_solve at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
__galahad_ccqp_single_64_MOD_ccqp_solve_qp at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
ccqp_solve_qp at /Users/runner/.julia/artifacts/c2e5cfe43b471ab5c068a91dd3ad79e38cad1a80/lib/libgalahad_single_64.dylib (unknown line)
ccqp_solve_qp at /Users/runner/work/GALAHAD/GALAHAD/GALAHAD.jl/src/wrappers/ccqp.jl:322
test_ccqp at /Users/runner/work/GALAHAD/GALAHAD/GALAHAD.jl/test/test_ccqp.jl:65
@amontoison
Copy link
Member Author

amontoison commented Jan 13, 2025

@jfowkes It's related to SSIDS.

@nimgould
Copy link
Contributor

Please provide line numbers, we'll never find anything wthout them

@nimgould
Copy link
Contributor

Which compiler? ssids is known not to work with ifx, so is this ifort?

@nimgould
Copy link
Contributor

We have

error #5633: Internal compiler error: segmentation violation signal raised Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for fkeep.F90

when compiling with the latest
ifx (IFX) 2024.2.1 20240711
Copyright (C) 1985-2024

(and previous versions)

I thought we had made a policy decision not to use ssids in interface tests, the tests for ssids should be for the fortran?

@nimgould
Copy link
Contributor

I have no idea what happens on a Mac

@jfowkes
Copy link
Collaborator

jfowkes commented Jan 13, 2025

@nimgould I think he means the error happens on a Mac with an Intel processor (ifort/ifx are no longer supported on macs, Intel are bitter that they got dropped in favour of ARM).

@amontoison
Copy link
Member Author

amontoison commented Jan 13, 2025

Sorry but it's the version cross-compiled by Yggdrasil so it's in release mode (-O3) and harder to debug.
I cross-compiled it with GCC 9.1.

@amontoison
Copy link
Member Author

It also fails on Mac ARM so the issue is related to Mac.
The cross-compiler for Mac ARM is GCC 12.1. 🤔

@nimgould
Copy link
Contributor

OK, but I'll be searching for a molecule in an ocean on a distant planet without a line number to examine

@amontoison
Copy link
Member Author

amontoison commented Jan 13, 2025

Ok, I think that the issue is the library of C++.
With the cross-compiler, libgalahad_* is linked to libc++ and not libstdc++.

In Meson, I have these flags:

# Link flag for C++
lstdcpp = '-lstdc++'
if host_machine.system() != 'linux'
  if cxx.get_id() == 'clang' or cxx.get_id() == 'clang-cl'
    lstdcpp = '-lc++'
  endif
  if cxx.get_id() == 'intel' or cxx.get_id() == 'intel-llvm'
    lstdcpp = '-cxxlib'
  endif
  if cxx.get_id() == 'intel-cl' or cxx.get_id() == 'intel-llvm-cl'
    lstdcpp = '/Qcxxlib'
  endif
endif

but I compile everything with g++, even on Mac so I don't understand why it's linked to this library at the end.

@amontoison
Copy link
Member Author

You can debug it on Mac mini with the help of Jari.
You just need to compile GALAHAD with clang and clang++.

@nimgould
Copy link
Contributor

I tried to compile GALAHAD with flang here in linux land the other day, and it couldn't cope with ssids ... what fortran compiler were you using with clang?

@nimgould
Copy link
Contributor

Actually, it was worse than that, flang hasn't implemented many of the features we need, e.g,
Compiling spm error: loc("/home/nimg/Dropbox/fortran/optrove/galahad/objects/pc64.lnx.fln/double/spmf.F90":97:4): flang/lib/Lower/CallInterface.cpp:949: not yet implemented: support for polymorphic types

@jfowkes
Copy link
Collaborator

jfowkes commented Jan 13, 2025

@amontoison are you maybe using clang++ as the linker at the end? I don't think SSIDS will play nicely with clang++.

@amontoison
Copy link
Member Author

I need to check the builds on Yggdrasil.
This is the PR: JuliaPackaging/Yggdrasil#10257

I don't see anything wong in the logs:

[13:59:17] C compiler for the host machine: /opt/bin/x86_64-apple-darwin14-libgfortran5-cxx11/x86_64-apple-darwin14-gcc (gcc 8.1.0 "x86_64-apple-darwin14-gcc (GCC) 8.1.0")
[13:59:17] C linker for the host machine: /opt/bin/x86_64-apple-darwin14-libgfortran5-cxx11/x86_64-apple-darwin14-gcc ld64 530
[13:59:17] C++ compiler for the host machine: /opt/bin/x86_64-apple-darwin14-libgfortran5-cxx11/x86_64-apple-darwin14-g++ (gcc 8.1.0 "x86_64-apple-darwin14-g++ (GCC) 8.1.0")
[13:59:17] C++ linker for the host machine: /opt/bin/x86_64-apple-darwin14-libgfortran5-cxx11/x86_64-apple-darwin14-g++ ld64 530

@amontoison amontoison changed the title Error on Mac Intel for the Julia interface Errors on Mac for the Julia interface Jan 13, 2025
@amontoison
Copy link
Member Author

amontoison commented Jan 13, 2025

@imciner2
Ian, do you have an idea why I have an error with libc++ on Mac while I cross-compiled GALAHAD with the compilers gfortran / gcc / g++ (Yggdrasil) and linked with -lstdc++'?
I didn't wanted to compile with clang++ and clang because it was never tested with these compilers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants