|
@@ -33,6 +33,7 @@ include(sources.cmake)
|
|
# Options
|
|
# Options
|
|
#-----------------------------------------------------------------------------
|
|
#-----------------------------------------------------------------------------
|
|
option(WITH_LTM "Build with support for libtommath" TRUE)
|
|
option(WITH_LTM "Build with support for libtommath" TRUE)
|
|
|
|
+option(WITH_TFM "Build with support for tomsfastmath" FALSE)
|
|
option(WITH_GMP "Build with support for GNU Multi Precision Arithmetic Library" FALSE)
|
|
option(WITH_GMP "Build with support for GNU Multi Precision Arithmetic Library" FALSE)
|
|
set(MPI_PROVIDER "LTM" CACHE STRING "Build tests and demos against 'LTM', 'TFM' or 'GMP', default is LTM")
|
|
set(MPI_PROVIDER "LTM" CACHE STRING "Build tests and demos against 'LTM', 'TFM' or 'GMP', default is LTM")
|
|
option(BUILD_SHARED_LIBS "Build shared library and only the shared library if \"ON\", default is static" OFF)
|
|
option(BUILD_SHARED_LIBS "Build shared library and only the shared library if \"ON\", default is static" OFF)
|
|
@@ -138,6 +139,17 @@ if(WITH_LTM)
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC libtommath)
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC libtommath)
|
|
list(APPEND MPI_PROVIDERS -ltommath)
|
|
list(APPEND MPI_PROVIDERS -ltommath)
|
|
endif()
|
|
endif()
|
|
|
|
+# tomsfastmath
|
|
|
|
+if(WITH_TFM)
|
|
|
|
+ find_package(tomsfastmath 0.13.1 REQUIRED)
|
|
|
|
+
|
|
|
|
+ target_compile_definitions(${PROJECT_NAME} PUBLIC TFM_DESC)
|
|
|
|
+ if(MPI_PROVIDER MATCHES "TFM")
|
|
|
|
+ target_compile_definitions(${PROJECT_NAME} PUBLIC USE_TFM)
|
|
|
|
+ endif()
|
|
|
|
+ target_link_libraries(${PROJECT_NAME} PUBLIC tomsfastmath)
|
|
|
|
+ list(APPEND MPI_PROVIDERS -ltfm)
|
|
|
|
+endif()
|
|
# GNU MP
|
|
# GNU MP
|
|
if(WITH_GMP)
|
|
if(WITH_GMP)
|
|
pkg_check_modules(GMP REQUIRED gmp>=6.1.2)
|
|
pkg_check_modules(GMP REQUIRED gmp>=6.1.2)
|