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

build issue with PostgreSQL 12 #12

Open
githubgrscporg opened this issue Nov 8, 2019 · 0 comments
Open

build issue with PostgreSQL 12 #12

githubgrscporg opened this issue Nov 8, 2019 · 0 comments

Comments

@githubgrscporg
Copy link

System is Ubuntu Linux, 18.04, both postgresql and pgsphere built from source
pgsphere is unzip'd to postgresql-12.0/contrib/pgsphere-master

"make" results in:

rm -f pg_sphere.so libpg_sphere.a libpg_sphere.pc
rm -f pg_sphere--1.0.sql
rm -f sscan.o sparse.o sbuffer.o vector3d.o point.o euler.o circle.o line.o ellipse.o polygon.o path.o box.o output.o gq_cache.o gist.o key.o gnomo.o sscan.bc sparse.bc sbuffer.bc vector3d.bc point.bc euler.bc circle.bc line.bc ellipse.bc polygon.bc path.bc box.bc output.bc gq_cache.bc gist.bc key.bc gnomo.bc
rm -rf pg_sphere--1.0.sql pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql pgs_box.sql pgs_contains_ops.sql pgs_contains_ops_compat.sql pgs_gist.sql gnomo.sql
rm -rf results/ regression.diffs regression.out tmp_check/ tmp_check_iso/ log/ output_iso/
make -C ../../src/backend generated-headers
make[1]: Entering directory '/scratch0/local/src/postgresql-12.0/src/backend'
make -C catalog distprep generated-header-symlinks
make[2]: Entering directory '/scratch0/local/src/postgresql-12.0/src/backend/catalog'
make[2]: Nothing to be done for 'distprep'.
make[2]: Nothing to be done for 'generated-header-symlinks'.
make[2]: Leaving directory '/scratch0/local/src/postgresql-12.0/src/backend/catalog'
make -C utils distprep generated-header-symlinks
make[2]: Entering directory '/scratch0/local/src/postgresql-12.0/src/backend/utils'
make[2]: Nothing to be done for 'distprep'.
make[2]: Nothing to be done for 'generated-header-symlinks'.
make[2]: Leaving directory '/scratch0/local/src/postgresql-12.0/src/backend/utils'
make[1]: Leaving directory '/scratch0/local/src/postgresql-12.0/src/backend'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o sscan.o sscan.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o sparse.o sparse.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o sbuffer.o sbuffer.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o vector3d.o vector3d.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o point.o point.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o euler.o euler.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o circle.o circle.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o line.o line.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o ellipse.o ellipse.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -fPIC -I. -I. -I../../src/include -D_GNU_SOURCE -c -o polygon.o polygon.c
polygon.c: In function ‘spherepoly_in’:
polygon.c:827:3: error: ISO C90 forbids variable length array ‘arr’ [-Werror=vla]
SPoint arr[nelem];
^~~~~~
polygon.c: In function ‘spherepoly_area’:
polygon.c:895:2: error: ISO C90 forbids variable length array ‘s’ [-Werror=vla]
SPoint s[poly->npts + 2];
^~~~~~
cc1: some warnings being treated as errors
: recipe for target 'polygon.o' failed
make: *** [polygon.o] Error 1

I am not a C programmer, and I was unable to successfully modify the pgsphere code, nor was I successful in using c99 rather then gcc as the compiler (a suggestion found while searching the above errors). But I was able to get this to build making the following change in postgresql-12.0/src/Makefile.global:

--- Makefile.global.original 2019-10-28 15:44:22.976557899 -0700
+++ Makefile.global 2019-10-28 16:46:10.969861000 -0700
@@ -257,7 +257,7 @@
GCC = yes
SUN_STUDIO_CC = no
CXX = g++
-CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2
+CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2
CFLAGS_VECTOR = -funroll-loops -ftree-vectorize
CFLAGS_SSE42 = -msse4.2
CFLAGS_ARMV8_CRC32C =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant