Hello,
I am trying to build FLANG. I followed these steps referring the README.txt in FLANG github sources(https://github.com/llvm-flang/flang) .
1. I cloned the latest llvm sources:
git clone https://github.com/llvm-mirror/llvm.git
2. Download the flang source code with in llvm tree:
cd llvm/tools
git clone https://github.com/llvm-flang/flang.git
3. Compile LLVM and flang together:
mkdir build
cd build
cmake ../.. -DCMAKE_INSTALL_PREFIX=/usr
This throws some warnings when generating configuration files for FLANG. Some of them like:
CMake Warning (dev) in tools/flang/lib/AST/CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "flangAST" has an INTERFACE_LINK_LIBRARIES property. This should be
preferred as the source of the link interface for this library but because
CMP0022 is not set CMake is ignoring the property and using the link
implementation as the link interface instead.
INTERFACE_LINK_LIBRARIES:
LLVMSupport;flangBasic
Link implementation:
flangBasic
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tools/flang/tools/driver/CMakeLists.txt:28 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "flang-headers" of target "flang" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
4. Since build files were generated, I tried make. But I got some compile time errors when building “obj.flang-tblgen”:
[ 88%] Building CXX object tools/flang/utils/TableGen/CMakeFiles/obj.flang-tblgen.dir/FlangASTNodesEmitter.cpp.o
$LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangASTNodesEmitter.cpp: In member function std::string {anonymous}::FlangASTNodesEmitter:: baseName(llvm::Record&):
$LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangASTNodesEmitter.cpp:50:24: error: no match for operator+ (operand types are llvm::StringRef and const string {aka const std::basic_string<char>})
return R.getName() + BaseSuffix;
I tried to fix this error by changing the line return R.getName() + BaseSuffix; to return R.getName().str() + BaseSuffix; in file $LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangASTNodesEmitter.cpp
5. After this when I tried running make again, I got this error:
[ 88%] Building CXX object tools/flang/utils/TableGen/CMakeFiles/obj.flang-tblgen.dir/FlangDiagnosticsEmitter.cpp.o
$LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangDiagnosticsEmitter.cpp: In function llvm::SMRange findSuperClassRange(const llvm::Record*, llvm::StringRef):
$LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangDiagnosticsEmitter.cpp:154:50: error: conversion from llvm::ArrayRef<std::pair<llvm::Record*, llvm::SMRange> > to non-scalar type llvm::ArrayRef<llvm::Record*>requested
ArrayRef<Record *> Supers = R->getSuperClasses();
$LLVM_ROOT/llvm/tools/flang/utils/TableGen/FlangDiagnosticsEmitter.cpp:158:17: error: const class llvm::Record has no member named getSuperClassRanges
return R->getSuperClassRanges()[i];
I searched the header file $LLVM_ROOT/llvm/include/llvm/TableGen/Record.h for definition of getSuperClassRanges, but it is not defined there.
I am trying to build on Ubuntu_16.10 installed on x86_64 machine. cmake version 3.7.2 and gcc version 6.2 is being used to build flang.
Can anyone please help me to identify what could be going wrong or am I missing something?
Regards And Thanks,
--
You received this message because you are subscribed to the Google Groups "flang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flang-dev+unsubscribe@googlegroups.com.
To post to this group, send email to flan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flang-dev/CAMOtZ-9gPqFbZCBYo_oNuvEiKvZsGncD7B92L6knZh8s62ypNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to flang-dev+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to flang-dev+unsubscribe@googlegroups.com.
To post to this group, send email to flan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flang-dev/09470e9c-31b0-433b-931f-7c1afaffc560%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to flang-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flang-dev/ffc7cb78-f342-4d57-bae4-1b2dd8b3239a%40googlegroups.com.
I don't believe there's working I/O support. Computational kernels only.
-Hal
-- You received this message because you are subscribed to the Google Groups "flang-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to flang-dev+...@googlegroups.com. To post to this group, send email to flan...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/flang-dev/CAC6GRO_UzsNwSwR-oxxBhxvut0hEj0j%3D2sUzmb8ofodirOhuuQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
-- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory