1

I've a simple C code which I'm trying to compile on RHEL 8 machine wherein Oracle 19c client is installed. Here's the program:

#include <stdlib.h>
/* #include <math.h> */
#include <stdio.h>

void main()
{
  printf("\nHey!!\n");
}

This code gets compiled well with gcc as well as proc (Pro*C pre-compiler) commands.

But once I uncomment #include <math.h>, a lot of syntax errors are reported when proc command is run.

Command that I'm running is:

proc iname=test.c oname=test.cp \
                          include=/usr/lib/gcc/x86_64-redhat-linux/8/include/ \
                          include=. \
                          userid=<db connection string> \
                          sqlcheck=full \
                          define=ORACLE_PRECOMPILE \
                          code=ansi_c \
                          char_map=string \
                          dbms=v8 \
                          lines=yes \
                          ltype=long \
                          oraca=yes \
                          parse=full \
                          select_error=yes \
                          unsafe_null=yes

Syntax errors reported are (copying couple of errors only):

Syntax error at line 62, column 1, file /usr/include/bits/mathcalls.h:
Error at line 62, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (cos,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:

   ; , = ( [
The symbol ";" was substituted for "extern" to continue.

Syntax error at line 64, column 1, file /usr/include/bits/mathcalls.h:
Error at line 64, column 1 in file /usr/include/bits/mathcalls.h
__MATHCALL_VEC (sin,, (_Mdouble_ __x));
1
PCC-S-02201, Encountered the symbol "extern" when expecting one of the following
:

   ; , = ( [
The symbol ";" was substituted for "extern" to continue.

This same command works well when #include <math.h> is commented.

Also, this command works fine on old RHEL 6 machine even when math.h is included (of course after changing include path to RHEL 6 machine's include directory).

I tried searching for solution of this problem on internet but couldn't find any helpful article.

OS version:

cat os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"

Any help on this will be very useful.

Kailash
  • 53
  • 8
  • 1
    you can [edit] your question to add that info. – जलजनक Apr 13 '22 at 14:32
  • Apparently the header file "math.h" contains code that "proc" does not understand. Investigate this further. – the busybee Apr 13 '22 at 14:58
  • 3
    This seems to be a [known issue](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2709148_1.html) with Pro*C on RHEL 8. (Note: it appears that an Oracle support subscription is required to access the details behind that link.) – John Bollinger Apr 13 '22 at 15:41
  • Ooof. Over a year, and Oracle still doesn't support RHEL 8?!?! RHEL 8 was released almost three years ago. – Andrew Henle Apr 13 '22 at 15:47
  • Thanks John. 4 solutions are mentioned in the link you referred, I tried one I found least intrusive and it worked. – Kailash Apr 13 '22 at 16:10

1 Answers1

0

I had the dame issue and simply added the line

define=_MATH_H

to the pcscfg.cfg located in the $ORACLE_HOME/precomp/admin directory which fixed the issue for me.

Dave
  • 1