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

"optimizer.h" not found when building FDW for postgreSQL 11 #28

Open
ifarcher opened this issue Jul 6, 2020 · 13 comments
Open

"optimizer.h" not found when building FDW for postgreSQL 11 #28

ifarcher opened this issue Jul 6, 2020 · 13 comments

Comments

@ifarcher
Copy link

ifarcher commented Jul 6, 2020

When we try to build the db2_fdw for PostgreSQL 11, the make process stops with the error telling that file "optimizer.h" is not found.

I had a look at the files contained in the postgresql-server-11-dev package (for debian) and the named file seems not to be part of this package, in contrast to ostgresql-server-12-dev, where it exists.

So maybe db2_fdw can currently not be built for PostgreSQL 10 and 11 because of missing optimizer.h.

Regards,
Ingo

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 6, 2020 via email

@ifarcher
Copy link
Author

ifarcher commented Jul 7, 2020

Thank you for the answer!
We already did that, but that lead to another problem: then in the generated .so-file a symbol was missing, but I cannot exactly remember its name, it was something like "table_...". This "follow-up-error" was thrown on "create extension".
I did not mention that because when I don't know the precise effect of a change (commenting out a header without any knowledge) any resulting error is not significant, i thought.
Regards,
Ingo

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 7, 2020 via email

@ifarcher
Copy link
Author

ifarcher commented Jul 7, 2020 via email

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 7, 2020 via email

@ifarcher
Copy link
Author

ifarcher commented Jul 8, 2020

I assume, for the ZIP file you mean the file you can download when clicking the green "Code" Icon - I cannot see any other ZIP file.

So I did that, but there is no difference to the previous behavior.
We commented out all occurrences of optimizer.h.
The we started make => resulting in a lot of warnings, eg. mentioning "table_open", "table_close" etc.
Then we invoked make install.
Then we created the extension:

Error: could not create extension, symbol "table_open" not found in ___.so.

So I cannot see a difference to previous behavior.
Maybe there should be another ZIP file that i cannot see/find?

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 8, 2020 via email

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 8, 2020 via email

@ifarcher
Copy link
Author

ifarcher commented Jul 9, 2020

Hi, we dont't have concurrent installations - we did all tries on separate ones. (Would you still need the output of "which pg_setup"?
And we are located in Graz.

Greetings,
Ingo

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 9, 2020 via email

@ifarcher
Copy link
Author

Hi,
yes, with PostgreSQL 12 make runs quite fine but "import schema" fails (see my other issue-posting).
Assuming that "import schema" could be working for older postgreSQL versions, we tried it with PG 11.
But for PostgreSQL 11 make fails because of missing optimizer.h, and when we comment that out, it throws a large number of warnings (more than 30).
Trying to create the extension afterwards fails, mentioning missing symbols in the .so file.
The missing symbols seem to correspond to the previous warnings.

Below you can find the requested output of make (gmake not installed):

root@db1:/opt/install/db2_fdw-master# make clean
rm -f db2_fdw.so   libdb2_fdw.a  libdb2_fdw.pc
rm -f db2_fdw.o db2_utils.o db2_fdw.bc db2_utils.bc
rm -rf results/ regression.diffs regression.out tmp_check/ tmp_check_iso/ log/ output_iso/

root@ db1:/opt/install/db2_fdw-master# make -n
gcc -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 -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -g -fPIC -I/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o db2_fdw.o db2_fdw.c
gcc -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 -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -g -fPIC -I/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o db2_utils.o db2_utils.c
gcc -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 -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -shared -o db2_fdw.so db2_fdw.o db2_utils.o -L/usr/lib/x86_64-linux-gnu  -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-7/lib  -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed  -fPIC -L/lib64 -L/bin  -ldb2ci
/usr/bin/clang-7 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -g -fPIC -I/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5 -flto=thin -emit-llvm -c -o db2_fdw.bc db2_fdw.c
/usr/bin/clang-7 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -g -fPIC -I/include -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5 -flto=thin -emit-llvm -c -o db2_utils.bc db2_utils.c

… and the output of psql:

root@db1:/opt/install/db2_fdw-master# psql -U postgres
psql (11.8 (Debian 11.8-1.pgdg100+1))
Type "help" for help.

postgres=#

@devrimgunduz
Copy link

devrimgunduz commented Jul 29, 2020

Hi,

3.0.1 cannot be built against v11 (optimizer.h does not exist in versions less than 12). You will need to add a check around relevant lines.

@wolfgangbrandl
Copy link
Owner

wolfgangbrandl commented Jul 29, 2020 via email

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

3 participants