Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rpath #52

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ set(XEUS_ZMQ_HEADERS
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xdebugger_base.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xeus-zmq.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xmiddleware.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_control_main.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_shell_main.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_zmq.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xserver_zmq_split.hpp
${XEUS_ZMQ_INCLUDE_DIR}/xeus-zmq/xshell_default_runner.hpp
Expand Down Expand Up @@ -177,7 +175,9 @@ set(XEUS_ZMQ_SOURCES
${XEUS_ZMQ_SOURCE_DIR}/server/xpublisher.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xpublisher.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_control_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_control_main.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_shell_main.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_shell_main.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_default.cpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_default.hpp
${XEUS_ZMQ_SOURCE_DIR}/server/xserver_zmq_impl.cpp
Expand All @@ -199,6 +199,12 @@ set(XEUS_ZMQ_SOURCES
# Targets and link
# ================

# Binaries that link with xeus-zmq must be able to find and load
# libzmq. However, since xeus-zmq privately links with libzmq,
# we need to tell cmake to append to rpath directories containing
# linked libraries.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

include(CheckCXXCompilerFlag)

string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
Expand Down
31 changes: 25 additions & 6 deletions include/xeus-zmq/xserver_zmq_split.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,33 @@ namespace xeus
};

XEUS_ZMQ_API
std::unique_ptr<xserver> make_xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh = nl::json::error_handler_t::strict);
std::unique_ptr<xserver>
make_xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh = nl::json::error_handler_t::strict);

XEUS_ZMQ_API
std::unique_ptr<xserver>
make_xserver_control(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh,
std::unique_ptr<xcontrol_runner> control,
std::unique_ptr<xshell_runner> shell);


XEUS_ZMQ_API
std::unique_ptr<xserver>
make_xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh = nl::json::error_handler_t::strict);

XEUS_ZMQ_API
std::unique_ptr<xserver> make_xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh = nl::json::error_handler_t::strict);
std::unique_ptr<xserver>
make_xserver_shell(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh,
std::unique_ptr<xcontrol_runner> control,
std::unique_ptr<xshell_runner> shell);
}

#endif
Expand Down
29 changes: 24 additions & 5 deletions src/server/xserver_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "xeus-zmq/xcontrol_default_runner.hpp"
#include "xeus-zmq/xshell_default_runner.hpp"
#include "xeus-zmq/xserver_control_main.hpp"
#include "xserver_control_main.hpp"

namespace xeus
{
Expand Down Expand Up @@ -39,11 +39,12 @@ namespace xeus
xserver_zmq_split::run_control();
}

std::unique_ptr<xserver> make_xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
std::unique_ptr<xserver>
make_xserver_control_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
{
return std::make_unique<xserver_control_main>
return make_xserver_control
(
context,
config,
Expand All @@ -52,5 +53,23 @@ namespace xeus
std::make_unique<xshell_default_runner>()
);
}


std::unique_ptr<xserver>
make_xserver_control(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh,
std::unique_ptr<xcontrol_runner> control,
std::unique_ptr<xshell_runner> shell)
{
return std::make_unique<xserver_control_main>
(
context,
config,
eh,
std::move(control),
std::move(shell)
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "xeus/xeus_context.hpp"
#include "xeus/xkernel_configuration.hpp"

#include "xeus-zmq.hpp"
#include "xserver_zmq_split.hpp"
#include "xeus-zmq/xeus-zmq.hpp"
#include "xeus-zmq/xserver_zmq_split.hpp"

namespace xeus
{
Expand Down
28 changes: 23 additions & 5 deletions src/server/xserver_shell_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "xeus-zmq/xcontrol_default_runner.hpp"
#include "xeus-zmq/xshell_default_runner.hpp"
#include "xeus-zmq/xserver_shell_main.hpp"
#include "xserver_shell_main.hpp"

namespace xeus
{
Expand Down Expand Up @@ -38,11 +38,12 @@ namespace xeus
xserver_zmq_split::run_shell();
}

std::unique_ptr<xserver> make_xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
std::unique_ptr<xserver>
make_xserver_shell_main(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh)
{
return std::make_unique<xserver_shell_main>
return make_xserver_shell
(
context,
config,
Expand All @@ -51,5 +52,22 @@ namespace xeus
std::make_unique<xshell_default_runner>()
);
}

std::unique_ptr<xserver>
make_xserver_shell(xcontext& context,
const xconfiguration& config,
nl::json::error_handler_t eh,
std::unique_ptr<xcontrol_runner> control,
std::unique_ptr<xshell_runner> shell)
{
return std::make_unique<xserver_shell_main>
(
context,
config,
eh,
std::move(control),
std::move(shell)
);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "xeus/xeus_context.hpp"
#include "xeus/xkernel_configuration.hpp"

#include "xeus-zmq.hpp"
#include "xserver_zmq_split.hpp"
#include "xeus-zmq/xeus-zmq.hpp"
#include "xeus-zmq/xserver_zmq_split.hpp"

namespace xeus
{
Expand Down
14 changes: 0 additions & 14 deletions xeus-zmqConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR};${CMAKE_MODULE_PATH}")
include(CMakeFindDependencyMacro)
find_dependency(nlohmann_json @nlohmann_json_VERSION@ EXACT)
find_dependency(xeus @xeus_REQUIRED_VERSION@)

# On Unix platforms, ZeroMQ is built with autotools and pkg-config is
# required to locate it.
if (WIN32)
find_dependency(ZeroMQ @zeromq_REQUIRED_VERSION@)
else()
# In order to not propagate the build-time requirement for pkg-config, we
# do not propagate the dependency on ZeroMQ.

#find_package(PkgConfig)
#pkg_check_modules(ZeroMQ libzmq>=@zeromq_REQUIRED_VERSION@ REQUIRED)
endif()

find_dependency(cppzmq @cppzmq_REQUIRED_VERSION@)
find_dependency(OpenSSL)

if(NOT TARGET xeus-zmq AND NOT TARGET xeus-zmq-static)
Expand Down