Changeset: 75c8b98f381c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=75c8b98f381c
Removed Files:
        monetdb5/scheduler/run_adder.h
        monetdb5/scheduler/run_isolate.h
        monetdb5/scheduler/run_memo.h
Modified Files:
        MonetDB.spec
        NT/mksqlwxs.py
        debian/monetdb5-server.install
        monetdb5/mal/mal_parser.c
        monetdb5/modules/kernel/CMakeLists.txt
        monetdb5/scheduler/CMakeLists.txt
        monetdb5/scheduler/Tests/memo01.malC
        monetdb5/scheduler/Tests/memo02.malC
        monetdb5/scheduler/Tests/sched00.malC
        monetdb5/scheduler/Tests/sched00.stable.out
        monetdb5/scheduler/run_adder.c
        monetdb5/scheduler/run_adder.mal
        monetdb5/scheduler/run_isolate.c
        monetdb5/scheduler/run_isolate.mal
        monetdb5/scheduler/run_memo.c
        monetdb5/scheduler/run_memo.mal
        monetdb5/tools/CMakeLists.txt
Branch: Oct2020
Log Message:

Make microbenchmark, run_{adder,isolate,memo} into stand-alone modules.
And don't install them in the distributed binaries.


diffs (truncated from 666 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -519,8 +519,6 @@ exit 0
 %exclude %{_bindir}/stethoscope
 %{_libdir}/libmonetdb5.so.*
 %dir %{_libdir}/monetdb5
-%{_libdir}/monetdb5/microbenchmark.mal
-%{_libdir}/monetdb5/run_*.mal
 %if %{with cintegration}
 %{_libdir}/monetdb5/lib_capi.so
 %endif
@@ -819,6 +817,10 @@ install -d -m 0775 %{buildroot}%{_rundir
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_opt_sql_append.so
+rm -f %{buildroot}%{_libdir}/monetdb5/run_*.mal
+rm -f %{buildroot}%{_libdir}/monetdb5/lib_run_*.so
+rm -f %{buildroot}%{_libdir}/monetdb5/microbenchmark.mal
+rm -f %{buildroot}%{_libdir}/monetdb5/lib_microbenchmark*.so
 rm -f %{buildroot}%{_bindir}/monetdb_mtest.sh
 rm -rf %{buildroot}%{_datadir}/monetdb # /cmake
 
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -171,11 +171,9 @@ def main():
     print(r'            <Directory Id="lib" Name="lib">')
     print(r'              <Directory Id="monetdb5" Name="monetdb5">')
     id = comp(features, id, 16,
-              [r'lib\monetdb5\microbenchmark.mal'])
-    id = comp(features, id, 16,
-              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('_') and x.endswith('.dll') and ('geom' not in x) and ('pyapi' not 
in x) and ('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 
'lib', 'monetdb5'))))])
+              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('_') and x.endswith('.dll') and ('geom' not in x) and ('pyapi' not 
in x) and ('opt_sql_append' not in x) and ('run_' not in x) and 
('microbenchmark' not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 
'monetdb5'))))])
     id = comp(debug, id, 16,
-              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('_') and x.endswith('.pdb') and ('geom' not in x) and 
('opt_sql_append' not in x), os.listdir(os.path.join(sys.argv[3], 'lib', 
'monetdb5'))))])
+              [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('_') and x.endswith('.pdb') and ('geom' not in x) and 
('opt_sql_append' not in x) and ('run_' not in x) and ('microbenchmark' not in 
x), os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5'))))])
     id = comp(geom, id, 16,
               [r'lib\monetdb5\{}'.format(x) for x in sorted(filter(lambda x: 
x.startswith('_') and (x.endswith('.dll') or x.endswith('.pdb')) and ('geom' in 
x), os.listdir(os.path.join(sys.argv[3], 'lib', 'monetdb5'))))])
     id = comp(pyapi3, id, 16,
diff --git a/debian/monetdb5-server.install b/debian/monetdb5-server.install
--- a/debian/monetdb5-server.install
+++ b/debian/monetdb5-server.install
@@ -1,10 +1,7 @@
 debian/tmp/usr/bin/mserver5 usr/bin
 debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so.* usr/lib/x86_64-linux-gnu
 
-# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{fits,geom,gsl,opt_sql_append,pyapi*,rapi,sql}.so
+# usr/lib/x86_64-linux-gnu/monetdb5/lib_*.so EXCEPT: 
lib_{fits,geom,gsl,microbenchmark,opt_sql_append,pyapi*,rapi,run_*,sql}.so
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_capi.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_generator.so 
usr/lib/x86_64-linux-gnu/monetdb5
 debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/lib_udf.so 
usr/lib/x86_64-linux-gnu/monetdb5
-
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/microbenchmark.mal 
usr/lib/x86_64-linux-gnu/monetdb5
-debian/tmp/usr/lib/x86_64-linux-gnu/monetdb5/run_*.mal 
usr/lib/x86_64-linux-gnu/monetdb5
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -1054,14 +1054,14 @@ parseInclude(Client cntxt)
                return 0;
        }
 
-       /*
-       s = loadLibrary(modnme, FALSE);
-       if (s) {
-               parseError(cntxt, s);
-               freeException(s);
-               return 0;
+       if (getModule(modnme) == NULL) {
+               s = loadLibrary(modnme, FALSE);
+               if (s) {
+                       parseError(cntxt, s);
+                       freeException(s);
+                       return 0;
+               }
        }
-       */
        if ((s = malInclude(cntxt, modnme, 0))) {
                parseError(cntxt, s);
                freeException(s);
diff --git a/monetdb5/modules/kernel/CMakeLists.txt 
b/monetdb5/modules/kernel/CMakeLists.txt
--- a/monetdb5/modules/kernel/CMakeLists.txt
+++ b/monetdb5/modules/kernel/CMakeLists.txt
@@ -7,6 +7,7 @@
 #]]
 
 add_library(kernel OBJECT)
+add_library(microbenchmark MODULE)
 
 target_sources(kernel
   PRIVATE
@@ -20,6 +21,10 @@ target_sources(kernel
   batmmath.c
   batstr.c
   batcolor.c
+  PUBLIC
+  ${CMAKE_CURRENT_SOURCE_DIR}/bat5.h)
+target_sources(microbenchmark
+  PRIVATE
   microbenchmark.c microbenchmark.h
   PUBLIC
   ${CMAKE_CURRENT_SOURCE_DIR}/bat5.h)
@@ -28,6 +33,10 @@ target_include_directories(kernel
   PUBLIC
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
   $<INSTALL_INTERFACE:${INCLUDEDIR}/monetdb>)
+target_include_directories(microbenchmark
+  PUBLIC
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+  $<INSTALL_INTERFACE:${INCLUDEDIR}/monetdb>)
 
 if(WIN32)
   target_compile_definitions(kernel
@@ -38,6 +47,14 @@ if(WIN32)
     LIBOPTIMIZER
     LIBSCHEDULER
     LIBMONETDB5)
+  target_compile_definitions(microbenchmark
+    PRIVATE
+    LIBMAL
+    LIBATOMS
+    LIBKERNEL
+    LIBOPTIMIZER
+    LIBSCHEDULER
+    LIBMONETDB5)
 endif()
 
 target_link_libraries(kernel
@@ -47,12 +64,25 @@ target_link_libraries(kernel
   bat
   mal
   atoms)
+target_link_libraries(microbenchmark
+  PRIVATE
+  monetdb_config_header
+  mutils
+  bat
+  mal
+  atoms)
 
 set_target_properties(kernel
   PROPERTIES
   POSITION_INDEPENDENT_CODE ON
   PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/bat5.h)
+set_target_properties(microbenchmark
+  PROPERTIES
+  OUTPUT_NAME _microbenchmark)
 
+install(TARGETS microbenchmark
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
+  COMPONENT microbenchmark)
 install(FILES
   microbenchmark.mal
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5)
diff --git a/monetdb5/scheduler/CMakeLists.txt 
b/monetdb5/scheduler/CMakeLists.txt
--- a/monetdb5/scheduler/CMakeLists.txt
+++ b/monetdb5/scheduler/CMakeLists.txt
@@ -6,25 +6,19 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V.
 #]]
 
-add_library(scheduler OBJECT)
-
-target_sources(scheduler
+add_library(run_adder MODULE)
+target_sources(run_adder
   PRIVATE
-  run_adder.c run_adder.h
-  run_isolate.c run_isolate.h
-  run_memo.c run_memo.h
-  run_pipeline.c run_pipeline.h)
-
-target_include_directories(scheduler
+  run_adder.c)
+target_include_directories(run_adder
   PRIVATE
   $<TARGET_PROPERTY:mal,INCLUDE_DIRECTORIES>
   $<TARGET_PROPERTY:optimizer,INCLUDE_DIRECTORIES>
   PUBLIC
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
   $<INSTALL_INTERFACE:${INCLUDEDIR}/monetdb>)
-
 if(WIN32)
-  target_compile_definitions(scheduler
+  target_compile_definitions(run_adder
     PRIVATE
     LIBMAL
     LIBATOMS
@@ -33,17 +27,83 @@ if(WIN32)
     LIBSCHEDULER
     LIBMONETDB5)
 endif()
+target_link_libraries(run_adder
+  PRIVATE
+  monetdb_config_header)
+set_target_properties(run_adder
+  PROPERTIES
+  OUTPUT_NAME _run_adder)
+install(TARGETS run_adder
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
+  COMPONENT run_adder)
+install(FILES
+  run_adder.mal
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5)
 
-target_link_libraries(scheduler
+add_library(run_isolate MODULE)
+target_sources(run_isolate
+  PRIVATE
+  run_isolate.c)
+target_include_directories(run_isolate
+  PRIVATE
+  $<TARGET_PROPERTY:mal,INCLUDE_DIRECTORIES>
+  $<TARGET_PROPERTY:optimizer,INCLUDE_DIRECTORIES>
+  PUBLIC
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+  $<INSTALL_INTERFACE:${INCLUDEDIR}/monetdb>)
+if(WIN32)
+  target_compile_definitions(run_isolate
+    PRIVATE
+    LIBMAL
+    LIBATOMS
+    LIBKERNEL
+    LIBOPTIMIZER
+    LIBSCHEDULER
+    LIBMONETDB5)
+endif()
+target_link_libraries(run_isolate
   PRIVATE
   monetdb_config_header)
-
-set_target_properties(scheduler
+set_target_properties(run_isolate
   PROPERTIES
-  POSITION_INDEPENDENT_CODE ON)
-
+  OUTPUT_NAME _run_isolate)
+install(TARGETS run_isolate
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
+  COMPONENT run_isolate)
 install(FILES
-  run_adder.mal
   run_isolate.mal
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5)
+
+add_library(run_memo MODULE)
+target_sources(run_memo
+  PRIVATE
+  run_memo.c)
+target_include_directories(run_memo
+  PRIVATE
+  $<TARGET_PROPERTY:mal,INCLUDE_DIRECTORIES>
+  $<TARGET_PROPERTY:optimizer,INCLUDE_DIRECTORIES>
+  PUBLIC
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+  $<INSTALL_INTERFACE:${INCLUDEDIR}/monetdb>)
+if(WIN32)
+  target_compile_definitions(run_memo
+    PRIVATE
+    LIBMAL
+    LIBATOMS
+    LIBKERNEL
+    LIBOPTIMIZER
+    LIBSCHEDULER
+    LIBMONETDB5)
+endif()
+target_link_libraries(run_memo
+  PRIVATE
+  monetdb_config_header)
+set_target_properties(run_memo
+  PROPERTIES
+  OUTPUT_NAME _run_memo)
+install(TARGETS run_memo
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5
+  COMPONENT run_memo)
+install(FILES
   run_memo.mal
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/monetdb5)
diff --git a/monetdb5/scheduler/Tests/memo01.malC 
b/monetdb5/scheduler/Tests/memo01.malC
--- a/monetdb5/scheduler/Tests/memo01.malC
+++ b/monetdb5/scheduler/Tests/memo01.malC
@@ -24,7 +24,7 @@ include run_memo;
        T3cost:= Ccost+Dcost;
 
        io.printf("choicepoint 1\n");
-       scheduler.choice();
+       run_memo.choice();
 
        T1:= algebra.projection(A,B);
        T1cost:= aggr.count(T1);
@@ -34,7 +34,7 @@ include run_memo;
        T3cost:= aggr.count(T3);
 
        io.printf("choicepoint 2\n");
-       scheduler.choice(T1cost,T1, T2cost,T2, T3cost,T3);
+       run_memo.choice(T1cost,T1, T2cost,T2, T3cost,T3);
 
        T4cost:=T1cost+Ccost; 
        T5cost:=Acost+T2cost; 
@@ -54,7 +54,7 @@ include run_memo;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to