Skip to content

Commit 13709c3

Browse files
authored
Merge pull request #798 from cvvergara/fix/postgres10
Fix/postgres10
2 parents 8249b55 + 38dd4ca commit 13709c3

16 files changed

+146
-732
lines changed

CMakeLists.txt

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,8 @@ if(WIN32)
349349
endif(WIN32)
350350

351351
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPGSQL_VERSION=${PGSQL_VERSION}")
352+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPGSQL_VERSION=${PGSQL_VERSION}")
352353
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DPGSQL_VERSION=${PGSQL_VERSION}")
353-
message(STATUS "PGSQL_VERSION=${PGSQL_VERSION}")
354-
355354

356355

357356
#---------------------------------------------
@@ -482,24 +481,28 @@ endif()
482481
#compiler directives
483482
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
484483

484+
# for UNIX & JENKINS
485485
if(UNIX OR (WIN32 AND NOT MSVC))
486486
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
487487
endif()
488488

489-
490-
CHECK_C_COMPILER_FLAG("-frounding-math" C_COMPILER_SUPPORTS_ROUNDING_MATH)
491-
CHECK_CXX_COMPILER_FLAG("-frounding-math" CXX_COMPILER_SUPPORTS_ROUNDING_MATH)
492-
493-
494489
if(NOT WIN32)
495-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ")
496-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ")
490+
CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC)
491+
CHECK_CXX_COMPILER_FLAG("-fPIC" CXX_COMPILER_SUPPORTS_FPIC)
492+
if(C_COMPILER_SUPPORTS_FPIC)
493+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ")
494+
endif()
495+
if(CXX_COMPILER_SUPPORTS_FPIC)
496+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ")
497+
endif()
497498
endif()
498499

499500
if(WIN32 AND MSVC)
500501
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
501502
endif()
502503

504+
CHECK_C_COMPILER_FLAG("-frounding-math" C_COMPILER_SUPPORTS_ROUNDING_MATH)
505+
CHECK_CXX_COMPILER_FLAG("-frounding-math" CXX_COMPILER_SUPPORTS_ROUNDING_MATH)
503506
if(C_COMPILER_SUPPORTS_ROUNDING_MATH)
504507
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -frounding-math ")
505508
endif()
@@ -511,6 +514,8 @@ endif()
511514
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wconversion -pedantic -Wmissing-prototypes -W -Wunused -Wuninitialized -Wextra -Wdouble-promotion")
512515
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fno-implicit-inline-templates -Wconversion -pedantic -W -Wunused -Wuninitialized -Wextra -Wdouble-promotion")
513516

517+
518+
514519
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
515520

516521
if (PGROUTING_DEBUG)
@@ -589,7 +594,6 @@ add_library(${PGROUTING_LIB_NAME}
589594
${LIBRARY_MODE_TARGET}
590595
${PGROUTING_OBJECTS})
591596

592-
install(TARGETS ${PGROUTING_LIB_NAME} DESTINATION ${LIBRARY_INSTALL_PATH})
593597

594598

595599
if(APPLE)
@@ -618,24 +622,8 @@ add_subdirectory(sql)
618622
#-----------------------------------------------------------------------------
619623
#-----------------------------------------------------------------------------
620624

621-
if (WIN32 AND MSVC)
622-
SET (LIBS_TO_INSTALL "${CMAKE_BINARY_DIR}/lib/Release/libpgrouting-2.5.dll")
623-
else()
624-
SET (LIBS_TO_INSTALL "${CMAKE_BINARY_DIR}/lib/libpgrouting-2.5.so")
625-
endif()
626-
627-
# this will create the commands in the makefile under the install target
628-
#if(UNIX)
629-
# file(GLOB_RECURSE LIBS_TO_INSTALL "${CMAKE_BINARY_DIR}/lib/*.so")
630-
#else()
631-
# file(GLOB_RECURSE LIBS_TO_INSTALL "${CMAKE_BINARY_DIR}/lib/*.dll")
632-
#endif()
633-
634-
message(STATUS "LIBS_TO_INSTALL=${LIBS_TO_INSTALL}")
635-
636-
install(FILES ${LIBS_TO_INSTALL} DESTINATION ${LIB_DIR})
637-
638625

626+
install(TARGETS ${PGROUTING_LIB_NAME} DESTINATION ${LIBRARY_INSTALL_PATH})
639627
install(FILES
640628
${PgRouting_SQL_FILES_TO_INSTALL}
641629
DESTINATION "${SHARE_DIR}"

include/c_common/postgres_connection.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3131
#pragma GCC diagnostic ignored "-pedantic"
3232
#endif
3333

34+
#ifdef __clang__
35+
#pragma clang diagnostic ignored "-pedantic"
36+
#endif
37+
3438
#include <postgres.h>
3539

3640

@@ -40,6 +44,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4044
#pragma GCC diagnostic ignored "-Wunused-parameter"
4145
#endif
4246

47+
#ifdef __clang__
48+
#pragma clang diagnostic ignored "-Wsign-conversion"
49+
#pragma clang diagnostic ignored "-Wunused-parameter"
50+
#endif
51+
4352
#include "executor/spi.h"
4453

4554
#ifdef __GNUC__
@@ -48,12 +57,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4857
#pragma GCC diagnostic pop
4958
#endif
5059

60+
#ifdef __clang__
61+
#pragma clang diagnostic pop
62+
#pragma clang diagnostic pop
63+
#pragma clang diagnostic pop
64+
#endif
65+
5166
#include "utils/builtins.h" // for text_to_cstring
5267

5368
#if PGSQL_VERSION > 92
5469
#include "access/htup_details.h"
5570
#endif
5671

72+
#ifdef __clang__
73+
#pragma clang diagnostic ignored "-Wunused-parameter"
74+
#endif
5775

5876
#ifdef __GNUC__
5977
#pragma GCC diagnostic ignored "-Wunused-parameter"
@@ -66,6 +84,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
6684
#pragma GCC diagnostic pop
6785
#endif
6886

87+
#ifdef __clang__
88+
#pragma clang diagnostic pop
89+
#endif
90+
6991

7092
void pgr_send_error(int errcode);
7193
void pgr_SPI_finish(void);

sql-scripts/scripts/build-extension-file.pl

Lines changed: 0 additions & 151 deletions
This file was deleted.

src/alpha_shape/src/alpha.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2424

2525
#include "c_common/postgres_connection.h"
2626

27+
#if PGSQL_VERSION == 100
28+
#include <float.h>
29+
#endif
30+
2731
#include "catalog/pg_type.h"
2832

2933
#include <stdint.h>

src/common/src/vehicles_input.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2929
#include <float.h>
3030
#endif
3131

32+
#if PGSQL_VERSION == 100
33+
#include <float.h>
34+
#endif
35+
36+
3237
#include "c_types/column_info_t.h"
3338

3439
#include "c_common/debug_macro.h"

src/label_graph/test/doc-pgr_labelGraph.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ SELECT pgr_labelGraph('edge_table', 'id', 'source', 'target', 'subgraph');
1111
OK
1212
(1 row)
1313

14-
SELECT subgraph, count(*) FROM edge_table group by subgraph;
15-
subgraph | count
16-
----------+-------
17-
1 | 16
18-
3 | 1
19-
2 | 1
14+
SELECT DISTINCT subgraph FROM edge_table ORDER BY subgraph;
15+
subgraph
16+
----------
17+
1
18+
2
19+
3
2020
(3 rows)
2121

2222
--q2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\echo --q1
22
SET client_min_messages TO WARNING;
33
SELECT pgr_labelGraph('edge_table', 'id', 'source', 'target', 'subgraph');
4-
SELECT subgraph, count(*) FROM edge_table group by subgraph;
4+
SELECT DISTINCT subgraph FROM edge_table ORDER BY subgraph;
55
\echo --q2

src/pickDeliver/src/pickDeliverEuclidean.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pickDeliverEuclidean(PG_FUNCTION_ARGS) {
288288
values[2] = Int64GetDatum(result_tuples[call_cntr].vehicle_id);
289289
values[3] = Int32GetDatum(result_tuples[call_cntr].vehicle_seq);
290290
values[4] = Int64GetDatum(result_tuples[call_cntr].order_id);
291-
values[5] = Int64GetDatum(result_tuples[call_cntr].stop_type + 1);
291+
values[5] = Int32GetDatum(result_tuples[call_cntr].stop_type + 1);
292292
values[6] = Float8GetDatum(result_tuples[call_cntr].cargo);
293293
values[7] = Float8GetDatum(result_tuples[call_cntr].travelTime);
294294
values[8] = Float8GetDatum(result_tuples[call_cntr].arrivalTime);

0 commit comments

Comments
 (0)