Added lapacke sources.
authorHank Anderson <hank.p.anderson@gmail.com>
Wed, 25 Feb 2015 22:51:08 +0000 (16:51 -0600)
committerHank Anderson <hank.p.anderson@gmail.com>
Wed, 25 Feb 2015 22:51:08 +0000 (16:51 -0600)
CMakeLists.txt
cmake/lapack.cmake
cmake/prebuild.cmake
cmake/system.cmake

index cbc4fb9..5c26811 100644 (file)
@@ -90,11 +90,15 @@ endforeach ()
 
 # Can't just use lapack-netlib's CMake files, since they are set up to search for BLAS, build and install a binary. We just want to build a couple of lib files out of lapack and lapacke.
 # Not using add_subdirectory here because lapack-netlib already has its own CMakeLists.txt. Instead include a cmake script with the sources we want.
-include("${CMAKE_SOURCE_DIR}/cmake/lapack.cmake")
-set_source_files_properties(${LA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_FFLAGS}")
+if (NOT NOFORTRAN)
+  include("${CMAKE_SOURCE_DIR}/cmake/lapack.cmake")
+endif ()
+if (NOT NO_LAPACKE)
+  include("${CMAKE_SOURCE_DIR}/cmake/lapacke.cmake")
+endif ()
 
 # add objects to the openblas lib
-add_library(openblas ${LA_SOURCES} ${TARGET_OBJS})
+add_library(openblas ${LA_SOURCES} ${LAPACKE_SOURCES} ${TARGET_OBJS})
 
 # TODO: Why is the config saved here? Is this necessary with CMake?
 #Save the config files for installation
index e8d19f1..3e81611 100644 (file)
@@ -344,4 +344,4 @@ set(LA_SOURCES "")
 foreach (LA_FILE ${LA_REL_SRC})\r
   list(APPEND LA_SOURCES "${NETLIB_LAPACK_DIR}/SRC/${LA_FILE}")\r
 endforeach ()\r
-\r
+set_source_files_properties(${LA_SOURCES} PROPERTIES COMPILE_FLAGS "${LAPACK_FFLAGS}")\r
index d2bada3..3e2574f 100644 (file)
@@ -51,7 +51,10 @@ else()
 endif ()
 
 include("${CMAKE_SOURCE_DIR}/cmake/c_check.cmake")
-include("${CMAKE_SOURCE_DIR}/cmake/f_check.cmake")
+
+if (NOT NOFORTRAN)
+  include("${CMAKE_SOURCE_DIR}/cmake/f_check.cmake")
+endif ()
 
 # compile getarch
 set(GETARCH_SRC
index cc7373e..36f9b7c 100644 (file)
@@ -132,8 +132,10 @@ include("${CMAKE_SOURCE_DIR}/cmake/arch.cmake")
 # C Compiler dependent settings
 include("${CMAKE_SOURCE_DIR}/cmake/cc.cmake")
 
-# Fortran Compiler dependent settings
-include("${CMAKE_SOURCE_DIR}/cmake/fc.cmake")
+if (NOT NOFORTRAN)
+  # Fortran Compiler dependent settings
+  include("${CMAKE_SOURCE_DIR}/cmake/fc.cmake")
+endif ()
 
 if (BINARY64)
   if (INTERFACE64)
@@ -342,7 +344,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   endforeach ()
 endif ()
 
-if (${F_COMPILER} STREQUAL "GFORTRAN")
+if ("${F_COMPILER}" STREQUAL "GFORTRAN")
   # lapack-netlib is rife with uninitialized warnings -hpa
   set(LAPACK_FFLAGS "${LAPACK_FFLAGS} -Wno-maybe-uninitialized")
 endif ()
@@ -356,7 +358,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   set(LAPACK_CFLAGS "${LAPACK_CFLAGS} -DOPENBLAS_OS_WINDOWS")
 endif ()
 
-if (${CMAKE_C_COMPILER} STREQUAL "LSB")
+if (${CMAKE_C_COMPILER} STREQUAL "LSB" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   set(LAPACK_CFLAGS "${LAPACK_CFLAGS} -DLAPACK_COMPLEX_STRUCTURE")
 endif ()