Skip to content

Commit

Permalink
Build without boost::serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape committed Aug 7, 2019
1 parent 117b6ef commit dc02ac6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ endif()

if(WITH_BOOST_FS)
message(STATUS "With boost filesystem")
find_package(Boost 1.63.0 COMPONENTS system filesystem serialization REQUIRED)
find_package(Boost 1.63.0 COMPONENTS system filesystem REQUIRED)
add_definitions(-DWITH_BOOST_FS)
SET(FILESYSTEM_LIBRARIES "${Boost_FILESYSTEM_LIBRARY};${Boost_SYSTEM_LIBRARY}")
else()
Expand Down
12 changes: 10 additions & 2 deletions include/nifty/skeletons/evaluation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#include "boost/geometry/index/rtree.hpp"
#include "boost/serialization/map.hpp"
#include "boost/serialization/unordered_map.hpp"
#include "boost/archive/binary_iarchive.hpp"
#include "boost/archive/binary_oarchive.hpp"
// can't build with boost serialization
//#include "boost/archive/binary_iarchive.hpp"
//#include "boost/archive/binary_oarchive.hpp"

#include "nifty/z5/z5.hxx"
#include "nifty/parallel/threadpool.hxx"
Expand Down Expand Up @@ -70,6 +71,8 @@ namespace skeletons {
// API
public:

// needs boost serialization
/*
// constructor from serialization
SkeletonMetrics(const std::string & segmentationPath,
const std::string & skeletonTopFolder,
Expand All @@ -79,6 +82,7 @@ namespace skeletons {
skeletonIds_(skeletonIds){
deserialize(dictSerialization);
}
*/

// constructor from data
SkeletonMetrics(const std::string & segmentationPath,
Expand Down Expand Up @@ -135,6 +139,9 @@ namespace skeletons {
// the label id(s) that contain the merge
void getNodesInFalseMergeLabels(std::map<std::size_t, std::vector<std::size_t>> &, const int) const;

// we can't build with boost::serialization right now
// best would be to reimplement this
/*
// serialize and deserialize node dictionary with boost::serialization
void serialize(const std::string & path) const {
std::ofstream os(path.c_str(), std::ofstream::out | std::ofstream::binary);
Expand All @@ -147,6 +154,7 @@ namespace skeletons {
boost::archive::binary_iarchive iarch(is);
iarch >> skeletonDict_;
}
*/

// group skeleton to blocks (= chunks of the segmentation)
void groupSkeletonBlocks(SkeletonBlockStorage &, std::vector<std::size_t> &, parallel::ThreadPool &);
Expand Down
1 change: 0 additions & 1 deletion src/python/lib/skeletons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ addPythonModule(
LIBRRARIES
${Z5_COMPRESSION_LIBRARIES}
${FILESYSTEM_LIBRARIES}
${Boost_SERIALIZATION_LIBRARY}
Threads::Threads
)
14 changes: 8 additions & 6 deletions src/python/lib/skeletons/evaluation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ namespace skeletons {
py::class_<SelfType>(module, "SkeletonMetrics")
.def(py::init<const std::string &, const std::string &,
const std::vector<std::size_t> &, const int>())
.def(py::init<const std::string &, const std::string &,
const std::vector<std::size_t> &, const std::string &>())
// can't build with boost serialization
//.def(py::init<const std::string &, const std::string &,
// const std::vector<std::size_t> &, const std::string &>())
//
.def("getNodeAssignments", [](const SelfType & self){return self.getNodeAssignments();})
.def("computeSplitScores", [](const SelfType & self, const int numberOfThreads){
Expand Down Expand Up @@ -86,10 +87,11 @@ namespace skeletons {
return out;
}, py::arg("resolution"), py::arg("numberOfThreads")=-1)
//
.def("serialize", [](const SelfType & self,
const std::string & serializationPath){
self.serialize(serializationPath);
}, py::arg("serializationPath"))
// can't build with boost serialization
//.def("serialize", [](const SelfType & self,
// const std::string & serializationPath){
// self.serialize(serializationPath);
//}, py::arg("serializationPath"))
//
.def("mergeFalseSplitNodes", [](const SelfType & self, const int numberOfThreads){
std::map<std::size_t, std::set<std::pair<std::size_t, std::size_t>>> out;
Expand Down

0 comments on commit dc02ac6

Please sign in to comment.