Fixed some case issues with ARCH.
authorHank Anderson <hank.p.anderson@gmail.com>
Sun, 8 Feb 2015 21:29:18 +0000 (15:29 -0600)
committerHank Anderson <hank.p.anderson@gmail.com>
Sun, 8 Feb 2015 21:29:18 +0000 (15:29 -0600)
Added some kernel and driver/others objects.

cmake/c_check.cmake
driver/others/CMakeLists.txt
kernel/CMakeLists.txt

index aaa3da7..e32c18a 100644 (file)
@@ -56,12 +56,16 @@ endif ()
 # TODO: CMAKE_SYSTEM_PROCESSOR doesn't seem to be correct - instead get it from the compiler a la c_check
 set(ARCH ${CMAKE_SYSTEM_PROCESSOR})
 if (${ARCH} STREQUAL "AMD64")
-  set(ARCH "X86_64")
+  set(ARCH "x86_64")
 endif ()
 
 # If you are using a 32-bit compiler on a 64-bit system CMAKE_SYSTEM_PROCESSOR will be wrong
-if (${ARCH} STREQUAL "X86_64" AND BINARY EQUAL 32)
-  set(ARCH X86)
+if (${ARCH} STREQUAL "x86_64" AND BINARY EQUAL 32)
+  set(ARCH x86)
+endif ()
+
+if (${ARCH} STREQUAL "X86")
+  set(ARCH x86)
 endif ()
 
 set(COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
@@ -69,9 +73,11 @@ if (${COMPILER_ID} STREQUAL "GNU")
   set(COMPILER_ID "GCC")
 endif ()
 
+string(TOUPPER ${ARCH} UC_ARCH)
+
 file(WRITE ${TARGET_CONF}
   "#define OS_${HOST_OS}\t1\n"
-  "#define ARCH_${ARCH}\t1\n"
+  "#define ARCH_${UC_ARCH}\t1\n"
   "#define C_${COMPILER_ID}\t1\n"
   "#define __${BINARY}BIT__\t1\n"
   "#define FUNDERSCORE\t${FU}\n")
index 0d2a2f4..e14a916 100644 (file)
@@ -29,9 +29,7 @@ if (SMP)
   endif ()
 endif ()
 
-add_library(COMMON_OBJS OBJECT
-  ${MEMORY}
-  ${SMP_SOURCES}
+set(COMMON_SOURCES
   xerbla.c
   abs.c # TODO: this is split into c_abs (DOUBLE unset) and z_abs (DOUBLE set) in the Makefile
   openblas_set_num_threads.c
@@ -40,12 +38,12 @@ add_library(COMMON_OBJS OBJECT
   openblas_error_handle.c
 )
 
-#ifeq ($(DYNAMIC_ARCH), 1)
-#COMMONOBJS    +=  dynamic.$(SUFFIX)
-#else
-#COMMONOBJS    +=  parameter.$(SUFFIX)
-#endif
-#
+if (DYNAMIC_ARCH)
+  list(APPEND COMMON_SOURCES dynamic.c)
+else ()
+  list(APPEND COMMON_SOURCES parameter.c)
+endif ()
+
 #ifdef EXPRECISION
 #COMMONOBJS    += x_abs.$(SUFFIX) qlamch.$(SUFFIX) qlamc3.$(SUFFIX)
 #endif
@@ -62,6 +60,12 @@ add_library(COMMON_OBJS OBJECT
 #COMMONOBJS    += profile.$(SUFFIX)
 #endif
 
+add_library(COMMON_OBJS OBJECT
+  ${MEMORY}
+  ${SMP_SOURCES}
+  ${COMMON_SOURCES}
+)
+
 list(APPEND DBLAS_OBJS "COMMON_OBJS")
 
 #LIBOTHERS = libothers.$(LIBSUFFIX)
index 5615bf2..a6eb14e 100644 (file)
@@ -3,6 +3,14 @@ include_directories(${CMAKE_SOURCE_DIR})
 
 # TODO: need to read ${KERNELDIR}/KERNEL into CMake vars
 
+# Makeflie
+
+message(STATUS "${ARCH}")
+if (${ARCH} STREQUAL "x86")
+  GenerateNamedObjects("${KERNELDIR}/cpuid.S" "")
+  list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
+endif ()
+
 
 # Makefile.L1