diff --git a/cmake/c_check.cmake b/cmake/c_check.cmake index aaa3da7bc..e32c18a43 100644 --- a/cmake/c_check.cmake +++ b/cmake/c_check.cmake @@ -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") diff --git a/driver/others/CMakeLists.txt b/driver/others/CMakeLists.txt index 0d2a2f486..e14a916b2 100644 --- a/driver/others/CMakeLists.txt +++ b/driver/others/CMakeLists.txt @@ -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) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 5615bf2c2..a6eb14e73 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -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