This repository has been archived by the owner on Oct 3, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# tests CMake's built-in FindBLAS | ||
cmake_minimum_required(VERSION 3.12) | ||
project(Lapack_OEM LANGUAGES C Fortran) | ||
|
||
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) | ||
set(BLA_VENDOR Intel10_64lp) | ||
if(WIN32) | ||
file(TO_CMAKE_PATH "$ENV{MKLROOT}" MKLROOT) | ||
else() | ||
set(MKLROOT "$ENV{MKLROOT}") | ||
endif() | ||
endif() | ||
|
||
find_package(BLAS) | ||
find_package(LAPACK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# run by: | ||
# ctest -S setup.cmake | ||
|
||
# --- Project-specific -Doptions | ||
# these will be used if the project isn't already configured. | ||
set(_opts) | ||
|
||
# --- boilerplate follows | ||
message(STATUS "CMake ${CMAKE_VERSION}") | ||
if(CMAKE_VERSION VERSION_LESS 3.12) | ||
message(FATAL_ERROR "Please update CMake >= 3.12") | ||
endif() | ||
|
||
# site is OS name | ||
if(NOT DEFINED CTEST_SITE) | ||
set(CTEST_SITE ${CMAKE_SYSTEM_NAME}) | ||
endif() | ||
|
||
# test name is Fortran compiler in FC | ||
# Note: ctest scripts cannot read cache variables like CMAKE_Fortran_COMPILER | ||
if(DEFINED ENV{FC}) | ||
set(FC $ENV{FC}) | ||
set(CTEST_BUILD_NAME ${FC}) | ||
|
||
if(NOT DEFINED ENV{CC}) | ||
# use same compiler for C and Fortran, which CMake might not do itself | ||
if(FC STREQUAL ifort) | ||
if(WIN32) | ||
set(ENV{CC} icl) | ||
else() | ||
set(ENV{CC} icc) | ||
endif() | ||
endif() | ||
endif() | ||
endif() | ||
|
||
if(NOT DEFINED CTEST_BUILD_CONFIGURATION) | ||
set(CTEST_BUILD_CONFIGURATION "Release") | ||
endif() | ||
|
||
set(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) | ||
if(NOT DEFINED CTEST_BINARY_DIRECTORY) | ||
set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/build) | ||
endif() | ||
|
||
# CTEST_CMAKE_GENERATOR must be defined in any case here. | ||
if(NOT DEFINED CTEST_CMAKE_GENERATOR) | ||
find_program(_gen NAMES ninja ninja-build samu) | ||
if(_gen) | ||
set(CTEST_CMAKE_GENERATOR "Ninja") | ||
elseif(WIN32) | ||
set(CTEST_CMAKE_GENERATOR "MinGW Makefiles") | ||
set(CTEST_BUILD_FLAGS -j) # not --parallel as this goes to generator directly | ||
else() | ||
set(CTEST_CMAKE_GENERATOR "Unix Makefiles") | ||
set(CTEST_BUILD_FLAGS -j) # not --parallel as this goes to generator directly | ||
endif() | ||
endif() | ||
|
||
# -- build and test | ||
ctest_start("Experimental" ${CTEST_SOURCE_DIRECTORY} ${CTEST_BINARY_DIRECTORY}) | ||
|
||
ctest_configure( | ||
BUILD ${CTEST_BINARY_DIRECTORY} | ||
SOURCE ${CTEST_SOURCE_DIRECTORY} | ||
OPTIONS "${_opts}" | ||
RETURN_VALUE return_code | ||
CAPTURE_CMAKE_ERROR cmake_err) | ||
|
||
if(return_code EQUAL 0 AND cmake_err EQUAL 0) | ||
ctest_build( | ||
BUILD ${CTEST_BINARY_DIRECTORY} | ||
CONFIGURATION ${CTEST_BUILD_CONFIGURATION} | ||
RETURN_VALUE return_code | ||
NUMBER_ERRORS Nerror | ||
CAPTURE_CMAKE_ERROR cmake_err | ||
) | ||
else() | ||
message(STATUS "SKIP: ctest_build(): returncode: ${return_code}; CMake error code: ${cmake_err}") | ||
endif() | ||
|
||
if(return_code EQUAL 0 AND Nerror EQUAL 0 AND cmake_err EQUAL 0) | ||
ctest_test( | ||
BUILD ${CTEST_BINARY_DIRECTORY} | ||
RETURN_VALUE return_code | ||
CAPTURE_CMAKE_ERROR ctest_err | ||
) | ||
else() | ||
message(STATUS "SKIP: ctest_test(): returncode: ${return_code}; CMake error code: ${cmake_err}") | ||
endif() | ||
|
||
# ctest_submit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters