Integrate loading openCypher module procedures
Summary:
All mgp_* symbols are exported from Memgraph executable, no other
symbols should be visible.
The primary C API header, mg_procedure.h, is now part of the
installation. Also, added a shippable query module example.
Directory `query_modules` is meant to contain sources of modules we
write and ship as part of the installation. Currently, there's only an
example module, but there may be potentially more. Some modules could
only be installed as part of the enterprise release.
For Memgraph to load custom procedures, it needs to be started with a
flag pointing to a directory with compiled shared libraries implementing
those procedures.
Reviewers: mferencevic, ipaljak, llugovic, dsantl, buda
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2538
2019-10-31 23:36:34 +08:00
|
|
|
# Memgraph Query Modules CMake configuration
|
|
|
|
# You should use the top level CMake configuration with -DQUERY_MODULES=ON
|
|
|
|
# These modules are meant to be shipped with Memgraph installation.
|
|
|
|
|
2020-02-11 23:39:54 +08:00
|
|
|
project(memgraph_query_modules)
|
Integrate loading openCypher module procedures
Summary:
All mgp_* symbols are exported from Memgraph executable, no other
symbols should be visible.
The primary C API header, mg_procedure.h, is now part of the
installation. Also, added a shippable query module example.
Directory `query_modules` is meant to contain sources of modules we
write and ship as part of the installation. Currently, there's only an
example module, but there may be potentially more. Some modules could
only be installed as part of the enterprise release.
For Memgraph to load custom procedures, it needs to be started with a
flag pointing to a directory with compiled shared libraries implementing
those procedures.
Reviewers: mferencevic, ipaljak, llugovic, dsantl, buda
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2538
2019-10-31 23:36:34 +08:00
|
|
|
|
|
|
|
disallow_in_source_build()
|
|
|
|
|
2024-03-20 17:29:24 +08:00
|
|
|
find_package(fmt REQUIRED)
|
|
|
|
|
Integrate loading openCypher module procedures
Summary:
All mgp_* symbols are exported from Memgraph executable, no other
symbols should be visible.
The primary C API header, mg_procedure.h, is now part of the
installation. Also, added a shippable query module example.
Directory `query_modules` is meant to contain sources of modules we
write and ship as part of the installation. Currently, there's only an
example module, but there may be potentially more. Some modules could
only be installed as part of the enterprise release.
For Memgraph to load custom procedures, it needs to be started with a
flag pointing to a directory with compiled shared libraries implementing
those procedures.
Reviewers: mferencevic, ipaljak, llugovic, dsantl, buda
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2538
2019-10-31 23:36:34 +08:00
|
|
|
# Everything that is installed here, should be under the "query_modules" component.
|
|
|
|
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "query_modules")
|
2019-12-11 18:08:25 +08:00
|
|
|
string(TOLOWER ${CMAKE_BUILD_TYPE} lower_build_type)
|
2022-09-15 17:26:26 +08:00
|
|
|
|
|
|
|
add_library(example_c SHARED example.c)
|
|
|
|
target_include_directories(example_c PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_compile_options(example_c PRIVATE -Wall)
|
2023-11-13 19:08:48 +08:00
|
|
|
target_link_libraries(example_c PRIVATE -static-libgcc -static-libstdc++)
|
2022-09-15 17:26:26 +08:00
|
|
|
# Strip C example in release build.
|
2019-12-11 18:08:25 +08:00
|
|
|
if (lower_build_type STREQUAL "release")
|
2022-09-15 17:26:26 +08:00
|
|
|
add_custom_command(TARGET example_c POST_BUILD
|
|
|
|
COMMAND strip -s $<TARGET_FILE:example_c>
|
|
|
|
COMMENT "Stripping symbols and sections from the C example module")
|
2019-12-11 18:08:25 +08:00
|
|
|
endif()
|
2022-09-15 17:26:26 +08:00
|
|
|
install(PROGRAMS $<TARGET_FILE:example_c>
|
Integrate loading openCypher module procedures
Summary:
All mgp_* symbols are exported from Memgraph executable, no other
symbols should be visible.
The primary C API header, mg_procedure.h, is now part of the
installation. Also, added a shippable query module example.
Directory `query_modules` is meant to contain sources of modules we
write and ship as part of the installation. Currently, there's only an
example module, but there may be potentially more. Some modules could
only be installed as part of the enterprise release.
For Memgraph to load custom procedures, it needs to be started with a
flag pointing to a directory with compiled shared libraries implementing
those procedures.
Reviewers: mferencevic, ipaljak, llugovic, dsantl, buda
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2538
2019-10-31 23:36:34 +08:00
|
|
|
DESTINATION lib/memgraph/query_modules
|
2022-09-15 17:26:26 +08:00
|
|
|
RENAME example_c.so)
|
Integrate loading openCypher module procedures
Summary:
All mgp_* symbols are exported from Memgraph executable, no other
symbols should be visible.
The primary C API header, mg_procedure.h, is now part of the
installation. Also, added a shippable query module example.
Directory `query_modules` is meant to contain sources of modules we
write and ship as part of the installation. Currently, there's only an
example module, but there may be potentially more. Some modules could
only be installed as part of the enterprise release.
For Memgraph to load custom procedures, it needs to be started with a
flag pointing to a directory with compiled shared libraries implementing
those procedures.
Reviewers: mferencevic, ipaljak, llugovic, dsantl, buda
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2538
2019-10-31 23:36:34 +08:00
|
|
|
# Also install the source of the example, so user can read it.
|
2020-03-17 18:06:43 +08:00
|
|
|
install(FILES example.c DESTINATION lib/memgraph/query_modules/src)
|
2019-11-25 22:51:51 +08:00
|
|
|
|
2022-09-15 17:26:26 +08:00
|
|
|
add_library(example_cpp SHARED example.cpp)
|
|
|
|
target_include_directories(example_cpp PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_compile_options(example_cpp PRIVATE -Wall)
|
2023-11-13 19:08:48 +08:00
|
|
|
target_link_libraries(example_cpp PRIVATE -static-libgcc -static-libstdc++)
|
2022-09-15 17:26:26 +08:00
|
|
|
# Strip C++ example in release build.
|
|
|
|
if (lower_build_type STREQUAL "release")
|
|
|
|
add_custom_command(TARGET example_cpp POST_BUILD
|
|
|
|
COMMAND strip -s $<TARGET_FILE:example_cpp>
|
|
|
|
COMMENT "Stripping symbols and sections from the C++ example module")
|
|
|
|
endif()
|
|
|
|
install(PROGRAMS $<TARGET_FILE:example_cpp>
|
|
|
|
DESTINATION lib/memgraph/query_modules
|
|
|
|
RENAME example_cpp.so)
|
|
|
|
# Also install the source of the example, so user can read it.
|
|
|
|
install(FILES example.cpp DESTINATION lib/memgraph/query_modules/src)
|
2020-03-09 18:06:01 +08:00
|
|
|
|
2023-10-26 00:27:44 +08:00
|
|
|
add_library(schema SHARED schema.cpp)
|
|
|
|
target_include_directories(schema PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_compile_options(schema PRIVATE -Wall)
|
2023-11-13 19:08:48 +08:00
|
|
|
target_link_libraries(schema PRIVATE -static-libgcc -static-libstdc++)
|
2023-10-26 00:27:44 +08:00
|
|
|
# Strip C++ example in release build.
|
|
|
|
if (lower_build_type STREQUAL "release")
|
|
|
|
add_custom_command(TARGET schema POST_BUILD
|
|
|
|
COMMAND strip -s $<TARGET_FILE:schema>
|
|
|
|
COMMENT "Stripping symbols and sections from the C++ schema module")
|
|
|
|
endif()
|
|
|
|
install(PROGRAMS $<TARGET_FILE:schema>
|
|
|
|
DESTINATION lib/memgraph/query_modules
|
|
|
|
RENAME schema.so)
|
|
|
|
# Also install the source of the example, so user can read it.
|
|
|
|
install(FILES schema.cpp DESTINATION lib/memgraph/query_modules/src)
|
|
|
|
|
2024-03-20 17:29:24 +08:00
|
|
|
add_library(text SHARED text_search_module.cpp)
|
|
|
|
target_include_directories(text PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
|
|
target_compile_options(text PRIVATE -Wall)
|
|
|
|
target_link_libraries(text PRIVATE -static-libgcc -static-libstdc++ fmt::fmt)
|
|
|
|
# Strip C++ example in release build.
|
|
|
|
if (lower_build_type STREQUAL "release")
|
|
|
|
add_custom_command(TARGET text POST_BUILD
|
|
|
|
COMMAND strip -s $<TARGET_FILE:text>
|
|
|
|
COMMENT "Stripping symbols and sections from the C++ text_search module")
|
|
|
|
endif()
|
|
|
|
install(PROGRAMS $<TARGET_FILE:text>
|
|
|
|
DESTINATION lib/memgraph/query_modules
|
|
|
|
RENAME text.so)
|
|
|
|
# Also install the source of the example, so user can read it.
|
|
|
|
install(FILES text_search_module.cpp DESTINATION lib/memgraph/query_modules/src)
|
|
|
|
|
2022-09-15 17:26:26 +08:00
|
|
|
# Install the Python example and modules
|
|
|
|
install(FILES example.py DESTINATION lib/memgraph/query_modules RENAME py_example.py)
|
2020-04-03 00:00:08 +08:00
|
|
|
install(FILES graph_analyzer.py DESTINATION lib/memgraph/query_modules)
|
2020-10-02 02:51:55 +08:00
|
|
|
install(FILES mgp_networkx.py DESTINATION lib/memgraph/query_modules)
|
|
|
|
install(FILES nxalg.py DESTINATION lib/memgraph/query_modules)
|
2020-04-03 00:00:08 +08:00
|
|
|
install(FILES wcc.py DESTINATION lib/memgraph/query_modules)
|
2023-10-26 00:27:44 +08:00
|
|
|
install(FILES mgps.py DESTINATION lib/memgraph/query_modules)
|
|
|
|
install(FILES convert.py DESTINATION lib/memgraph/query_modules)
|