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

flang regression needs LIBRARY_PATH #198106

Open
scivision opened this issue Nov 18, 2024 · 2 comments
Open

flang regression needs LIBRARY_PATH #198106

scivision opened this issue Nov 18, 2024 · 2 comments
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@scivision
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

HOMEBREW_VERSION: 4.4.6
ORIGIN: https://github.com/Homebrew/brew
HEAD: cc0b5d6d05d1f3af5b2f53e9fbb1e7bfa0c332ab
Last commit: 30 hours ago
Core tap JSON: 18 Nov 16:32 UTC
Core cask tap JSON: 18 Nov 16:32 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.ZtFLV6ifye/org.xquartz:0
HOMEBREW_EDITOR: nano
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 16.0.0 build 1600
Git: 2.47.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.1-arm64
CLT: 16.1.0.0.1.1729049160
Xcode: 16.1
Rosetta 2: false
Your system is ready to brew.


### Verification

- [X] My `brew doctor` output says `Your system is ready to brew.` and am still able to reproduce my issue.
- [X] I ran `brew update` and am still able to reproduce my issue.
- [X] I have resolved all warnings from `brew doctor` and that did not fix my problem.
- [X] I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

### What were you trying to do (and why)?

`flang` recently lost ability to compile any Fortran program unless LIBRARY_PATH is specified. Flang was previously working from Homebrew. The error is:

```sh
% flang-new main.f90

ld: library 'c++' not found
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)

main.f90 is:

program main
end program

What happened (include all command output)?

The workaround (command that works) is:

% LIBRARY_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib flang-new main.f90  

What did you expect to happen?

I expected to be able to compile a trivial Fortran program, as Flang from Homebrew previously worked.

Step-by-step reproduction instructions (by running brew commands)

brew install flang

flang-new main.f90
@scivision scivision added the bug Reproducible Homebrew/homebrew-core bug label Nov 18, 2024
@scivision
Copy link
Author

related: #192611

@cho-m
Copy link
Member

cho-m commented Nov 20, 2024

cc @carlocab


If flang was relying on LLVM config files (which add --sysroot to SDK), then the incorrect system directory could be related, which is probably caused by relative path from libexec/bin/flang-new:

flang-new main.f90 -v 2>&1 | rg 'System configuration'
System configuration file directory: /opt/homebrew/Cellar/etc/clang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

No branches or pull requests

2 participants