Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flang-rt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ CMake itself provide.
the compiler for `__float128` or 128-bit `long double` support.
[More details](docs/Real16MathSupport.md).

* `FLANG_RT_QUADMATH_INCLUDE_DIR` (default: `""`)

Allows setting a path to `quadmath.h` directory.
It may be required when using non-gcc compiler for building flang-rt.
It maye also be required when building flang-rt in bootstrap mode.

* `FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT` (values: `"CUDA"`,`"OpenMP"`, `""` default: `""`)

When set to `CUDA`, builds Flang-RT with experimental support for GPU
Expand Down
7 changes: 7 additions & 0 deletions flang-rt/lib/quadmath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,15 @@ target_include_directories(FortranFloat128MathILib INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
)

set(FLANG_RT_QUADMATH_INCLUDE_DIR "" CACHE PATH
"An optional path to GNU libquadmath header files. \
It may be required when building with FLANG_RUNTIME_F128_MATH_LIB \
and a non-gcc compiler.")

if (FLANG_RUNTIME_F128_MATH_LIB)
if (${FLANG_RUNTIME_F128_MATH_LIB} STREQUAL "libquadmath")
include_directories(${FLANG_RT_QUADMATH_INCLUDE_DIR})
list(APPEND CMAKE_REQUIRED_INCLUDES ${FLANG_RT_QUADMATH_INCLUDE_DIR})
check_include_file(quadmath.h FOUND_QUADMATH_HEADER)
if(FOUND_QUADMATH_HEADER)
add_compile_definitions(HAS_QUADMATHLIB)
Expand Down