Skip to content

LLVM Flang build errors #45

@ivan-pi

Description

@ivan-pi

I'm trying to build this with flang version 21:

$ cmake -Bbuild -DCMAKE_Fortran_COMPILER=flang
CMake Deprecation Warning at CMakeLists.txt:27 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The Fortran compiler identification is LLVMFlang 21.1.8
-- The C compiler identification is AppleClang 17.0.0.17000603
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/homebrew/bin/flang - skipped
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Verifying Fortran/C Compiler Compatibility
-- Verifying Fortran/C Compiler Compatibility - Success
CMAKE_Fortran_COMPILER_ID="LLVMFlang"
CMake Deprecation Warning at test/CMakeLists.txt:26 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- FEQPARSE -------------  cmake DONE --------------------
-- Configuring done (7.3s)
-- Generating done (0.7s)
-- Build files have been written to: /Users/ivan/fortran/does_it_flang/feq-parse/build
$ cmake --build build
[  0%] Building Fortran object src/CMakeFiles/feqparse.dir/FEQParse_FloatStacks.f90.o
[  0%] Building Fortran object src/CMakeFiles/feqparse.dir/FEQParse_Functions.f90.o
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:108:32: warning: The global subprogram 'randomize_r32' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure) [-Wexternal-interface-mismatch]
      pure real(real32) function randomize_r32()
                                 ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:511:23: Declaration of 'randomize_r32'
  real(real32) function randomize_r32()
                        ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:108:32: Declaration of 'randomize_r32'
      pure real(real32) function randomize_r32()
                                 ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:114:32: warning: The global subprogram 'randomize_r64' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure) [-Wexternal-interface-mismatch]
      pure real(real64) function randomize_r64()
                                 ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:519:23: Declaration of 'randomize_r64'
  real(real64) function randomize_r64()
                        ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:114:32: Declaration of 'randomize_r64'
      pure real(real64) function randomize_r64()
                                 ^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:207:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(cos_function) = Tuple("cos","COS")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:211:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(cosh_function) = Tuple("cosh","COSH")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:215:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(sin_function) = Tuple("sin","SIN")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:219:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(sinh_function) = Tuple("sinh","SINH")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:223:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(tan_function) = Tuple("tan","TAN")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:227:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(tanh_function) = Tuple("tanh","TANH")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:231:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(sqrt_function) = Tuple("sqrt","SQRT")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:235:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(abs_function) = Tuple("abs","ABS")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:239:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(exp_function) = Tuple("exp","EXP")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:243:30: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(ln_function) = Tuple("ln","LN")
                               ^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:247:31: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(log_function) = Tuple("log","LOG")
                                ^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:251:33: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(log10_function) = Tuple("log10","LOG10")
                                  ^^^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:255:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(acos_function) = Tuple("acos","ACOS")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:259:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(asin_function) = Tuple("asin","ASIN")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:263:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(atan_function) = Tuple("atan","ATAN")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:267:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(sech_function) = Tuple("sech","SECH")
                                 ^^^^^^^^^^^^^^^^^^^^
/Users/ivan/fortran/does_it_flang/feq-parse/src/FEQParse_Functions.f90:271:32: portability: Reference to generic function 'tuple' (resolving to specific 'tuple_new') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]
      Functions(rand_function) = Tuple("rand","RAND")
                                 ^^^^^^^^^^^^^^^^^^^^
[  1%] Building Fortran object src/CMakeFiles/feqparse.dir/FEQParse_TokenStack.f90.o
[  1%] Building Fortran object src/CMakeFiles/feqparse.dir/FEQParse.f90.o
[  1%] Linking Fortran shared library libfeqparse.dylib
/opt/homebrew/bin/flang -dynamiclib -Wl,-headerpad_max_install_names -o libfeqparse.dylib -install_name @rpath/libfeqparse.dylib CMakeFiles/feqparse.dir/FEQParse.f90.o CMakeFiles/feqparse.dir/FEQParse_FloatStacks.f90.o CMakeFiles/feqparse.dir/FEQParse_Functions.f90.o CMakeFiles/feqparse.dir/FEQParse_TokenStack.f90.o
flang-21: error: unknown argument: '-dynamiclib'
flang-21: error: unknown argument: '-install_name'
flang-21: error: no such file or directory: '@rpath/libfeqparse.dylib'
gmake[2]: *** [src/CMakeFiles/feqparse.dir/build.make:144: src/libfeqparse.dylib] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:470: src/CMakeFiles/feqparse.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Leaving the warnings aside, it looks there are incompatible compiler flags from classig flang. The CMakeLists.txt will need to specialize on "Flang" and "LLVMFlang" (CMAKE_Fortran_COMPILER_ID).

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions