Closed demitri closed 4 years ago
Thanks for reporting. The diff below seems to fix it. But I'll wait applying it before I can test pg12 on travis.
diff --git a/Makefile b/Makefile
index 2119c32..5984c26 100644
--- a/Makefile
+++ b/Makefile
@@ -28,10 +28,10 @@ dump.c: prepare
./prepare
prepare: prepare.o q3cube.o q3c_poly.o
- $(CC) prepare.o q3cube.o q3c_poly.o $(MYBINLIBS) -o $@
-
+ $(CC) prepare.o q3cube.o q3c_poly.o $(PG_LDFLAGS) $(LDFLAGS) $(LIBS) $(MYBINLIBS) -o $@
+
gen_data: gen_data.c
- $(CC) $< $(CPPFLAGS) $(MYBINLIBS) -o $@
+ $(CC) $< $(CPPFLAGS)$ $(PG_LDFLAGS) $(MYBINLIBS) -o $@
test: gen_data all
createdb q3c_test
diff --git a/q3c.c b/q3c.c
index 6f1460c..84033d4 100644
--- a/q3c.c
+++ b/q3c.c
@@ -37,7 +37,7 @@
#if PG_VERSION_NUM >= 90300
#include "access/tupmacs.h"
#endif
-#include "nodes/relation.h"
+//#include "nodes/relation.h"
#include "utils/selfuncs.h"
I have finally been able to fix the issue with the compilation and PG 12. After the commit 3824f797fdbdf97dbce1782af7c189441d1e8ad5 (and previous ones) it should now compile without problems.
Thanks! I've been using the patch above for over a week with no problems.
The problem was also that on ubuntu-based systems (like the travis ones), some libraries were moved, so my initial patch didn't actually work, so I had to figure out how to deal with that.
Ah- I was installing it on CentOS, which did work for me.
Hi - I am having a problem with the current Makefile and the 1.8.1 release, getting the same error:
Undefined symbols for architecture x86_64:
"_pg_fprintf", referenced from:
_q3c_dump_prm in q3cube.o
ld: symbol(s) not found for architecture x86_64
This is on macOS 10.14 with both PostgreSQL 12.0 and 12.1. Based on the above patch, the Makefile is missing $(LIBS)
as shown in the patch above under the line:
prepare: prepare.o q3cube.o q3c_poly.o
Returning the variable fixes the problem.
Also (and it's a minor quibble), in the 1.8.1 release, the version number is still "1.8.0".
-DQ3C_VERSION='"'1.8.0'"'
I haven't had a chance to test this on Linux.
Thanks for the report Demitri. Could you please send a patch/pull request against current master, so I can see if it passes the tests. Since I don't have mac, I can't test the patch myself.
Done, thanks!
Thanks, and you can indeed see that many of tests failed. To develop the pg12 patch I spent a lot of time trying to ensure that PG from 9 to 12 compiles. Since I indeed don't have mac, I don't think I can myself fix your patch (I'll likely break mac in the process). You may want to use the if/then clause I have in the makefile for the 12 vs earlier PG version that I use to assemble different library sets.
Thanks for the working patch. But while looking at it I've got the impression that the only problem on Mac was a not-working version determination, rather than the flags. As the MYBINLIBS should have had the LIBS inside it already. So could you please check the current HEAD ? I think it should work fine.
I grabbed the new version and it compiled without a problem. I haven't done a full test (short of time at the moment), but I would guess it's fine. As an FYI, I do get these warnings (they are not new):
q3cube.c:1328:44: warning: format specifies type 'long long' but the argument has type 'q3c_ipix_t' (aka 'long')
[-Wformat]
fprintf(fp, "Q3C_CONST("Q3C_IPIX_FMT")", xbits[i]);
~~~~~~~~~~~~ ^~~~~~~~
q3cube.c:1341:44: warning: format specifies type 'long long' but the argument has type 'q3c_ipix_t' (aka 'long')
[-Wformat]
fprintf(fp, "Q3C_CONST("Q3C_IPIX_FMT")", ybits[i]);
~~~~~~~~~~~~ ^~~~~~~~
q3cube.c:1354:44: warning: format specifies type 'long long' but the argument has type 'q3c_ipix_t' (aka 'long')
[-Wformat]
fprintf(fp, "Q3C_CONST("Q3C_IPIX_FMT")", xbits1[i]);
~~~~~~~~~~~~ ^~~~~~~~~
q3cube.c:1367:44: warning: format specifies type 'long long' but the argument has type 'q3c_ipix_t' (aka 'long')
[-Wformat]
fprintf(fp, "Q3C_CONST("Q3C_IPIX_FMT")", ybits1[i]);
~~~~~~~~~~~~ ^~~~~~~~~
q3cube.c:1372:64: warning: format specifies type 'long long' but the argument has type 'q3c_ipix_t' (aka 'long')
[-Wformat]
Q3C_IPIX_FMT",____xbits,____ybits,____xbits1,____ybits1};\n", hprm->nside);
~~~~~~~~~~~~ ^~~~~~~~~~~
5 warnings generated.
I poked around a bit to see what might be the problem, but didn't find anything obvious. I don't think it's a problem. I didn't see this on CentOS.
Anyway, thanks for the help!
Thanks for checking. (regarding the warnings, I am aware of them, but I don't know an easy fix without hard-coding platform depence; and since it doesn't lead to any issues, I'll skip fixing them)
I also put out the v.1.8.2 version which incorporates the fix
Hello,
I am trying to compile Q3C against PostgreSQL 12RC1 and I get this output:
Is it possible that something changed somewhere in v12? I do see a change in the definition of
fprint
between 11.5 and 12.11.5 (from installed directory)
12RC1:
And this may or may not be helpful.
This is on CentOS Linux with gcc v. 4.8.5. The output on macOS 10.14: