Added openblas add_library call that uses DBLAS_OBJS ojbects.
This commit is contained in:
parent
3e8ea7a351
commit
5057a4b4df
|
@ -53,10 +53,18 @@ if (${NO_STATIC} AND ${NO_SHARED})
|
||||||
message(FATAL_ERROR "Neither static nor shared are enabled.")
|
message(FATAL_ERROR "Neither static nor shared are enabled.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set(DBLAS_OBJS "")
|
||||||
foreach (BLAS_DIR ${BLASDIRS})
|
foreach (BLAS_DIR ${BLASDIRS})
|
||||||
add_subdirectory(${BLAS_DIR})
|
add_subdirectory(${BLAS_DIR})
|
||||||
endforeach ()
|
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
|
#Save the config files for installation
|
||||||
# @cp Makefile.conf Makefile.conf_last
|
# @cp Makefile.conf Makefile.conf_last
|
||||||
# @cp config.h config_last.h
|
# @cp config.h config_last.h
|
||||||
|
|
|
@ -50,6 +50,7 @@ endfunction ()
|
||||||
function(GenerateObjects sources_in defines_in all_defines_in)
|
function(GenerateObjects sources_in defines_in all_defines_in)
|
||||||
AllCombinations("${defines_in}")
|
AllCombinations("${defines_in}")
|
||||||
set(define_combos ${LIST_OUT})
|
set(define_combos ${LIST_OUT})
|
||||||
|
set(OBJ_LIST_OUT "")
|
||||||
foreach (source_file ${sources_in})
|
foreach (source_file ${sources_in})
|
||||||
foreach (def_combo ${define_combos})
|
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
|
if (cur_defines AND NOT "${cur_defines}" STREQUAL " ") # using space as the empty set
|
||||||
set_target_properties(${obj_name} PROPERTIES COMPILE_DEFINITIONS "${cur_defines}")
|
set_target_properties(${obj_name} PROPERTIES COMPILE_DEFINITIONS "${cur_defines}")
|
||||||
endif ()
|
endif ()
|
||||||
|
list(APPEND OBJ_LIST_OUT ${obj_name})
|
||||||
endforeach ()
|
endforeach ()
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
set(OBJ_LIST_OUT ${OBJ_LIST_OUT} PARENT_SCOPE)
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,6 @@ set_target_properties(DBLAS_TU PROPERTIES COMPILE_DEFINITIONS "UNIT;TRANS")
|
||||||
# )
|
# )
|
||||||
#endif ()
|
#endif ()
|
||||||
|
|
||||||
set(DBLAS_TARGETS DBLAS_NONE DBLAS_T DBLAS_L DBLAS_U DBLAS_TU)
|
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
|
||||||
foreach (DBLAS_TARGET ${DBLAS_TARGETS})
|
|
||||||
set_target_properties(${DBLAS_TARGET} PROPERTIES COMPILE_DEFINITIONS DOUBLE)
|
|
||||||
endforeach ()
|
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,18 @@ set(GEMM_DEFINES NN NT TN TT)
|
||||||
foreach (GEMM_DEFINE ${GEMM_DEFINES})
|
foreach (GEMM_DEFINE ${GEMM_DEFINES})
|
||||||
add_library(GEMM_${GEMM_DEFINE}_OBJS OBJECT gemm.c)
|
add_library(GEMM_${GEMM_DEFINE}_OBJS OBJECT gemm.c)
|
||||||
set_target_properties(GEMM_${GEMM_DEFINE}_OBJS PROPERTIES COMPILE_DEFINITIONS ${GEMM_DEFINE})
|
set_target_properties(GEMM_${GEMM_DEFINE}_OBJS PROPERTIES COMPILE_DEFINITIONS ${GEMM_DEFINE})
|
||||||
|
list(APPEND DBLAS_OBJS GEMM_${GEMM_DEFINE}_OBJS)
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
|
||||||
GenerateObjects("trmm_L.c;trmm_R.c;trsm_L.c;trsm_R.c" "TRANS;UPPER;UNIT" "DOUBLE")
|
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")
|
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")
|
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")
|
GenerateObjects("syrk_kernel.c;syr2k_kernel.c" "LOWER" "DOUBLE")
|
||||||
|
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
|
||||||
|
|
||||||
#if (SMP)
|
#if (SMP)
|
||||||
#
|
#
|
||||||
|
@ -59,3 +65,6 @@ GenerateObjects("syrk_kernel.c;syr2k_kernel.c" "LOWER" "DOUBLE")
|
||||||
# dgemm_thread_tn.c dgemm_thread_tt.c
|
# dgemm_thread_tn.c dgemm_thread_tt.c
|
||||||
#endif
|
#endif
|
||||||
#
|
#
|
||||||
|
|
||||||
|
set(DBLAS_OBJS ${DBLAS_OBJS} PARENT_SCOPE) # list append removes the scope from DBLAS_OBJS
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ else ()
|
||||||
set(MEMORY memory.c)
|
set(MEMORY memory.c)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_library(COMMONOBJS OBJECT
|
add_library(COMMON_OBJS OBJECT
|
||||||
${MEMORY}
|
${MEMORY}
|
||||||
xerbla.c
|
xerbla.c
|
||||||
abs.c # TODO: this is split into c_abs (DOUBLE unset) and z_abs (DOUBLE set) in the Makefile
|
abs.c # TODO: this is split into c_abs (DOUBLE unset) and z_abs (DOUBLE set) in the Makefile
|
||||||
|
|
|
@ -41,5 +41,8 @@ add_library(DBLAS3OBJS OBJECT
|
||||||
|
|
||||||
# trmm is trsm with a compiler flag set
|
# trmm is trsm with a compiler flag set
|
||||||
add_library(TRMM_OBJ OBJECT trsm.c)
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue