Commit 86ed2c2b authored by Tiago Peixoto's avatar Tiago Peixoto

Small fixes to allow compilation in MacOS X

parent cee78307
......@@ -21,7 +21,11 @@ fi
aclocal -I m4 || exit $?
autoheader || exit $?
libtoolize -f || exit $?
if [ `type -P libtoolize` ]; then
libtoolize -f || exit $?
else
glibtoolize -f || exit $?
fi
automake --add-missing --copy || exit $?
autoconf || exit $?
......
......@@ -33,6 +33,7 @@ AC_HEADER_STDC
AC_DISABLE_STATIC
LT_INIT
AC_PROG_INSTALL
AC_CANONICAL_TARGET
dnl turn on warnings
[CXXFLAGS="${CXXFLAGS} -Wall"]
......@@ -294,10 +295,12 @@ AC_SUBST(MOD_LIBADD)
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
[MOD_LDFLAGS="-module -avoid-version -export-dynamic -no-undefined -Wl,-E"]
[MOD_LDFLAGS="-module -avoid-version -export-dynamic -no-undefined -Wl,-E -Wl,--as-needed"]
# link libraries as needed
[MOD_LDFLAGS="${MOD_LDFLAGS} -Wl,--as-needed"]
# MacOS needs different options
if test "x${target_os}" = "xdarwin"; then
[MOD_LDFLAGS="-module -dynamiclib"]
fi
AC_SUBST(MOD_LDFLAGS)
......
......@@ -28,6 +28,9 @@
#include <boost/functional/hash.hpp>
#include "graph_util.hh"
#include <ext/numeric>
using __gnu_cxx::power;
namespace graph_tool
{
using namespace std;
......@@ -133,10 +136,10 @@ struct get_geometric
typename graph_traits<Graph>::vertex_descriptor v = vertex(i, g);
get_box(points[i], w, box, ranges, periodic_boundary);
for (size_t k = 0; k < pow(3, box.size()); ++k)
for (int k = 0; k < power(3, int(box.size())); ++k)
{
for (size_t j = 0; j < box.size(); ++j)
box[j] += (int(k / pow(3, j)) % 3) - 1;
for (int j = 0; j < box.size(); ++j)
box[j] += ((k / power(3, j)) % 3) - 1;
if (periodic_boundary)
periodic(box, box_ranges);
......
......@@ -27,7 +27,7 @@
# include <tr1/unordered_set>
#else
# include <boost/tr1/random.hpp>
# include <boost/tr1/unordered_set>
# include <boost/tr1/unordered_set.hpp>
#endif
#include <map>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment