Added openblas add_library call that uses DBLAS_OBJS ojbects.

This commit is contained in:
Hank Anderson 2015-01-30 15:21:21 -06:00
parent 3e8ea7a351
commit 5057a4b4df
6 changed files with 27 additions and 7 deletions

View File

@ -53,10 +53,18 @@ if (${NO_STATIC} AND ${NO_SHARED})
message(FATAL_ERROR "Neither static nor shared are enabled.")
endif ()
set(DBLAS_OBJS "")
foreach (BLAS_DIR ${BLASDIRS})
add_subdirectory(${BLAS_DIR})
endforeach ()
# get obj vars into format that add_library likes: $<TARGET_OBJS:objlib> (see http://www.cmake.org/cmake/help/v3.0/command/add_library.html)
set(TARGET_OBJS "")
foreach (DBLAS_OBJ ${DBLAS_OBJS})
list(APPEND TARGET_OBJS "$<TARGET_OBJECTS:${DBLAS_OBJ}>")
endforeach ()
add_library(openblas ${TARGET_OBJS})
#Save the config files for installation
# @cp Makefile.conf Makefile.conf_last
# @cp config.h config_last.h

View File

@ -50,6 +50,7 @@ endfunction ()
function(GenerateObjects sources_in defines_in all_defines_in)
AllCombinations("${defines_in}")
set(define_combos ${LIST_OUT})
set(OBJ_LIST_OUT "")
foreach (source_file ${sources_in})
foreach (def_combo ${define_combos})
@ -81,7 +82,9 @@ function(GenerateObjects sources_in defines_in all_defines_in)
if (cur_defines AND NOT "${cur_defines}" STREQUAL " ") # using space as the empty set
set_target_properties(${obj_name} PROPERTIES COMPILE_DEFINITIONS "${cur_defines}")
endif ()
list(APPEND OBJ_LIST_OUT ${obj_name})
endforeach ()
endforeach ()
set(OBJ_LIST_OUT ${OBJ_LIST_OUT} PARENT_SCOPE)
endfunction ()

View File

@ -79,9 +79,6 @@ set_target_properties(DBLAS_TU PROPERTIES COMPILE_DEFINITIONS "UNIT;TRANS")
# )
#endif ()
set(DBLAS_TARGETS DBLAS_NONE DBLAS_T DBLAS_L DBLAS_U DBLAS_TU)
foreach (DBLAS_TARGET ${DBLAS_TARGETS})
set_target_properties(${DBLAS_TARGET} PROPERTIES COMPILE_DEFINITIONS DOUBLE)
endforeach ()
list(APPEND DBLAS_OBJS "DBLAS_NONE;DBLAS_T;DBLAS_L;DBLAS_U;DBLAS_TU")
set(DBLAS_OBJS ${DBLAS_OBJS} PARENT_SCOPE) # list append removes the scope from DBLAS_OBJS

View File

@ -27,12 +27,18 @@ set(GEMM_DEFINES NN NT TN TT)
foreach (GEMM_DEFINE ${GEMM_DEFINES})
add_library(GEMM_${GEMM_DEFINE}_OBJS OBJECT gemm.c)
set_target_properties(GEMM_${GEMM_DEFINE}_OBJS PROPERTIES COMPILE_DEFINITIONS ${GEMM_DEFINE})
list(APPEND DBLAS_OBJS GEMM_${GEMM_DEFINE}_OBJS)
endforeach ()
GenerateObjects("trmm_L.c;trmm_R.c;trsm_L.c;trsm_R.c" "TRANS;UPPER;UNIT" "DOUBLE")
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
GenerateObjects("symm_k.c" "LOWER;RSIDE" "NN;DOUBLE")
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
GenerateObjects("syrk_k.c;syr2k_k.c" "LOWER;TRANS" "DOUBLE")
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
GenerateObjects("syrk_kernel.c;syr2k_kernel.c" "LOWER" "DOUBLE")
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
#if (SMP)
#
@ -59,3 +65,6 @@ GenerateObjects("syrk_kernel.c;syr2k_kernel.c" "LOWER" "DOUBLE")
# dgemm_thread_tn.c dgemm_thread_tt.c
#endif
#
set(DBLAS_OBJS ${DBLAS_OBJS} PARENT_SCOPE) # list append removes the scope from DBLAS_OBJS

View File

@ -6,7 +6,7 @@ else ()
set(MEMORY memory.c)
endif ()
add_library(COMMONOBJS OBJECT
add_library(COMMON_OBJS OBJECT
${MEMORY}
xerbla.c
abs.c # TODO: this is split into c_abs (DOUBLE unset) and z_abs (DOUBLE set) in the Makefile

View File

@ -41,5 +41,8 @@ add_library(DBLAS3OBJS OBJECT
# trmm is trsm with a compiler flag set
add_library(TRMM_OBJ OBJECT trsm.c)
set_target_properties(TRMM_OBJ PROPERTIES COMPILE_DEFINITIONS TRMM)
set_target_properties(TRMM_OBJ PROPERTIES COMPILE_DEFINITIONS "TRMM")
list(APPEND DBLAS_OBJS "DBLAS1OBJS;AMAX_OBJ;AMIN_OBJ;MIN_OBJ;DBLAS2OBJS;DBLAS3OBJS;TRMM_OBJ")
set(DBLAS_OBJS ${DBLAS_OBJS} PARENT_SCOPE) # list append removes the scope from DBLAS_OBJS