Skip to content

Commit

Permalink
Making plugin loading work on linux again
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Jan 8, 2016
1 parent 69ead2b commit eb10f54
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
1 change: 1 addition & 0 deletions plugins/parcel/coalescing/CMakeLists.txt
Expand Up @@ -7,6 +7,7 @@ include(HPX_AddLibrary)

macro(add_coalescing_module)
if(HPX_WITH_PARCEL_COALESCING)
message("...")

This comment has been minimized.

Copy link
@hkaiser

hkaiser Jan 8, 2016

Member

This can be removed again, I assume.

This comment has been minimized.

Copy link
@sithhell

sithhell Jan 8, 2016

Author Member

Correct, missed that, thanks.

hpx_debug("add_coalescing_module")
add_hpx_library(parcel_coalescing
PLUGIN
Expand Down
41 changes: 37 additions & 4 deletions src/runtime/components/server/runtime_support_server.cpp
Expand Up @@ -55,6 +55,7 @@
#include <boost/filesystem/convenience.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/thread/locks.hpp>
#include <boost/tokenizer.hpp>

#include <algorithm>
#include <set>
Expand Down Expand Up @@ -1595,10 +1596,26 @@ namespace hpx { namespace components { namespace server

fs::path lib;
try {
std::string component_path;
if (sect.has_entry("path"))
lib = hpx::util::create_path(sect.get_entry("path"));
component_path = sect.get_entry("path");
else
lib = hpx::util::create_path(HPX_DEFAULT_COMPONENT_PATH);
component_path = HPX_DEFAULT_COMPONENT_PATH;

typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep(HPX_INI_PATH_DELIMITER);
tokenizer tokens(component_path, sep);
boost::system::error_code fsec;
for(tokenizer::iterator it = tokens.begin(); it != tokens.end(); ++it)
{
lib = hpx::util::create_path(*it);
fs::path lib_path = lib / std::string(HPX_MAKE_DLL_STRING(component));
if(fs::exists(lib_path, fsec))
{
break;
}
lib.clear();
}

if (sect.get_entry("static", "0") == "1") {
load_component_static(ini, instance,
Expand Down Expand Up @@ -2106,10 +2123,26 @@ namespace hpx { namespace components { namespace server

fs::path lib;
try {
std::string component_path;
if (sect.has_entry("path"))
lib = hpx::util::create_path(sect.get_entry("path"));
component_path = sect.get_entry("path");
else
lib = hpx::util::create_path(HPX_DEFAULT_COMPONENT_PATH);
component_path = HPX_DEFAULT_COMPONENT_PATH;

typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep(HPX_INI_PATH_DELIMITER);
tokenizer tokens(component_path, sep);
boost::system::error_code fsec;
for(tokenizer::iterator it = tokens.begin(); it != tokens.end(); ++it)
{
lib = hpx::util::create_path(*it);
fs::path lib_path = lib / std::string(HPX_MAKE_DLL_STRING(component));
if(fs::exists(lib_path, fsec))
{
break;
}
lib.clear();
}

if (sect.get_entry("static", "0") == "1") {
// FIXME: implement statically linked plugins
Expand Down
5 changes: 5 additions & 0 deletions src/runtime/parcelset/parcelhandler.cpp
Expand Up @@ -656,6 +656,7 @@ namespace hpx { namespace parcelset
boost::unique_lock<mutex_type> l(handlers_mtx_);
handler_key_type key(loc, action);
message_handler_map::iterator it = handlers_.find(key);

if (it == handlers_.end()) {
boost::shared_ptr<policies::message_handler> p;

Expand Down Expand Up @@ -1342,7 +1343,11 @@ namespace hpx { namespace parcelset
"$[hpx.parcel.array_optimization]}",
"enable_security = ${HPX_PARCEL_ENABLE_SECURITY:0}",
"async_serialization = ${HPX_PARCEL_ASYNC_SERIALIZATION:1}",
#if defined(HPX_HAVE_PARCEL_COALESCING)
"message_handlers = ${HPX_PARCEL_MESSAGE_HANDLERS:1}"
#else
"message_handlers = ${HPX_PARCEL_MESSAGE_HANDLERS:0}"
#endif
;

for (plugins::parcelport_factory_base* factory : get_parcelport_factories())
Expand Down
5 changes: 5 additions & 0 deletions src/util/find_prefix.cpp
Expand Up @@ -89,6 +89,11 @@ namespace hpx { namespace util
result += HPX_INI_PATH_DELIMITER;
result += *it;
result += suffix;

result += HPX_INI_PATH_DELIMITER;
result += *it;
result += "/lib";
result += suffix;
}
return result;
}
Expand Down

0 comments on commit eb10f54

Please sign in to comment.