From 7cd0c3104f81b6cde00abcd2e92cd3084b0681b7 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Thu, 24 Jun 2021 21:39:42 +0200 Subject: [PATCH] separate lib for high level stuff --- src/include/hl_multi_array_header.h | 3 +++ src/include/multi_array_header.cc.h | 2 +- src/include/multi_array_header.h | 2 +- src/lib/CMakeLists.txt | 28 +++++++++++++++++++++++++++- src/lib/high_level_operation.cc | 2 +- src/lib/mk_hl_op.sh | 6 +++--- src/tests/CMakeLists.txt | 4 ++-- src/tests/op4_unit_test.cc | 1 + 8 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 src/include/hl_multi_array_header.h diff --git a/src/include/hl_multi_array_header.h b/src/include/hl_multi_array_header.h new file mode 100644 index 0000000..e831a63 --- /dev/null +++ b/src/include/hl_multi_array_header.h @@ -0,0 +1,3 @@ +#include "high_level_operation.h" + +#include "high_level_operation.cc.h" diff --git a/src/include/multi_array_header.cc.h b/src/include/multi_array_header.cc.h index 1149d19..70a281d 100644 --- a/src/include/multi_array_header.cc.h +++ b/src/include/multi_array_header.cc.h @@ -10,6 +10,6 @@ #include "multi_array.cc.h" #include "slice.cc.h" #include "dynamic_operation.cc.h" -#include "high_level_operation.cc.h" +//#include "high_level_operation.cc.h" //#include "expressions.cc.h" diff --git a/src/include/multi_array_header.h b/src/include/multi_array_header.h index f8f2903..05aa1a1 100644 --- a/src/include/multi_array_header.h +++ b/src/include/multi_array_header.h @@ -13,7 +13,7 @@ #include "operation_def.h" #include "map_range.h" #include "dynamic_operation.h" -#include "high_level_operation.h" +//#include "high_level_operation.h" #include "multi_array_header.cc.h" diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index b948709..19f96df 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -10,8 +10,12 @@ set(libmultiarray_a_SOURCES ${CMAKE_SOURCE_DIR}/src/lib/ranges/type_map.cc ${CMAKE_SOURCE_DIR}/src/lib/ranges/multi_range_factory_product_map.cc ${CMAKE_SOURCE_DIR}/src/lib/map_range_factory_product_map.cc + ) + +set(libhlmultiarray_a_SOURCES ${CMAKE_SOURCE_DIR}/src/lib/high_level_operation.cc ) +#message(WARNING ${libhlmultiarray_a_SOURCES}) file(GLOB cc_files "${CMAKE_SOURCE_DIR}/src/lib/ranges/range_types/*.cc") foreach(ccfile ${cc_files}) @@ -21,14 +25,18 @@ endforeach(ccfile) file(GLOB cc_files "${CMAKE_SOURCE_DIR}/src/lib/hl_ops/*.cc") foreach(ccfile ${cc_files}) - set(libmultiarray_a_SOURCES ${libmultiarray_a_SOURCES} + set(libhlmultiarray_a_SOURCES ${libhlmultiarray_a_SOURCES} ${ccfile}) endforeach(ccfile) add_library(multiarray_obj OBJECT ${libmultiarray_a_SOURCES} ) +add_library(hlmultiarray_obj OBJECT + ${libhlmultiarray_a_SOURCES} + ) set_target_properties(multiarray_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +set_target_properties(hlmultiarray_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE) add_library(multiarray SHARED $ @@ -40,6 +48,16 @@ add_library(multiarray_static ) set_target_properties(multiarray_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +add_library(hlmultiarray SHARED + $ + ) +set_target_properties(hlmultiarray PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +add_library(hlmultiarray_static + $ + ) +set_target_properties(hlmultiarray_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + install(TARGETS multiarray ARCHIVE DESTINATION ${INSTALL_PATH}/lib LIBRARY DESTINATION ${INSTALL_PATH}/lib) @@ -47,3 +65,11 @@ install(TARGETS multiarray install(TARGETS multiarray_static ARCHIVE DESTINATION ${INSTALL_PATH}/lib LIBRARY DESTINATION ${INSTALL_PATH}/lib) + +install(TARGETS hlmultiarray + ARCHIVE DESTINATION ${INSTALL_PATH}/lib + LIBRARY DESTINATION ${INSTALL_PATH}/lib) + +install(TARGETS hlmultiarray_static + ARCHIVE DESTINATION ${INSTALL_PATH}/lib + LIBRARY DESTINATION ${INSTALL_PATH}/lib) diff --git a/src/lib/high_level_operation.cc b/src/lib/high_level_operation.cc index 6f9f706..2cc2938 100644 --- a/src/lib/high_level_operation.cc +++ b/src/lib/high_level_operation.cc @@ -1,6 +1,6 @@ #include "multi_array_header.h" -#include "high_level_operation.h" +#include "hl_multi_array_header.h" namespace MultiArrayTools { diff --git a/src/lib/mk_hl_op.sh b/src/lib/mk_hl_op.sh index f904f85..66514c3 100755 --- a/src/lib/mk_hl_op.sh +++ b/src/lib/mk_hl_op.sh @@ -10,7 +10,7 @@ for x in $(cat ../include/extensions/math.h) ; do file=hl_ops/${fff}.cc test -f ${file} && rm -f ${file} echo "#include \"multi_array_header.h\"" >> ${file} - echo "#include \"high_level_operation.h\"" >> ${file} + echo "#include \"hl_multi_array_header.h\"" >> ${file} echo "" >> ${file} echo "namespace MultiArrayTools" >> ${file} echo "{" >> ${file} @@ -25,7 +25,7 @@ for fff in plus minus multiplies divides ; do file=hl_ops/${fff}.cc test -f ${file} && rm -f ${file} echo "#include \"multi_array_header.h\"" >> ${file} - echo "#include \"high_level_operation.h\"" >> ${file} + echo "#include \"hl_multi_array_header.h\"" >> ${file} echo "" >> ${file} echo "namespace MultiArrayTools" >> ${file} echo "{" >> ${file} @@ -38,7 +38,7 @@ for fff in negate ; do file=hl_ops/${fff}.cc test -f ${file} && rm -f ${file} echo "#include \"multi_array_header.h\"" >> ${file} - echo "#include \"high_level_operation.h\"" >> ${file} + echo "#include \"hl_multi_array_header.h\"" >> ${file} echo "" >> ${file} echo "namespace MultiArrayTools" >> ${file} echo "{" >> ${file} diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index b272f7f..bad8c59 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -32,8 +32,8 @@ target_link_libraries(op3utest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} add_test(NAME op3utest COMMAND op3utest) add_executable(op4utest op4_unit_test.cc) -add_dependencies(op4utest multiarray) -target_link_libraries(op4utest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} multiarray) +add_dependencies(op4utest multiarray hlmultiarray) +target_link_libraries(op4utest ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} multiarray hlmultiarray) add_test(NAME op4utest COMMAND op4utest) add_executable(opptest op_perf_test.cc) diff --git a/src/tests/op4_unit_test.cc b/src/tests/op4_unit_test.cc index 2cd67f5..313b79a 100644 --- a/src/tests/op4_unit_test.cc +++ b/src/tests/op4_unit_test.cc @@ -1,5 +1,6 @@ #include "test_header.h" +#include "hl_multi_array_header.h" #include namespace