Skip to content

Build errors with flang #990

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

Open
ivan-pi opened this issue Apr 29, 2025 · 2 comments
Open

Build errors with flang #990

ivan-pi opened this issue Apr 29, 2025 · 2 comments
Labels
bug Something isn't working build: cmake Issue with stdlib's CMake build files compiler: flang Specific to classic flang compiler platform: MacOS Build issues specific to the MacOS platform

Comments

@ivan-pi
Copy link
Member

ivan-pi commented Apr 29, 2025

Description

When building with a recent version of flang (installed using brew), I get the following error:

$ cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=flang -DCMAKE_Fortran_FLAGS="-O3 -march=native" -DCMAKE_C_COMPILER=clang
...
$ ninja -j 8
...

error: Semantic errors in src/CMakeFiles/fortran_stdlib.dir/stdlib_error.f90-pp.f90
/code/rbfx-new/standalone/batched-assembly/stdlib/build/src/stdlib_error.f90:245:14: error: Left-hand side of assignment is not definable
               ierr_out = ierr
               ^^^^^^^^
/code/rbfx-new/standalone/batched-assembly/stdlib/build/src/stdlib_error.f90:245:14: because: 'ierr_out' is polymorphic in a pure subprogram
               ierr_out = ierr
               ^^^^^^^^
/code/rbfx-new/standalone/batched-assembly/stdlib/build/src/stdlib_error.f90:239:56: Declaration of 'ierr_out'
           class(state_type), optional, intent(inout) :: ierr_out
                                                         ^^^^^^^^

Expected Behaviour

Build should succeed.

Version of stdlib

c14d599

Platform and Architecture

MacOS (Aarch64)

Additional Information

No response

@ivan-pi ivan-pi added the bug Something isn't working label Apr 29, 2025
@ivan-pi
Copy link
Member Author

ivan-pi commented Apr 29, 2025

The flang version is the following

$ flang --version
Homebrew flang version 20.1.2
Target: arm64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/flang/20.1.2/libexec
Configuration file: /opt/homebrew/Cellar/flang/20.1.2/libexec/flang.cfg
Configuration file: /opt/homebrew/etc/clang/arm64-apple-darwin24.cfg

@jalvesz jalvesz added build: cmake Issue with stdlib's CMake build files platform: MacOS Build issues specific to the MacOS platform compiler: flang Specific to classic flang compiler labels Apr 30, 2025
@jalvesz
Copy link
Contributor

jalvesz commented Apr 30, 2025

Similar issue found here #978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build: cmake Issue with stdlib's CMake build files compiler: flang Specific to classic flang compiler platform: MacOS Build issues specific to the MacOS platform
Projects
None yet
Development

No branches or pull requests

2 participants