Skip to content

Add support for quadruple and extended double precision support #6

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

Merged
merged 1 commit into from
Nov 6, 2021
Merged
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: 0 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ jobs:
compiler: gnu
version: 10

- os: macos-latest
build: meson
build-type: debug
compiler: gnu
version: 5

- os: macos-latest
build: cmake
build-type: debug
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ target_include_directories(
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${module-dir}>
)
target_compile_definitions(
"${PROJECT_NAME}-lib"
PRIVATE
"WITH_QP=$<BOOL:${WITH_QP}>"
"WITH_XDP=$<BOOL:${WITH_XDP}>"
)

# Export targets for other projects
add_library("${PROJECT_NAME}" INTERFACE)
Expand Down
12 changes: 12 additions & 0 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
)
endif()

include(CheckFortranSourceRuns)
check_fortran_source_runs(
"if (selected_real_kind(33) == -1) stop 1; end"
WITH_QP
)
set(WITH_QP ${WITH_QP} PARENT_SCOPE)
check_fortran_source_runs(
"if (any(selected_real_kind(18) == [-1, selected_real_kind(33)])) stop 1; end"
WITH_XDP
)
set(WITH_XDP ${WITH_XDP} PARENT_SCOPE)

include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/template.cmake"
Expand Down
8 changes: 8 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ if get_option('openmp')
omp_dep = dependency('openmp')
lib_deps += omp_dep
endif

with_qp = fc.run('if (selected_real_kind(33) == -1) stop 1; end').returncode() == 0
with_xdp = fc.run('if (any(selected_real_kind(18) == [-1, selected_real_kind(33)])) stop 1; end').returncode() == 0
add_project_arguments(
'-DWITH_QP=@0@'.format(with_qp.to_int()),
'-DWITH_XDP=@0@'.format(with_xdp.to_int()),
language: 'fortran',
)
3 changes: 3 additions & 0 deletions config/template.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@PACKAGE_INIT@

set("@PROJECT_NAME@_WITH_QP" @WITH_QP@)
set("@PROJECT_NAME@_WITH_XDP" @WITH_XDP@)

if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@")
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
endif()
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(dir "${CMAKE_CURRENT_SOURCE_DIR}")

list(
APPEND srcs
"${dir}/testdrive.f90"
"${dir}/testdrive.F90"
"${dir}/testdrive_version.f90"
)

Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
# limitations under the License.

srcs += files(
'testdrive.f90',
'testdrive.F90',
'testdrive_version.f90',
)
Loading