This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add LAPACK example building targets blas and lapack - add LAPACK-CBLAS example using local cmake config file
- Loading branch information
Showing
7 changed files
with
133 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) 2017, NeroBurner | ||
# All rights reserved. | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
# Load used modules | ||
include(hunter_add_version) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
include(hunter_cacheable) | ||
|
||
hunter_cacheable(LAPACK) | ||
|
||
# List of versions here... | ||
hunter_add_version( | ||
PACKAGE_NAME | ||
LAPACK | ||
VERSION | ||
"3.7.1" | ||
URL | ||
https://github.com/hunter-packages/lapack/archive/v3.7.1-p0.tar.gz | ||
SHA1 | ||
82616c0878fbe42f22ece5fadfb38e09456ba5b5 | ||
) | ||
|
||
# pass cmake arguments | ||
hunter_cmake_args( | ||
LAPACK | ||
CMAKE_ARGS | ||
HUNTER_INSTALL_LICENSE_FILES=LICENSE | ||
) | ||
|
||
# Pick a download scheme | ||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
|
||
# Download package. | ||
# Two versions of library will be build: | ||
# * libexample_A.a | ||
# * libexample_Ad.a | ||
hunter_download(PACKAGE_NAME 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,35 @@ | ||
# Copyright (c) 2015, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
|
||
set(TESTING_CONFIG_OPT FILEPATH "${CMAKE_CURRENT_LIST_DIR}/config.cmake") | ||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-LAPACK) | ||
|
||
hunter_add_package(LAPACK) | ||
|
||
string(COMPARE EQUAL "${LAPACK_LICENSES}" "" is_empty) | ||
if(is_empty) | ||
message(FATAL_ERROR "Licenses not found") | ||
endif() | ||
|
||
message("LAPACK licenses:") | ||
foreach(x ${LAPACK_LICENSES}) | ||
message("* ${x}") | ||
if(NOT EXISTS "${LAPACK_LICENSES}") | ||
message(FATAL_ERROR "File not found") | ||
endif() | ||
endforeach() | ||
|
||
find_package(cblas CONFIG REQUIRED) | ||
# Test double library creation | ||
find_package(cblas CONFIG REQUIRED) | ||
|
||
add_executable(foo foo.cpp) | ||
target_link_libraries(foo cblas) | ||
|
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,4 @@ | ||
hunter_config(LAPACK | ||
VERSION ${HUNTER_LAPACK_VERSION} | ||
CMAKE_ARGS CBLAS=ON | ||
) |
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,14 @@ | ||
#include <iostream> // std::cout | ||
#include <cblas.h> | ||
|
||
int main() { | ||
double X[3]; | ||
X[0] = 1; | ||
X[1] = 2; | ||
X[2] = 3; | ||
const int N = 3; | ||
const int incX = 1; | ||
|
||
double sum = cblas_dasum(N, X, incX); | ||
std::cout << "sum over [1, 2, 3] = " << sum << std::endl; | ||
} |
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,33 @@ | ||
# Copyright (c) 2015, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-LAPACK) | ||
|
||
hunter_add_package(LAPACK) | ||
|
||
string(COMPARE EQUAL "${LAPACK_LICENSES}" "" is_empty) | ||
if(is_empty) | ||
message(FATAL_ERROR "Licenses not found") | ||
endif() | ||
|
||
message("LAPACK licenses:") | ||
foreach(x ${LAPACK_LICENSES}) | ||
message("* ${x}") | ||
if(NOT EXISTS "${LAPACK_LICENSES}") | ||
message(FATAL_ERROR "File not found") | ||
endif() | ||
endforeach() | ||
|
||
find_package(LAPACK CONFIG REQUIRED) | ||
# Test double library creation | ||
find_package(LAPACK CONFIG REQUIRED) | ||
|
||
add_executable(foo foo.cpp) | ||
target_link_libraries(foo blas 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,5 @@ | ||
#include <iostream> // std::cout | ||
|
||
int main() { | ||
std::cout << "This program is doing nothing!" << std::endl; | ||
} |