laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
496 stars 156 forks source link

Encountered make issue related to missing oci.h file #647

Closed andersmd7 closed 9 months ago

andersmd7 commented 9 months ago

I am encountering an issue during the make step that is slightly different from the other reported issues related to the make step. I am running PostgreSQL 12 on an Oracle Linux 8 server (I know... Gross). I installed Oracle Instant Client following these instructions, and set $ORACLE_HOME to /usr/lib/oracle/21/client64, which seems to be the proper location.

After issuing make, I received the following:

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 -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I"/sdk/include" -I"/oci/include" -I"/rdbms/public" -I"/"  -I. -I./ -I/usr/pgsql-12/include/server -I/usr/pgsql-12/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o oracle_fdw.o oracle_fdw.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 -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I"/sdk/include" -I"/oci/include" -I"/rdbms/public" -I"/"  -I. -I./ -I/usr/pgsql-12/include/server -I/usr/pgsql-12/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o oracle_utils.o oracle_utils.c
oracle_utils.c:22:10: fatal error: oci.h: No such file or directory
 #include <oci.h>
          ^~~~~~~
compilation terminated.
make: *** [<builtin>: oracle_utils.o] Error 1

I'm sorry of this is a dumb/obvious issue, but appreciate any help you can provide, and thank you for your contribution with this package!

andersmd7 commented 9 months ago

Actually, I see now this is an apparent duplicate of #447 . I'd previously installed oracle-instantclient-basic instead of oracle-instantclient-devel

laurenz commented 9 months ago

The same problem was also reported in #286, #403 and #405. Yes, you need to install the package with the C headers and the "basic" or "basiclite" package.

andersmd7 commented 9 months ago

Yes, I realized that the original search I performed in the issue tracker had been limited to open issues. Sorry!

Thank you! I've made it through the whole process to where I should be able to do CREATE EXTENSION oracle_fdw, and I'm receiving:

ERROR:  could not open extension control file "/usr/pgsql-12/share/extension/oracle_fdw.control": No such file or directory
SQL state: 58P01

It's there....

ll /usr/pgsql-12/share/extension/oracle_fdw.control
-rw-r--r--. 1 root root 133 Feb  7 15:56 /usr/pgsql-12/share/extension/oracle_fdw.control

Possibly this is the same issue as #646. Ownership of that file is the same as all other .control files in the directory. I restarted the database server.

andersmd7 commented 9 months ago

Arggh. Please disregard the comment above! In my case, the explanation was the dumbest one possible (I connected to the wrong server).

laurenz commented 9 months ago

Thanks for the feedback that the problem is resolved. I am glad I could help.