-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Error building shared libraries for MacOS #3528
Comments
Yes, but you are using an extremely new and experimental fortran compiler which is not supported yet. Probably |
I checked the I then tried passing -v to flang and ld
And indeed flang has the very default looking Note that those flags on the ld command can be split into 3 groups:
As for what they are:
Passing The new error message
ld now has a small improvement: Except for the double And indeed if I remove
The problems seem to be that flang retains the default linking options instead of using just This message has a lot of markdown. I did my best but please let me know if it's hard to read. |
Looks like either a missing compiler option or a compiler bug if flang tries to link shared libraries the same as executables. |
Given the problems below it seems like this would help but perl is not one of my strengths and I can't find what you are referring to. These commands are ran from the export folder as before. The problem persists if I call flang directly with only
But if I use
But if I add those flags to f_check#L395 the problem persists:
|
I'll try to provide a patch in a few hours when I have time. Btw did you build flang-classic yourself or is there a package in homebrew or whatever that I could plug into the CI job to test ? |
I built it myself. MacOS is a recent addition to flang and I don't think there is a homebrew package yet. The build instructions are simple enough, just replace gcc and g++ with clang and clang++. I recommend adding I uploaded my own build here (the tar file, not the zip). To use it simply extract to |
It seems
|
Just to make clear what works, this command ran from the command line in the exports folder succeeds:
Applying this diff to f_check works. But ideally |
My hunch for f_check was simply:
but this is untested |
Still didn't work. It did remove -lflangmain from the flang command line which is definitely part of the solution, but LD still uses
It seems |
|
I've copied the suggestion to use both |
I added it to f_check#L396 and yes it works. I also have the flangmain excluding code you posted. I will now test the flang patch posted on the issue. EDIT: The patch works. |
For reference this is the
|
Thanks. Putting it all in f_check does not work for me - during the build of openblas_utest the option gets passed to clang, which errors out on unknown arguments. So I guess the "no-fortran-main" bit has to stay in exports/Makefile (with an added ifdef that applies it only to flang) |
The pull request above works for me. |
Thank you for confirming, and for all your help with this. |
Is shared lib even supported on macOS?
MacOS Monterey (12)
LLVM-10, clang and flang from the classic flang project
CPU: Ryzen 5 (ZEN)
Build script:
The "interesting" part of the error:
The full enormous log (VERBOSE=1): https://gist.github.com/meow464/3d55454c05d581a042f35616172b8bb1
(There are a lot of warnings about target overriding, this is a flang problem, the output is for the correct target)
The text was updated successfully, but these errors were encountered: