From 826d49dae1be181d07c084696750e2711a39ca4f Mon Sep 17 00:00:00 2001 From: Volker Fröhlich Date: Jul 30 2016 08:16:54 +0000 Subject: Solve the __throw_bad_alloc issue when importing the extension https://github.com/pgRouting/pgrouting/pull/654 Thanks to Jonathan Wakely --- diff --git a/pgRouting-2.2.3-externC.patch b/pgRouting-2.2.3-externC.patch new file mode 100644 index 0000000..42c774d --- /dev/null +++ b/pgRouting-2.2.3-externC.patch @@ -0,0 +1,76 @@ +--- pgrouting-pgrouting-2.2.3/src/bd_astar/src/bdastar.h.orig 2016-07-30 02:17:53.164557644 +0100 ++++ pgrouting-pgrouting-2.2.3/src/bd_astar/src/bdastar.h 2016-07-30 02:21:13.255188292 +0100 +@@ -31,7 +31,7 @@ + + + #ifdef __cplusplus +-extern "C" ++extern "C" { + #endif + + int bdastar_wrapper(edge_astar_t *edges, size_t count, int maxnode, +@@ -39,7 +39,7 @@ + bool directed, bool has_reverse_cost, + path_element_t **path, size_t *path_count, char **err_msg); + #ifdef __cplusplus +-extern "C" ++} + #endif + + #endif +--- pgrouting-pgrouting-2.2.3/src/pickDeliver/src/pdp.h.orig 2016-07-30 02:17:49.835563790 +0100 ++++ pgrouting-pgrouting-2.2.3/src/pickDeliver/src/pdp.h 2016-07-30 02:21:13.336188142 +0100 +@@ -53,7 +53,7 @@ + + + #ifdef __cplusplus +-extern "C" ++extern "C" { + #endif + int64_t Solver(Customer *c, + size_t total_tuples, +@@ -64,6 +64,6 @@ + size_t *length_results); + + #ifdef __cplusplus +-extern "C" ++} + #endif + +--- pgrouting-pgrouting-2.2.3/src/vrp_basic/src/VRP.h.orig 2016-07-30 02:20:36.515256112 +0100 ++++ pgrouting-pgrouting-2.2.3/src/vrp_basic/src/VRP.h 2016-07-30 02:21:13.461187911 +0100 +@@ -70,7 +70,7 @@ + + + #ifdef __cplusplus +-extern "C" ++extern "C" { + #endif + + int find_vrp_solution(vrp_vehicles_t *vehicles, size_t vehicle_count, +@@ -80,7 +80,7 @@ + vrp_result_element_t **result, size_t *result_count, char **err_msg); + + #ifdef __cplusplus +-extern "C" ++} + #endif + + #endif +--- pgrouting-pgrouting-2.2.3/src/vrppdtw/src/pdp.h.orig 2016-07-30 02:20:34.347260113 +0100 ++++ pgrouting-pgrouting-2.2.3/src/vrppdtw/src/pdp.h 2016-07-30 02:21:13.506187828 +0100 +@@ -168,12 +168,12 @@ + + + #ifdef __cplusplus +-extern "C" ++extern "C" { + #endif + int Solver(customer *c, int total_tuples, int vehicle_count, int capacity , char **msg, path_element **results, int *length_results); + + #ifdef __cplusplus +-extern "C" ++} + #endif + + diff --git a/pgRouting.spec b/pgRouting.spec index 6a44205..d6afc7a 100644 --- a/pgRouting.spec +++ b/pgRouting.spec @@ -1,6 +1,6 @@ Name: pgRouting Version: 2.2.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Provides routing functionality to PostGIS/PostgreSQL Group: Applications/Databases License: GPLv2+ @@ -10,6 +10,10 @@ Source0: https://github.com/pgRouting/pgrouting/archive/pgrouting-%{version}.tar # https://github.com/pgRouting/pgrouting/issues/576 Patch0: %{name}-2.2.3-math.patch +# https://github.com/pgRouting/pgrouting/pull/654 +# undefined symbol: __throw_bad_alloc on installing the extension +Patch1: %{name}-2.2.3-externC.patch + BuildRequires: boost-devel BuildRequires: boost-graph BuildRequires: boost-thread @@ -43,13 +47,13 @@ geospatial routing functionality. %prep %setup -qn pgrouting-pgrouting-%{version} %patch0 -p1 +%patch1 -p1 %build install -d build cd build -%cmake .. \ - -DWITH_DD=ON +%cmake .. make VERBOSE=1 %{?_smp_mflags} @@ -64,6 +68,11 @@ make -C build install DESTDIR=%{buildroot} %{_datadir}/pgsql/extension/* %changelog +* Sat Jul 30 2016 Volker Froehlich - 2.2.3-3 +- Solve __throw_bad_alloc on creating the extension + Thank you, Jonathan Wakely +- Remove obsolete build option + * Thu Jul 28 2016 Volker Froehlich - 2.2.3-2 - Fix the build: https://github.com/pgRouting/pgrouting/issues/576