Commit 7890ce20 authored by COULAUD Olivier's avatar COULAUD Olivier

Merge branch 'devel' of gitlab.inria.fr:solverstack/ScalFMM into devel

parents 8fca5a58 57abbf7e
image: hpclib/hiepacs
stages:
- build
- test
- sonar
utests:
build:
stage: build
script:
- mkdir BuildTests
- cd BuildTests
- cmake -DSCALFMM_USE_LOG=ON -DSCALFMM_USE_BLAS=ON -DSCALFMM_USE_ASSERT=ON -DSCALFMM_BUILD_UTESTS=ON -DSCALFMM_BUILD_TESTS=ON -DSCALFMM_USE_FFT=ON ..
- make
- OMP_NUM_THREADS=2 make test
tags:
- gcc
- blas
- fftw
- cd Build && cmake ..
-DSCALFMM_USE_LOG=ON
-DSCALFMM_USE_ASSERT=ON
-DSCALFMM_USE_SSE=OFF
-DSCALFMM_USE_BLAS=ON
-DSCALFMM_USE_FFT=ON
-DSCALFMM_USE_MPI=ON
-DSCALFMM_BUILD_EXAMPLES=ON
-DSCALFMM_BUILD_TESTS=OFF
-DSCALFMM_BUILD_UTESTS=OFF
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_C_COMPILER=gcc-6
-DCMAKE_CXX_COMPILER=g++-6
- make -j8
test:
stage: test
artifacts:
name: scalfmm_test
expire_in: 1 day
paths:
- scalfmm-build.log
- scalfmm.lcov
- scalfmm-coverage.xml
#- scalfmm-cppcheck.xml
- scalfmm-rats.xml
script:
- source ./Utils/scripts/analysis.sh
sonar:
stage: sonar
dependencies:
- test
artifacts:
name: scalfmm_sonar
expire_in: 1 day
paths:
- sonar.log
script:
- sonar-scanner -X -Dsonar.login=c1416c617418f890576a747223ac9f6cd86353d6 > sonar.log
only:
- devel
......@@ -811,6 +811,10 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
string(STRIP ${lib_var} lib_var)
LIST(APPEND SCALFMM_COMPILE_LIBS ${lib_var})
endforeach()
string(REPLACE " " ";" SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}")
string(REPLACE ";;" ";" SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}")
string(REPLACE " " ";" SCALFMM_INCLUDES "${SCALFMM_INCLUDES}")
string(REPLACE ";;" ";" SCALFMM_INCLUDES "${SCALFMM_INCLUDES}")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/Src/ScalFmmConfig.h )
#
......
......@@ -30,6 +30,7 @@
# BLA_STATIC if set on this determines what kind of linkage we do (static)
# BLA_VENDOR if set checks only the specified vendor, if not set checks
# all the possibilities
# BLAS_VENDOR_FOUND stores the BLAS vendor found
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DBLAS_DIR=path/to/blas):
......@@ -687,10 +688,6 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endforeach ()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES "Intel*")
if(NOT BLAS_FIND_QUIETLY)
if(${_LIBRARIES})
message(STATUS "Looking for MKL BLAS: found")
......@@ -698,7 +695,11 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
message(STATUS "Looking for MKL BLAS: not found")
endif()
endif()
if (${_LIBRARIES} AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Intel MKL")
endif()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES "Intel*")
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
......@@ -722,6 +723,9 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Goto")
endif()
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
......@@ -747,6 +751,9 @@ if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Openblas")
endif()
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
......@@ -765,7 +772,7 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
""
)
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
if(BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
message(STATUS "Looking for Eigen BLAS: found")
else()
message(STATUS "Looking for Eigen BLAS: not found")
......@@ -791,6 +798,9 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Eigen")
endif()
endif (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
......@@ -816,6 +826,10 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Atlas")
endif()
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
......@@ -840,6 +854,10 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "PhiPACK")
endif()
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
......@@ -864,6 +882,10 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "CXML")
endif()
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
......@@ -888,6 +910,10 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "DXML")
endif()
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
......@@ -915,6 +941,10 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SunPerf")
endif()
endif ()
......@@ -939,6 +969,10 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SunPerf")
endif()
endif ()
......@@ -963,6 +997,10 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SGIMATH")
endif()
endif ()
......@@ -987,6 +1025,10 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "IBM ESSL")
endif()
endif ()
# BLAS in IBM ESSL_MT library (requires generic BLAS lib, too)
......@@ -1010,6 +1052,10 @@ if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "IBM ESSL MT")
endif()
endif ()
......@@ -1179,6 +1225,10 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "ACML")
endif()
endif (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") # ACML
......@@ -1203,6 +1253,10 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Apple Accelerate")
endif()
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
......@@ -1226,6 +1280,9 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "NAS")
endif()
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
......@@ -1255,6 +1312,10 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
endif()
endforeach ()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Netlib or other Generic libblas")
endif()
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
......@@ -1293,9 +1354,6 @@ if(BLA_F95)
set(BLAS_FOUND TRUE)
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
if (NOT BLAS_LIBRARIES_DEP)
set(BLAS_LIBRARIES_DEP "${BLAS95_LIBRARIES}")
endif()
else(BLA_F95)
......
......@@ -122,11 +122,13 @@ if (BLAS_FOUND)
endif()
# test succeeds: CBLAS is in BLAS
set(CBLAS_LIBRARIES "${BLAS_LIBRARIES}")
set(CBLAS_LIBRARIES_DEP "${BLAS_LIBRARIES}")
if (BLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${BLAS_LIBRARY_DIRS}")
endif()
if(BLAS_INCLUDE_DIRS)
set(CBLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIRS}")
set(CBLAS_INCLUDE_DIRS_DEP "${BLAS_INCLUDE_DIRS_DEP}")
endif()
if (BLAS_LINKER_FLAGS)
set(CBLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
......
......@@ -37,6 +37,7 @@
# This module finds headers and chameleon library.
# Results are reported in variables:
# CHAMELEON_FOUND - True if headers and requested libraries were found
# CHAMELEON_C_FLAGS - list of required compilation flags (excluding -I)
# CHAMELEON_LINKER_FLAGS - list of required linker flags (excluding -l and -L)
# CHAMELEON_INCLUDE_DIRS - chameleon include directories
# CHAMELEON_LIBRARY_DIRS - Link directories for chameleon libraries
......@@ -166,9 +167,10 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
endif()
endif()
set(CHAMELEON_INCLUDE_DIRS_DEP "${CHAMELEON_INCLUDE_DIRS}")
set(CHAMELEON_LIBRARY_DIRS_DEP "${CHAMELEON_LIBRARY_DIRS}")
set(CHAMELEON_LIBRARIES_DEP "${CHAMELEON_LIBRARIES}")
set(CHAMELEON_C_FLAGS "${CHAMELEON_CFLAGS_OTHER}")
set(CHAMELEON_INCLUDE_DIRS_DEP "${CHAMELEON_STATIC_INCLUDE_DIRS}")
set(CHAMELEON_LIBRARY_DIRS_DEP "${CHAMELEON_STATIC_LIBRARY_DIRS}")
set(CHAMELEON_LIBRARIES_DEP "${CHAMELEON_STATIC_LIBRARIES}")
endif(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
......
###
#
# @copyright (c) 2017 Inria. All rights reserved.
#
###
#
# - Find CPPCHECK bin directory
# Use this module by invoking find_package with the form:
# find_package(CPPCHECK
# [REQUIRED]) # Fail with error if cppcheck is not found
#
# This module finds headers and cppcheck library.
# Results are reported in variables:
# CPPCHECK_FOUND - True if cppcheck executable is found
# CPPCHECK_EXECUTABLE - cppcheck executable directory found
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DCPPCHECK_DIR=path/to/cppcheck):
# CPPCHECK_DIR - Where to find the base directory of cppcheck
# CPPCHECK_BINDIR - Where to find the executable cppcheck
# The module can also look for the following environment variables if paths
# are not given as cmake variable: CPPCHECK_DIR, CPPCHECK_BINDIR
if (NOT CPPCHECK_FOUND)
set(CPPCHECK_DIR "" CACHE PATH "Installation directory of CPPCHECK library")
mark_as_advanced(CPPCHECK_DIR)
if (NOT CPPCHECK_FIND_QUIETLY)
message(STATUS "A cache variable, namely CPPCHECK_DIR, has been set to specify the install directory of CPPCHECK")
endif()
endif()
set(ENV_CPPCHECK_DIR "$ENV{CPPCHECK_DIR}")
set(ENV_CPPCHECK_BINDIR "$ENV{CPPCHECK_BINDIR}")
set(CPPCHECK_GIVEN_BY_USER "FALSE")
if ( CPPCHECK_DIR OR CPPCHECK_BINDIR OR ENV_CPPCHECK_DIR OR ENV_CPPCHECK_BINDIR )
set(CPPCHECK_GIVEN_BY_USER "TRUE")
endif()
if (NOT CPPCHECK_FIND_QUIETLY)
message(STATUS "Looking for CPPCHECK")
endif()
# Looking for executable
# ----------------------
# Add system include paths to search include
# ------------------------------------------
unset(where_to_look)
if(CPPCHECK_BINDIR)
list(APPEND where_to_look "${CPPCHECK_BINDIR}")
elseif(CPPCHECK_DIR)
list(APPEND where_to_look "${CPPCHECK_DIR}")
elseif(ENV_CPPCHECK_BINDIR)
list(APPEND where_to_look "${ENV_CPPCHECK_BINDIR}")
elseif(ENV_CPPCHECK_DIR)
list(APPEND where_to_look "${ENV_CPPCHECK_DIR}/bin")
else()
string(REPLACE ":" ";" _path_env "$ENV{PATH}")
list(APPEND where_to_look "${_path_env}")
endif()
list(APPEND where_to_look "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND where_to_look "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES where_to_look)
find_program(CPPCHECK_EXECUTABLE
NAMES cppcheck
HINTS ${where_to_look}
)
mark_as_advanced(CPPCHECK_EXECUTABLE)
if(CPPCHECK_EXECUTABLE)
execute_process(COMMAND ${CPPCHECK_EXECUTABLE} "--version" OUTPUT_VARIABLE CPPCHECK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "Cppcheck " "" CPPCHECK_VERSION "${CPPCHECK_VERSION}")
endif()
# check that CPPCHECK has been found
# ----------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CPPCHECK DEFAULT_MSG
CPPCHECK_EXECUTABLE
CPPCHECK_VERSION)
......@@ -20,6 +20,7 @@
# This module finds headers and eztrace library.
# Results are reported in variables:
# EZTRACE_FOUND - True if headers and requested libraries were found
# EZTRACE_C_FLAGS - list of required compilation flags (excluding -I)
# EZTRACE_INCLUDE_DIRS - eztrace include directories
# EZTRACE_LIBRARY_DIRS - Link directories for eztrace libraries
# EZTRACE_LIBRARIES - eztrace component libraries to be linked
......@@ -86,6 +87,8 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
endif()
endif()
set(EZTRACE_C_FLAGS "${EZTRACE_CFLAGS_OTHER}")
endif( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND) OR (EZTRACE_GIVEN_BY_USER) )
......
# - Try to find fabulous (C-api)
#
# If this script have difficulties to find fabulous, you can try to help
# it by setting the variable FABULOUS_DIR to the prefix path where fabulous
# was installed
#
# Once done this will define
# FABULOUS_FOUND - System has fabulous
# FABULOUS_INCLUDE_DIRS - The fabulous include directories
# FABULOUS_LIBRARIES - The libraries needed to use fabulous
# FABULOUS_DEFINITIONS - Compiler switches required for using fabulous
include(FindPackageHandleStandardArgs)
macro(FABULOUS_FIND_LIBRARIES_FROM_PKGCONFIG_RESULTS _prefix _pc_xprefix)
foreach(_library ${${_pc_xprefix}_LIBRARIES})
get_filename_component(_library ${_library} NAME_WE)
unset(_library_path)
unset(_library_path CACHE)
find_library(_library_path NAMES ${_library}
HINTS ${${_pc_xprefix}_LIBDIR} ${${_pc_xprefix}_LIBRARY_DIRS} )
if (_library_path)
list(APPEND ${_prefix}_LIBRARIES ${_library_path})
else()
message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND")
endif()
unset(_library_path CACHE)
endforeach()
endmacro()
macro(FABULOUS_CHECK_FUNCTION_EXISTS _prefix _function)
include(CheckFunctionExists)
unset(${_prefix}_WORKS)
unset(${_prefix}_WORKS CACHE)
set(CMAKE_REQUIRED_LIBRARIES ${${_prefix}_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${${_prefix}_INCLUDE_DIRS})
set(CMAKE_REQUIRED_DEFINITIONS ${${_prefix}_DEFINITIONS})
check_function_exists(${_function} ${_prefix}_WORKS)
set(CMAKE_REQUIRED_LIBRARIES "")
set(CMAKE_REQUIRED_INCLUDES "")
set(CMAKE_REQUIRED_DEFINITIONS "")
mark_as_advanced(${_prefix}_WORKS)
endmacro()
find_package(PkgConfig QUIET)
set(ENV_FABULOUS_DIR "$ENV{FABULOUS_DIR}")
set(ENV_FABULOUS_INCDIR "$ENV{FABULOUS_INCDIR}")
set(ENV_FABULOUS_LIBDIR "$ENV{FABULOUS_LIBDIR}")
set(FABULOUS_GIVEN_BY_USER "FALSE")
if ( FABULOUS_DIR OR ENV_FABULOUS_DIR
OR ( FABULOUS_INCDIR AND FABULOUS_LIBDIR )
OR ( ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR ) )
set(FABULOUS_GIVEN_BY_USER "TRUE")
endif()
set(FABULOUS_STATIC_FIND_QUIETLY "TRUE")
set(FABULOUS_SHARED_FIND_QUIETLY "TRUE")
if ((NOT FABULOUS_FOUND) AND (NOT FABULOUS_GIVEN_BY_USER) AND PKG_CONFIG_FOUND)
pkg_check_modules(PC_FABULOUS QUIET fabulous)
find_path(FABULOUS_STATIC_INCLUDE_DIR NAMES fabulous.h
HINTS ${PC_FABULOUS_STATIC_INCLUDEDIR} ${PC_FABULOUS_STATIC_INCLUDE_DIRS} )
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a
HINTS ${PC_FABULOUS_STATIC_LIBDIR} ${PC_FABULOUS_STATIC_LIBRARY_DIRS} )
find_path(FABULOUS_SHARED_INCLUDE_DIR NAMES fabulous.h
HINTS ${PC_FABULOUS_INCLUDEDIR} ${PC_FABULOUS_INCLUDE_DIRS} )
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so
HINTS ${PC_FABULOUS_LIBDIR} ${PC_FABULOUS_LIBRARY_DIRS} )
# handle the QUIETLY and REQUIRED arguments and set FABULOUS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
FABULOUS_STATIC DEFAULT_MSG
FABULOUS_STATIC_LIBRARY FABULOUS_STATIC_INCLUDE_DIR)
mark_as_advanced(FABULOUS_STATIC_INCLUDE_DIR FABULOUS_STATIC_LIBRARY)
find_package_handle_standard_args(
FABULOUS_SHARED DEFAULT_MSG
FABULOUS_SHARED_LIBRARY FABULOUS_SHARED_INCLUDE_DIR)
mark_as_advanced(FABULOUS_SHARED_INCLUDE_DIR FABULOUS_SHARED_LIBRARY)
if (FABULOUS_STATIC_FOUND AND NOT FABULOUS_SHARED_FOUND)
set(FABULOUS_INCLUDE_DIRS ${FABULOUS_STATIC_INCLUDE_DIR} )
set(FABULOUS_DEFINITIONS ${PC_FABULOUS_STATIC_CFLAGS_OTHER} )
set(FABULOUS_LIBRARIES "")
fabulous_find_libraries_from_pkgconfig_results(FABULOUS PC_FABULOUS_STATIC)
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_INCLUDE_DIRS ${FABULOUS_INCLUDE_DIR} )
set(FABULOUS_DEFINITIONS ${PC_FABULOUS_CFLAGS_OTHER} )
set(FABULOUS_LIBRARIES "")
fabulous_find_libraries_from_pkgconfig_results(FABULOUS PC_FABULOUS)
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
FABULOUS DEFAULT_MSG
FABULOUS_LIBRARIES FABULOUS_INCLUDE_DIRS FABULOUS_WORKS)
endif()
if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
# Currently the C-api (compiled version) does not depent on chameleon
# so the library only depends on CBLAS AND LAPACKE
set(FABULOUS_DEFINITIONS "")
if ( ( FABULOUS_INCDIR AND FABULOUS_LIBDIR ) OR ( ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR ) )
if ((NOT FABULOUS_LIBDIR) AND (NOT FABULOUS_INCDIR)
AND (ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR) )
set(FABULOUS_LIBDIR ${ENV_FABULOUS_LIBDIR})
set(FABULOUS_INCDIR ${ENV_FABULOUS_INCDIR})
endif()
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h HINTS ${FABULOUS_INCDIR})
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a HINTS ${FABULOUS_LIBDIR})
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so HINTS ${FABULOUS_LIBDIR})
else()
if (ENV_FABULOUS_DIR AND NOT FABULOUS_DIR)
set(FABULOUS_DIR "${ENV_FABULOUS_DIR}" CACHE PATH "Installation prefix where fabulous is installed")
else()
set(FABULOUS_DIR "${FABULOUS_DIR}" CACHE PATH "Installation prefix where fabulous is installed")
endif()
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES include include/fabulous)
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES lib lib32 lib64 lib/fabulous lib32/fabulous lib64/fabulous)
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES lib lib32 lib64 lib/fabulous lib32/fabulous lib64/fabulous)
endif()
find_package_handle_standard_args(FABULOUS_STATIC DEFAULT_MSG FABULOUS_STATIC_LIBRARY)
find_package_handle_standard_args(FABULOUS_SHARED DEFAULT_MSG FABULOUS_SHARED_LIBRARY)
mark_as_advanced(FABULOUS_STATIC_LIBRARY FABULOUS_SHARED_LIBRARY)
if (FABULOUS_STATIC_FOUND AND NOT FABULOUS_SHARED_FOUND)
if (FABULOUS_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
find_package(LAPACKE REQUIRED)
else()
find_package(CBLAS)
find_package(LAPACKE)
endif()
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY})
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
FABULOUS DEFAULT_MSG
FABULOUS_LIBRARIES FABULOUS_INCLUDE_DIRS FABULOUS_WORKS)
endif()
......@@ -230,6 +230,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3F fftw3f)
pkg_search_module(FFTW3 fftw3)
if (FFTW3F_FOUND)
set(FFTW_C_FLAGS "${FFTW3F_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3F - found using PkgConfig")
endif()
......@@ -259,6 +260,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3L fftw3l)
pkg_search_module(FFTW3 fftw3)
if (FFTW3L_FOUND)
set(FFTW_C_FLAGS "${FFTW3L_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3L - found using PkgConfig")
endif()
......@@ -288,6 +290,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3Q fftw3q)
pkg_search_module(FFTW3 fftw3)
if (FFTW3Q_FOUND)
set(FFTW_C_FLAGS "${FFTW3Q_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3Q - found using PkgConfig")
endif()
......@@ -317,6 +320,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3 fftw3)
endif()
if (FFTW3_FOUND)
set(FFTW_C_FLAGS "${FFTW3_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3 - found using PkgConfig")
endif()
......@@ -343,9 +347,9 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
endif()
endif(FFTW3_FOUND)
set(FFTW_INCLUDE_DIRS_DEP "${FFTW_INCLUDE_DIRS}")
set(FFTW_LIBRARY_DIRS_DEP "${FFTW_LIBRARY_DIRS}")
set(FFTW_LIBRARIES_DEP "${FFTW_LIBRARIES}" )
set(FFTW_INCLUDE_DIRS_DEP "${FFTW_STATIC_INCLUDE_DIRS}")
set(FFTW_LIBRARY_DIRS_DEP "${FFTW_STATIC_LIBRARY_DIRS}")
set(FFTW_LIBRARIES_DEP "${FFTW_STATIC_LIBRARIES}" )
if (FFTW_LIBRARIES)
set(FFTW_WORKS TRUE)
......@@ -763,8 +767,6 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR
message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")