Skip to content

Commit

Permalink
Build-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
glatteis committed Aug 20, 2024
1 parent 12462ac commit 4ce76fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 24 deletions.
19 changes: 0 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,6 @@ RUN apt-get install -y --no-install-recommends \
python3-venv
# Packages maven and uuid-dev are required for carl-parser


# Build carl
############
WORKDIR /opt/

# Obtain carl from public repository
RUN git clone -b $carl_version https://github.com/moves-rwth/carl-storm.git carl

# Switch to build directory
RUN mkdir -p /opt/carl/build
WORKDIR /opt/carl/build

# Configure carl
RUN cmake .. $carl_cmake_args -DCMAKE_BUILD_TYPE=$build_type

# Build carl
RUN make lib_carl -j $no_threads


# Build carl-parser
###################
WORKDIR /opt/
Expand Down
2 changes: 1 addition & 1 deletion examples/pomdp/01-pomdps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def example_parametric_models_01():
return

import stormpy.pars
from pycarl.formula import FormulaType, Relation
from stormpy.pycarl.formula import FormulaType, Relation
if stormpy.info.storm_ratfunc_use_cln():
from stormpy.pycarl.cln import formula
else:
Expand Down
7 changes: 6 additions & 1 deletion resources/include_pybind11.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Always use shipped version of pybind11
#find_package(pybind11 ${PYBIND_VERSION} CONFIG QUIET)
#if(pybind11_FOUND)
# message(STATUS "Stormpy - Using system version of pybind11 (version ${PYBIND_VERSION}).")
#else()
message(STATUS "Stormpy - Using shipped version of pybind11 (version ${PYBIND_VERSION}).")

include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG "v${PYBIND_VERSION}"
PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/resources/pybind11_${PYBIND_VERSION}.patch || git apply ${CMAKE_CURRENT_SOURCE_DIR}/resources/pybind11_${PYBIND_VERSION}.patch --reverse --check
)

FetchContent_MakeAvailable(pybind11)
#endif()
5 changes: 2 additions & 3 deletions src/utility/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
template<typename RationalValueType>
void define_json(py::module& m, std::string const& vtSuffix) {
py::class_<storm::json<RationalValueType>> jsoncont(m, ("JsonContainer" + vtSuffix).c_str(), "Storm-internal container for JSON structures");
// TODO this doesn't compile for some reason
// jsoncont.def("__str__", [](storm::json<RationalValueType> const& container) {return container.dump(4);});
// jsoncont.def("__getitem__", [](storm::json<RationalValueType> const& container, std::string const& item) {return container[item]; });
jsoncont.def("__str__", [](storm::json<RationalValueType> const& container) {return container.dump(4);});
jsoncont.def("__getitem__", [](storm::json<RationalValueType> const& container, std::string const& item) {return container[item]; });
}

template void define_json<double> (py::module& m, std::string const& vtSuffix);
Expand Down

0 comments on commit 4ce76fe

Please sign in to comment.