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

update for new polymake and cxxwrap #62

Merged
merged 8 commits into from
Oct 1, 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
2 changes: 1 addition & 1 deletion .github/workflows/test-polymake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
os: [ubuntu-latest, macOS-latest]
julia-version: ['1.6', '~1.10.0-0', '~1.11.0-0', 'nightly']

fail-fast: true
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ find_package(Polymake REQUIRED ${POLYMAKE_MIN_VERSION})
include(CheckCXXCompilerFlag)
include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 14)
# override c++ compat, the interface doesn't really need c++20 and
# the c++ library in some sys-roots doesn't support full c++20
set_target_properties(JlCxx::cxxwrap_julia PROPERTIES INTERFACE_COMPILE_FEATURES "")
set(CMAKE_CXX_STANDARD 17)

SET( CMAKE_CXX_COMPILER "${Polymake_CXX}")
# this is to allow filtering of the -fopenmp flag when building natively
Expand All @@ -22,7 +25,7 @@ if(POLYMAKE_DISABLE_OPENMP)
string(REPLACE "-fopenmp" "" Polymake_CFLAGS ${Polymake_CFLAGS})
string(REPLACE "-fopenmp" "" Polymake_LDFLAGS ${Polymake_LDFLAGS})
endif()
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++14 ${Polymake_CFLAGS}" )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ${Polymake_CFLAGS}" )
SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${Polymake_LDFLAGS}" )
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${Polymake_LDFLAGS}" )

Expand Down
3 changes: 2 additions & 1 deletion include/jlpolymake/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jl_sym_t* typeinfo_symbol_helper(const pm::perl::PropertyValue& p, bool demangle

template <typename T> T to_SmallObject(const pm::perl::PropertyValue& pv)
{
T obj = pv;
T obj;
pv >> obj;
return obj;
};

Expand Down
4 changes: 2 additions & 2 deletions include/jlpolymake/jlpolymake.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#endif

#define JLPOLYMAKE_VERSION_MAJOR 0
#define JLPOLYMAKE_VERSION_MINOR 12
#define JLPOLYMAKE_VERSION_PATCH 1
#define JLPOLYMAKE_VERSION_MINOR 13
#define JLPOLYMAKE_VERSION_PATCH 0

#define __JLPOLYMAKE_STR_HELPER(x) #x
#define __JLPOLYMAKE_STR(x) __JLPOLYMAKE_STR_HELPER(x)
Expand Down
10 changes: 5 additions & 5 deletions include/jlpolymake/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,38 +60,38 @@ template <typename T> struct WrappedSetIterator {
const pm::Set<T>& set;
typename pm::Set<T>::const_iterator iterator;
using value_type = T;
WrappedSetIterator<T>(const pm::Set<T>& S) : set(S), iterator(pm::entire(set)) { }
WrappedSetIterator(const pm::Set<T>& S) : set(S), iterator(pm::entire(set)) { }
};

template<typename TDir>
struct WrappedGraphNodeIterator {
const pm::graph::Graph<TDir>& graph;
typename pm::Nodes<pm::graph::Graph<TDir>>::const_iterator iterator;
using dir = TDir;
WrappedGraphNodeIterator<TDir>(const pm::graph::Graph<TDir>& G) : graph(G), iterator(pm::entire(pm::nodes(graph))) { }
WrappedGraphNodeIterator(const pm::graph::Graph<TDir>& G) : graph(G), iterator(pm::entire(pm::nodes(graph))) { }
};

template<typename TDir>
struct WrappedGraphEdgeIterator {
const pm::graph::Graph<TDir>& graph;
typename pm::Edges<pm::graph::Graph<TDir>>::const_iterator iterator;
using dir = TDir;
WrappedGraphEdgeIterator<TDir>(const pm::graph::Graph<TDir>& G) : graph(G), iterator(pm::entire(pm::edges(graph))) { }
WrappedGraphEdgeIterator(const pm::graph::Graph<TDir>& G) : graph(G), iterator(pm::entire(pm::edges(graph))) { }
};

template <typename T> struct WrappedStdListIterator {
const std::list<T>& list;
typename std::list<T>::const_iterator iterator;
using value_type = T;
WrappedStdListIterator<T>(const std::list<T>& L) : list(L), iterator(list.begin()) { }
WrappedStdListIterator(const std::list<T>& L) : list(L), iterator(list.begin()) { }
};

template <typename S, typename T> struct WrappedMapIterator {
const pm::Map<S,T>& map;
typename pm::Map<S,T>::const_iterator iterator;
using key_type = S;
using mapped_type = T;
WrappedMapIterator<S,T>(const pm::Map<S,T>& M) : map(M), iterator(map.begin()) { }
WrappedMapIterator(const pm::Map<S,T>& M) : map(M), iterator(map.begin()) { }
};

}
Expand Down
5 changes: 3 additions & 2 deletions test-prepare.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Pkg

Pkg.add(name="libcxxwrap_julia_jll", version="0.11.2")
Pkg.add(name="libcxxwrap_julia_jll", version="0.13.2")
Pkg.pin("libcxxwrap_julia_jll")
Pkg.add(name="polymake_jll", version="400.1200.1")
Pkg.add(name="polymake_jll", version="400.1300.1")

using polymake_jll
using libcxxwrap_julia_jll
Expand Down Expand Up @@ -100,6 +100,7 @@ if "--ignore-compat" in ARGS
end
run(`sed -i -e '/^polymake_jll = "~/d' $(jlldir)/Project.toml`)
run(`sed -i -e '/^FLINT_jll = "~/d' $(jlldir)/Project.toml`)
run(`sed -i -e '/^libcxxwrap_julia_jll = "~/d' $(jlldir)/Project.toml`)
Pkg.develop(path="$(jlldir)")
else
Pkg.add("libpolymake_julia_jll")
Expand Down
Loading