home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / oracle / 2924 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  4.0 KB

  1. Path: sparky!uunet!munnari.oz.au!goanna!escargot!otto!dtb
  2. From: dtb@otto (David Bath)
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: Pro*C and gnu C on SUN
  5. Keywords: proc gnu sun
  6. Message-ID: <dtb.727762908@otto>
  7. Date: 23 Jan 93 04:21:48 GMT
  8. References: <4355@eastman.UUCP>
  9. Organization: RMIT Computer Centre
  10. Lines: 84
  11. NNTP-Posting-Host: otto.bf.rmit.oz.au
  12.  
  13. mahmoud@icts01.kodak.com (Ahmed Mahmoud) writes:
  14.  
  15. >We are planning on using gnu C with pro*c with oracle version 7 on a SUN 670
  16. >running sunos 4.1.2. Does anybody out there have any idea why this should not
  17. >work...has anyone out there tried this combination....has anyone used gnu    with oracle????   thanks for any info on this matter....Ahmed Mahmoud    
  18.  
  19. Re: Pro*C and GNU C on SunOS
  20. ----------------------------
  21.  
  22. The question about Pro*C and Gnu C is an interesting one, and also raises
  23. the issue of WHICH C compiler on the Sun to use of the two supplied as
  24. standard.
  25.  
  26. As background, remember that SunOS stems from the BSD world.  SunOS 4.1
  27. is also known as Solaris 1.  Solaris 2 on the other hand is based on
  28. System V.4.
  29.  
  30. SunOS 4.1 comes standard with TWO C Compilers.
  31.     /bin/cc        The BSD based compiler
  32.             Gets default includes and libraries from
  33.             /usr/include and /usr/lib
  34.     /5bin/cc    The AT&T compiler
  35.             Gets default includes and libraries from
  36.             /usr/5include and /usr/5lib
  37.  
  38. Oracle recommends that when using Pro*C (or even installing and linking
  39. Oracle) you have the /5bin directory ahead of /bin in your PATH variable.
  40.  
  41. This is good practice anyway, because you will get used to the Sys V
  42. versions of commands (df and ps are good examples of this - I usually
  43. create a soft link to /bin/ps and /bin/df as /usr/local/bin/bps and
  44. /usr/local/bin/bdf - a similar practice to HP when they supply both
  45. versions of a utility).
  46.  
  47. The BSD and AT&T compilers use libraries and include files from different
  48. directories, reflecting the system libraries of the two different dialects
  49. of UNIX.  Sometimes the function is just called under another name, sometimes
  50. the number of parameters (and their ordering) is different.
  51.  
  52. GNU compilers and libraries are typically based on BSD.
  53.  
  54. Examples include
  55.     Get working directory        getcwd vs. getwd
  56.     Copy Memory            memcpy vs bcopy
  57.     Compare Memory            memcmp vs bcmp
  58.  
  59. Obviously, if the Oracle libraries have references to the System V version,
  60. they will either be unresolved in the BSD libraries, or worse, resolve to
  61. something inappropriate.
  62.  
  63. You can get around this by one or more of the following
  64.     (1)    Using GNU C, but point at System V libraries
  65.     (2)    Using GNU C and libraries but add in your own, written
  66.         in GNU C that mimic the system V calls.  You'll know
  67.         which ones you need, as they will be the unresolved
  68.         references.  Some of these may simply be stubs that call
  69.         the BSD function of a different name.
  70.     (3)    Stick to /5bin/cc
  71.     (4)    Extract the functions you need from the AT&T libraries
  72.         and add them to your list to be linked in.
  73.  
  74. Look, I know it involves some hacking, but if you are that keen on Gnu C
  75. and only using your products in-house, you should be OK.  I am not knocking
  76. Gnu C, mind you.  Gnu C is a must for many shops developing in-house code
  77. and compiling things from the net.  One R&D shop I worked in tried it out
  78. on our code, and it gave better quality executables than the native HP
  79. compiler at the time !!!!  Nevertheless, we released commercial object and
  80. executables made from the HP product, using GNU for projects only to be
  81. used in house.
  82.  
  83. If anyone gets a problem of this nature because of an unresolved external
  84. and cannot figure out what it is for, drop me an e-line and I'll try and
  85. get back to you soon.  However, I do spend time out of my office and offline
  86. and thus may take some time to get back to you.
  87.  
  88.  
  89. ----
  90. David T. Bath    Email:dtb@otto.bf.rmit.oz.au    Phone:+61-3-3477511
  91. Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
  92. "Failure to emulate is the best revenge" - Marcus Aurelius
  93. -- 
  94. David T. Bath    Email:dtb@otto.bf.rmit.oz.au    Phone:+61-3-3477511
  95. Global Technology Corporation, 179 Grattan St, CARLTON, VIC, 3153, AUSTRALIA
  96. "Failure to emulate is the best revenge" - Marcus Aurelius
  97.