From d2d15e522f04344be4a1d1cae24f6ef96dedbc00 Mon Sep 17 00:00:00 2001 From: Hank Anderson Date: Tue, 27 Jan 2015 12:23:35 -0600 Subject: [PATCH] Started converting lib target to CMake. The main part of this target is looping through the BLAS subfolders and calling make on them. Need to add CMakeLists.txt for each of these subfolders. --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++ cmake/prebuild.cmake | 3 ++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dbb6f059..6bca1899e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,4 +15,44 @@ message(WARNING "CMake support is experimental. This will not produce the same M include("${CMAKE_SOURCE_DIR}/cmake/system.cmake") +set(BLASDIRS interface driver/level2 driver/level3 driver/others) + +if (NOT ${DYNAMIC_ARCH}) + list(APPEND BLASDIRS kernel) +endif () + +if (DEFINED UTEST_CHECK) + set(SANITY_CHECK 1) +endif () + +if (DEFINED SANITY_CHECK) + list(APPEND BLASDIRS reference) +endif () + +set(SUBDIRS ${BLASDIRS}) +if (NOT ${NO_LAPACK}) + list(APPEND SUBDIRS lapack) +endif () + +set(SUBDIRS_ALL ${SUBDIRS} test ctest utest exports benchmark ../laswp ../bench) + +# all :: libs netlib tests shared + +# libs: +if (NOT DEFINED CORE OR "${CORE}" STREQUAL "UNKNOWN") + message(FATAL_ERROR "Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for details.") +endif () + +# Let CMake handle this +#if (${NOFORTRAN}) +# message(ERROR "OpenBLAS: Detecting fortran compiler failed. Please install fortran compiler, e.g. gfortran, ifort, openf90.") +#endif () + +if (${NO_STATIC} AND ${NO_SHARED}) + message(FATAL_ERROR "Neither static nor shared are enabled.") +endif () + +foreach (BLAS_DIR ${BLASDIRS}) + add_subdirectory(${BLAS_DIR}) +endforeach () diff --git a/cmake/prebuild.cmake b/cmake/prebuild.cmake index ffebbe30f..ded9f2ce0 100644 --- a/cmake/prebuild.cmake +++ b/cmake/prebuild.cmake @@ -19,7 +19,7 @@ # F_COMPILER # FC # BU -# CORE +# CORE <- REQUIRED # LIBCORE # NUM_CORES <- REQUIRED # HAVE_MMX @@ -105,4 +105,5 @@ message(STATUS "GETARCH LOG: ${GETARCH_LOG}") # temporarily hardcoded to get system.cmake working set(NUM_CORES 4) +set(CORE "GENERIC")