Refactor: Improve code clarity, modularity, and style
This commit is contained in:
40
CMakeLists.txt
Normal file
40
CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(snplib LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
option(USE_MKL "Use Intel MKL" OFF)
|
||||
option(USE_OPENBLAS "Use OpenBLAS" OFF)
|
||||
|
||||
if(USE_MKL)
|
||||
find_package(MKL REQUIRED)
|
||||
if(MKL_FOUND)
|
||||
include_directories(${MKL_INCLUDE_DIRS})
|
||||
link_libraries(${MKL_LIBRARIES})
|
||||
endif()
|
||||
elseif(USE_OPENBLAS)
|
||||
find_package(OpenBLAS REQUIRED)
|
||||
if(OPENBLAS_FOUND)
|
||||
include_directories(${OPENBLAS_INCLUDE_DIRS})
|
||||
link_libraries(${OPENBLAS_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include_directories(src)
|
||||
|
||||
add_library(snplib
|
||||
src/data_manage.cc
|
||||
src/grm.cc
|
||||
src/ibs.cc
|
||||
src/king.cc
|
||||
src/snp.cc
|
||||
src/statistics.cc
|
||||
src/ugrm.cc
|
||||
)
|
||||
|
||||
target_include_directories(snplib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
# Example executable
|
||||
add_executable(example main.cc)
|
||||
target_link_libraries(example snplib)
|
Reference in New Issue
Block a user