flang-compiler / flang

Flang is a Fortran language front-end designed for integration with LLVM.
Other
801 stars 136 forks source link

Flang build fails when using flang-compiler/llvm "release_80" or "master" #766

Open leandron opened 5 years ago

leandron commented 5 years ago

As part of the CI server we are setting up, it seems that building Flang branches release_80 or master, using the respective branches of flang-compiler/llvm is currently broken due to an issue with HandleLLVMOptions.cmake (part of LLVM).

We are able to reproduce the problem building on an Ubuntu 18.04 (AArch64) machine, following the guidelines at https://github.com/flang-compiler/flang/wiki/Building-Flang, of course pointing to branches release_80 and master, rather than release_70.

When building Flang, make install fails with the following message:

(...)
Install the project...
-- Install configuration: ""
-- Installing: /jenkins-workspace/workspace/flang-llvm-80/install/lib/libpgmath.so
-- Installing: /jenkins-workspace/workspace/flang-llvm-80/install/lib/libpgmath.a
-- The C compiler identification is Clang 8.0.1
-- The CXX compiler identification is Clang 8.0.1
-- Check for working C compiler: /jenkins-workspace/workspace/flang-llvm-80/install/bin/clang
-- Check for working C compiler: /jenkins-workspace/workspace/flang-llvm-80/install/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /jenkins-workspace/workspace/flang-llvm-80/install/bin/clang++
-- Check for working CXX compiler: /jenkins-workspace/workspace/flang-llvm-80/install/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LLVM_CONFIG as /jenkins-workspace/workspace/flang-llvm-80/install/bin/llvm-config
-- Linker detection: GNU ld
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Success
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
-- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
CMake Error at /jenkins-workspace/workspace/flang-llvm-80/install/lib/cmake/llvm/HandleLLVMOptions.cmake:14 (if):
  Syntax error in cmake code at

    /jenkins-workspace/workspace/flang-llvm-80/install/lib/cmake/llvm/HandleLLVMOptions.cmake:14

  when parsing string

    lld-link\.exe

  Invalid escape sequence \.
Call Stack (most recent call first):
  CMakeLists.txt:150 (include)

-- Configuring incomplete, errors occurred!
See also "/jenkins-workspace/workspace/flang-llvm-80/flang/build/CMakeFiles/CMakeOutput.log".

The same happens when using flang-compiler/llvm:master.

The CMake version we use is 3.10.2, above the minimum required 3.4.3 (src: https://llvm.org/docs/CMake.html#quick-start):

$ cmake --version
cmake version 3.10.2

Tracking down the problem, it turns out it was a genuine problem on LLVM, already fixed by https://reviews.llvm.org/D60658. So this issue can be fixed by updating the LLVM forked version we use for both release_80 and master.

bryanpkc commented 5 years ago

I am working on Flang with LLVM 8. Apart from https://reviews.llvm.org/D60658, I also had to apply https://reviews.llvm.org/D57914 (to flang-driver) to eliminate a large number of warnings.

RobertHenry6bev commented 5 years ago

Does anybody have experience building against the recently forked llvm 9, or even more boldly, against head of master?

leandron commented 5 years ago

Does anybody have experience building against the recently forked llvm 9, or even more boldly, against head of master?

Building master reproduces this same issue reported here. Apart from that, I think it is same procedure as building release_70

ponnamsairam commented 4 years ago

https://github.com/flang-compiler/flang/issues/821#issuecomment-552749772 Refer above comment for FLANG installation