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

what is the libgcc_s requirement in LAPACK? #643

Closed
jhgorse opened this issue Jan 3, 2022 · 6 comments
Closed

what is the libgcc_s requirement in LAPACK? #643

jhgorse opened this issue Jan 3, 2022 · 6 comments

Comments

@jhgorse
Copy link

jhgorse commented Jan 3, 2022

Greetings,

I was trying to compile a 3rd party app for the new Apple M1 cpu and found some difficulty linking due to LAPACK's libgcc requirement. Specifically, ld: file not found: @rpath/libgcc_s.1.1.dylib for architecture arm64

The 3rd party build was done with clang.

The libgcc dep appeared to come from OpenBLAS/LAPACK's use of gfortran.

Is there any chance that libgcc might be mistakenly getting included in the LAPACK build?

Cheers,
Joe

@weslleyspereira
Copy link
Collaborator

Hi!
I have some questions to try to help you:

  • Are you trying to build LAPACK with Makefile or CMake? The C Compiler is set to gcc in some make.inc files.
  • Have you tried compiling LAPACK with the reference BLAS instead of OpenBLAS?

@martin-frbg
Copy link
Collaborator

I'm fairly certain that you will get the depencency on libgcc_s (gcc's runtime library) even just from compiling the LAPACK Fortran source with gfortran, with no C code in the mix. The alternative would be to compile everything with flang (not entirely sure if this is considered stable on the M1 yet), nvfortran or the commercial NAG fortran compiler.

@jhgorse
Copy link
Author

jhgorse commented Jan 4, 2022

@weslleyspereira, I have built it both ways. The make.inc.default from gcc to cc just worked. I had to run the */ Makefiles to generate the _mangling.h headers, but it otherwise worked without a hitch.

I do not see any references to the libgcc_s library, though I did not xref through all of it's symbols. If it grabbed any of the long int type numeric symbols, it does so without further issue because it is a statically linked set of .a libraries.

@martin-frbg, I did try to build flang and failed. Did not look too deep into it. I didn't know about nvfortran! Looks neat! =)

Cheers,
Joe

@weslleyspereira
Copy link
Collaborator

@weslleyspereira, I have built it both ways. The make.inc.default from gcc to cc just worked. I had to run the */ Makefiles to generate the _mangling.h headers, but it otherwise worked without a hitch.

Good! We have been trying to improve the installation of the mangling files, see #584 and #616. Currently, one must run CBLAS/ and LAPACKE/ Makefiles to get the _mangling files installed.

@weslleyspereira
Copy link
Collaborator

We just merged a PR which improves the installation of mangling files for lapack.h. Please, see: #637

@jhgorse, May I mark this issue as solved? Thanks

@jhgorse
Copy link
Author

jhgorse commented Feb 15, 2022

Yes, please. This ticket is resolved.

Thank you for the update.

Cheers,
Joe

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

No branches or pull requests

3 participants