Re: dostats and AIX
Posted in 2010
Joerg couldn't compile Art Kagel's dostats utility on AIX (CSDK 3.5.0UC6, gcc). An earlier "gcc: cannot exec cc1" error was fixed by reinstalling the GNU cpp module; Frank Langelage noted he hit the same error and solved it by adding -static to the platform flags, and suggested using the CSDK's esql rather than 'esql for AIX'. The remaining issue is AIX declaring getopt() in stdlib.h, clashing with dostats' own getopt.h. Art suggested moving the #include "getopt.h" above stdio.h, but Joerg reported no change; no resolution is recorded, with Art saying he'd test on an AIX box later.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Platform-Specific Issues
OKI, this was a misunderstanding from my side to comment out this line. But to my surprise nothing of the output changes. The line now again reads: #include "getopt.h" /* Not <getopt.h> need the delivered header. */ Changes in dostats_ng.ec, right? Commenting out this line or not does not change anything of the output! I'm sure that the problem is in front of MY monitor, but what can still be wrong? BTW: 'dbdelete' compiled without any problem. BTW2: No, I don't have access to AIX xLc compiler. Regards
Art, Is it possible that YOUR 'getopt' is ignored somehow and 'getopt' of AIX' stdlib.h is used (just a C noob guess)? If yes - what would be the solution? Many thanks Joerg
AARRGGHH!! I have more trouble with IBM and AIX than ANY OTHER platform! You are probably correct. The reference to getopt() does not belong in stdlib.h! On every other platform that I know about getopt is either defined in getopt.h only or getopt.h is included in unistd.h, so either way my version just replaces the default one for direct inclusion or the direct inclusion sets the semaphore define preventing unistd.h from including the default version. I can get access to an AIX system to test this, but not right now, so you can try the following: Move the #include "getopt.h" line up above the #include <stdio.h> on line 60. If that doesn't work let me know and I'll get onto the AIX system that I have access to later in the week and figure it out. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Mon, Aug 23, 2010 at 12:29 PM, JOERG REDEMANN <joerg.redemann@sabre.com>wrote: > Art, > > Is it possible that YOUR 'getopt' is ignored somehow and 'getopt' of AIX' > stdlib.h is used (just a C noob guess)? > > If yes - what would be the solution? > > Many thanks > > Joerg > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --0016e64f8f486b8288048e8115ec
Just for your your information. I tried to build the latest dostats in AIX 5.3, also using CSDK 3.5.0UC6 but gcc version 3.2. The only changes I had to modify the platform flags to add -static. That's because our gcc was compiled with "--disable-shared". Before adding "-static" I got the same error as the OP: gcc: error trying to exec 'cc1': execvp: No such file or directory. @OP: why did you install 'esql for AIX'. I've no experience with that and I believe it's no longer needed these days. Try a build with original esql/esqlc from the CSDK. Regards, Frank On 23.08.10 19:36, Art Kagel wrote: > AARRGGHH!! I have more trouble with IBM and AIX than ANY OTHER platform! > You are probably correct. The reference to getopt() does not belong in > stdlib.h! On every other platform that I know about getopt is either > defined in getopt.h only or getopt.h is included in unistd.h, so either way > my version just replaces the default one for direct inclusion or the direct > inclusion sets the semaphore define preventing unistd.h from including the > default version. > > I can get access to an AIX system to test this, but not right now, so you > can try the following: > > Move the #include "getopt.h" line up above the #include<stdio.h> on line > 60. If that doesn't work let me know and I'll get onto the AIX system that > I have access to later in the week and figure it out. > > Art > > Art S. Kagel > Advanced DataTools (www.advancedatatools.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions and > do not reflect on my employer, Advanced DataTools, the IIUG, nor any other > organization with which I am associated either explicitly, implicitly, or by > inference. Neither do those opinions reflect those of other individuals > affiliated with any entity with which I am affiliated nor those of the > entities themselves. > > On Mon, Aug 23, 2010 at 12:29 PM, JOERG REDEMANN > <joerg.redemann@sabre.com>wrote: > >> Art, >> >> Is it possible that YOUR 'getopt' is ignored somehow and 'getopt' of AIX' >> stdlib.h is used (just a C noob guess)? >> >> If yes - what would be the solution? >> >> Many thanks >> >> Joerg >> >> >> >> > ******************************************************************************* >> Forum Note: Use "Reply" to post a response in the discussion forum. >> >> > --0016e64f8f486b8288048e8115ec > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > >
Thanks Frank. The OP was able to resolve the "No such file" problem by reinstalling the GNU cpp module. The remaining problem is related to IBM putting the prototype for getopt() into stdlib.h where it doesn't belong. Hopefully the last workaround I suggested below will do the trick. Otherwise I'll be logging on to an AIX machine to hack it out. The real problem is that AIX is the last remaining UNIX OS (OK besides Open BSD) based on the BSD model rather than on the model followed by System V.4 and the Posix standard. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Mon, Aug 23, 2010 at 4:39 PM, Frank Langelage <frank@lafr.de> wrote: > Just for your your information. > I tried to build the latest dostats in AIX 5.3, also using CSDK 3.5.0UC6 > but gcc version 3.2. > The only changes I had to modify the platform flags to add -static. > That's because our gcc was compiled with "--disable-shared". > Before adding "-static" I got the same error as the OP: gcc: error > trying to exec 'cc1': execvp: No such file or directory. > > @OP: why did you install 'esql for AIX'. I've no experience with that > and I believe it's no longer needed these days. > Try a build with original esql/esqlc from the CSDK. > > Regards, Frank > > On 23.08.10 19:36, Art Kagel wrote: > > AARRGGHH!! I have more trouble with IBM and AIX than ANY OTHER platform! > > You are probably correct. The reference to getopt() does not belong in > > stdlib.h! On every other platform that I know about getopt is either > > defined in getopt.h only or getopt.h is included in unistd.h, so either > way > > my version just replaces the default one for direct inclusion or the > direct > > inclusion sets the semaphore define preventing unistd.h from including > the > > default version. > > > > I can get access to an AIX system to test this, but not right now, so you > > can try the following: > > > > Move the #include "getopt.h" line up above the #include<stdio.h> on line > > 60. If that doesn't work let me know and I'll get onto the AIX system > that > > I have access to later in the week and figure it out. > > > > Art > > > > Art S. Kagel > > Advanced DataTools (www.advancedatatools.com) > > IIUG Board of Directors (art@iiug.org) > > > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and > > do not reflect on my employer, Advanced DataTools, the IIUG, nor any > other > > organization with which I am associated either explicitly, implicitly, or > by > > inference. Neither do those opinions reflect those of other individuals > > affiliated with any entity with which I am affiliated nor those of the > > entities themselves. > > > > On Mon, Aug 23, 2010 at 12:29 PM, JOERG REDEMANN > > <joerg.redemann@sabre.com>wrote: > > > >> Art, > >> > >> Is it possible that YOUR 'getopt' is ignored somehow and 'getopt' of > AIX' > >> stdlib.h is used (just a C noob guess)? > >> > >> If yes - what would be the solution? > >> > >> Many thanks > >> > >> Joerg > >> > >> > >> > >> > > > > ******************************************************************************* > >> Forum Note: Use "Reply" to post a response in the discussion forum. > >> > >> > > --0016e64f8f486b8288048e8115ec > > > > > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001636ed6fc2b1d726048e83e6c2
Art, sorry to disappoint you - placing #include "getopt.h" in front of any other 'include' does not change anything. I tried before stdlib.sh and before stdio.h. No changes in output. Thanks again in advance. Joerg