Re: newbie esql question
Posted in 2008
Topics: Installation, Setup & Upgrades, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration, Java & JDBC Development, Versions, Editions & End-of-Life
petelink1@yahoo.com wrote:
Seems like a problem with GCC now. You're on AIX. Do you have the
native C compiler (xlc?) installed? If so, try using that and see what
happens. The message about the -b option is a common problem trying to
use gcc with ESQL/C on AIX. The esql script is passing args, like -b,
that are correct for the native xlc compiler (probably called as simply
cc but it's the same on AIX) but that are either ignored or have
different meaning to gcc. You may have to edit the esql script to be
able to use gcc safely. I did. Don't remember the changes though and
I'm out of BB, so I no longer have access to those changes.
Art S. Kagel
Oninit
> On Apr 4, 12:43 pm, "Art S. Kagel (Oninit)" <a...@oninit.com> wrote:
>
>> peteli...@yahoo.com wrote:
>>
>>> Art,
>>> Thanks for the response. After navigating the IBM site slightly
>>> differently than last time, I was able to download
>>> a file - clientsdk.2.90.FC4.AIX5L.tar.
>>>
>>> So should I uninstall the 32-bit CSDK first, then re-install IDS? Or
>>> just re-install IDS, then install the 64-bit CSDK?
>>>
>> Just reinstall IDS. If you decide to install the CSDK in the same
>> INFORMIXDIR you would do that afterward. There's no need to uninstall.
>>
>>
>>> Also, what would be a good way to split out the 64-bit CSDK install,
>>> so that I know that it doesn't conflict with the IDS 9.4 FC6 files?
>>> Or is it a non-issue now that I have a 64-bit CSDK?
>>>
>> Your choice. Jonathan Leffler has every version of C4Gl, ESQL/C and the
>> CSDK there ever have been all installed concurrently in different
>> directories and to my knowledge all of them can be used to create apps
>> that access the database servers running on his machine (or which there
>> are also several versions running concurrently much of the time). All
>> you need to do is set INFORMIXDIR to the CSDK directory to compile and
>> link and set INFORMIXSQLHOSTS to the path to the sqlhosts file if it is
>> not in $INFORMIXDIR/etc to run apps and all will be well. In that case
>> you can even use the 32bit CSDK to access the 64bit engine using TCP/IP
>> or strpip connections (just not using ipcshm connections). I have done
>> this myself to validate new CSDK versions before rolling out to production.
>>
>>
>>> If I install CSDK to a different directory than INFORMIXDIR, what
>>> issues will I face in the future? Are they issues just at compile
>>> time, or will I need to re-configure my informix .profile, job
>>> scripts, etc.?
>>>
>> None other than having to set up the runtime environment of the apps
>> correctly, and we always have that one no matter what we do.
>>
>> Art S. Kagel
>> Oninit
>>
>>
>
> Art,
> I re-installed IDS 9.40 FC6 in the default /digi/informix and then
> CSDK 2.90.FC4 in /digi/CSDK.
>
> Below are my settings and the results of my attempt to compile:
>
> digiadm@phms2a:/digi/acct/digiadm $echo $PATH
> /digi/CSDK:/digi/CSDK/bin:/digi/CSDK/lib:/digi/informix/bin:/digi/
> informix/lib:/
> digi/informix/ISA/sbin:/usr/local/bin:/digi/local:/usr/bin:/etc:/usr/
> sbin:/usr/u
> cb:/usr/bin/X11:/sbin:/usr/java131/jre/bin:/usr/java131/bin:/usr/
> localsys/bin:/u
> sr/local/bin:.:/digi/acct/digiadm:
>
> digiadm@phms2a:/digi/acct/digiadm/dostats $echo $INFORMIXDIR
> /digi/CSDK
>
> digiadm@phms2a:/digi/CSDK/bin $check_version csdk
> Currently installed version: 2.90.FC4
>
> digiadm@phms2a:/digi/acct/digiadm/dostats $/opt/freeware/bin/make
> INFORMIXC=gcc esql -o dostats dostats.ec getopt.c> gcc: '-b' must come at the start of the command line
> make: *** [dostats] Error 1
>
> Then I changed the Makefile option to CC="gcc -b"
>
> digiadm@phms2a:/digi/acct/digiadm/dostats $/opt/freeware/bin/make
> INFORMIXC="gcc -b" esql -o dostats dostats.ec getopt.c> gcc: couldn't run '-qchars=signed-gcc-4.0.0': No such file or
> directory
> make: *** [dostats] Error 1
>
> What do you think is missing?
>
> Thanks again to you and Jonathan.
>
> --pete link
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>
>
On Apr 5, 9:40 pm, "Art S. Kagel (Oninit)" <a...@oninit.com> wrote:
> peteli...@yahoo.com wrote:
>
> Seems like a problem with GCC now. You're on AIX. Do you have the
> native C compiler (xlc?) installed? If so, try using that and see what
> happens. The message about the -b option is a common problem trying to
> use gcc with ESQL/C on AIX. The esql script is passing args, like -b,
> that are correct for the native xlc compiler (probably called as simply
> cc but it's the same on AIX) but that are either ignored or have
> different meaning to gcc. You may have to edit the esql script to be
> able to use gcc safely. I did. Don't remember the changes though and
> I'm out of BB, so I no longer have access to those changes.
>
> Art S. Kagel
> Oninit
>
> > On Apr 4, 12:43 pm, "Art S. Kagel (Oninit)" <a...@oninit.com> wrote:
>
> >> peteli...@yahoo.com wrote:
>
> >>> Art,
> >>> Thanks for the response. After navigating the IBM site slightly
> >>> differently than last time, I was able to download
> >>> a file - clientsdk.2.90.FC4.AIX5L.tar.
>
> >>> So should I uninstall the 32-bit CSDK first, then re-install IDS? Or
> >>> just re-install IDS, then install the 64-bit CSDK?
>
> >> Just reinstall IDS. If you decide to install the CSDK in the same
> >> INFORMIXDIR you would do that afterward. There's no need to uninstall.
>
> >>> Also, what would be a good way to split out the 64-bit CSDK install,
> >>> so that I know that it doesn't conflict with the IDS 9.4 FC6 files?
> >>> Or is it a non-issue now that I have a 64-bit CSDK?
>
> >> Your choice. Jonathan Leffler has every version of C4Gl, ESQL/C and the
> >> CSDK there ever have been all installed concurrently in different
> >> directories and to my knowledge all of them can be used to create apps
> >> that access the database servers running on his machine (or which there
> >> are also several versions running concurrently much of the time). All
> >> you need to do is set INFORMIXDIR to the CSDK directory to compile and
> >> link and set INFORMIXSQLHOSTS to the path to the sqlhosts file if it is
> >> not in $INFORMIXDIR/etc to run apps and all will be well. In that case
> >> you can even use the 32bit CSDK to access the 64bit engine using TCP/IP
> >> or strpip connections (just not using ipcshm connections). I have done
> >> this myself to validate new CSDK versions before rolling out to production.
>
> >>> If I install CSDK to a different directory than INFORMIXDIR, what
> >>> issues will I face in the future? Are they issues just at compile
> >>> time, or will I need to re-configure my informix .profile, job
> >>> scripts, etc.?
>
> >> None other than having to set up the runtime environment of the apps
> >> correctly, and we always have that one no matter what we do.
>
> >> Art S. Kagel
> >> Oninit
>
> > Art,
> > I re-installed IDS 9.40 FC6 in the default /digi/informix and then
> > CSDK 2.90.FC4 in /digi/CSDK.
>
> > Below are my settings and the results of my attempt to compile:
>
> > digiadm@phms2a:/digi/acct/digiadm $echo $PATH
> > /digi/CSDK:/digi/CSDK/bin:/digi/CSDK/lib:/digi/informix/bin:/digi/
> > informix/lib:/
> > digi/informix/ISA/sbin:/usr/local/bin:/digi/local:/usr/bin:/etc:/usr/
> > sbin:/usr/u
> > cb:/usr/bin/X11:/sbin:/usr/java131/jre/bin:/usr/java131/bin:/usr/
> > localsys/bin:/u
> > sr/local/bin:.:/digi/acct/digiadm:
>
> > digiadm@phms2a:/digi/acct/digiadm/dostats $echo $INFORMIXDIR
> > /digi/CSDK
>
> > digiadm@phms2a:/digi/CSDK/bin $check_version csdk
> > Currently installed version: 2.90.FC4
>
> > digiadm@phms2a:/digi/acct/digiadm/dostats $/opt/freeware/bin/make
> > INFORMIXC=gcc esql -o dostats dostats.ec getopt.c> > gcc: '-b' must come at the start of the command line
> > make: *** [dostats] Error 1
>
> > Then I changed the Makefile option to CC="gcc -b"
>
> > digiadm@phms2a:/digi/acct/digiadm/dostats $/opt/freeware/bin/make
> > INFORMIXC="gcc -b" esql -o dostats dostats.ec getopt.c> > gcc: couldn't run '-qchars=signed-gcc-4.0.0': No such file or
> > directory
> > make: *** [dostats] Error 1
>
> > What do you think is missing?
>
> > Thanks again to you and Jonathan.
Further to what Art said, if you are going to use GCC with ESQL/C,
then my rule of thumb is "make a copy of the original ESQL/C script
(esql.original) and then edit the standard version so it works with
GCC". If you want to use both the native compiler and GCC, you have
more work to do. On Solaris, I do that - carefully and
systematically.
For example, the patch I apply to ESQL/C 3.00.FCx on Solaris is:
Black JL: more patch.300.64
# @(#)$Id: patch.300.64,v 1.2 2007/09/02 21:46:55 jleffler Exp $
# GCC Patch for esql from CSDK 3.00.FC1
--- esql 2007-09-02 14:44:18.739067000 -0700
+++ esql.new 2007-09-02 14:44:26.812149000 -0700
@@ -23,10 +23,33 @@
INFDIR=${INFORMIXDIR=/usr/informix}
DB2CLIDIR=${INSTHOME=/usr/db2}
PREPCC=${INFDIR}/lib/esql/esqlc
-CC="${INFORMIXC=cc} -xarch=v9"
-CC_TH="${INFORMIXC=cc} -xarch=v9"
-CPP="${INFORMIXCPP=CC} -xarch=v9"
-CPP_TH="${INFORMIXCPP=CC} -xarch=v9"
+
+: ${INFORMIXC:=cc}
+: ${INFORMIXCPP:=CC}
+case "$INFORMIXC" in
+*perl*esqlcc*) # Building DBD::Informix
+ case "$ESQLCC" in
+ *gcc*|*g++)
+ CC_ARCHFLAGS="-m64"
+ ;;
+ *cc*|*CC*)
+ CC_ARCHFLAGS="-xarch=v9"
+ ;;
+ esac
+ ;;
+*gcc*|*g++*)
+ CC_ARCHFLAGS="-m64"
+ ;;
+# Beware - this normally needs to be last - because things like
esqlcc and gcc match too!
+*cc*|*CC*)
+ CC_ARCHFLAGS="-xarch=v9"
+ ;;
+esac
+
+CC="$INFORMIXC $CC_ARCHFLAGS"
+CC_TH="$INFORMIXC $CC_ARCHFLAGS"
+CPP="$INFORMIXCPP $CC_ARCHFLAGS"
+CPP_TH="$INFORMIXCPP $CC_ARCHFLAGS"
STATICFLAGS=""
CP=${INFORMIXCP="$CC -E -C"} # cpp which runs
before esqlc
@@ -51,9 +74,6 @@
then
CC="$CC $CC_AMD32"
CPP="$CPP $CC_AMD32"
-else
-CC=$CC
-CPP=$CPP
fi
: '
@@ -922,7 +942,7 @@
# Set the linker to CPP
# Set the source files to objects
#
- CC=$CPP
+ CC="$CPP"
A="$AO $CPPOPTS"
fi
fi
Black JL:
(My shell prompt is 'Black JL:').
You could use a similar technique for AIX - you'd have to make
different changes, and probably a few extras down at the linker lines
to deal with the -b option. But the general concept (patch the esql
file) is what works for me.
I don't quite have every version of ESQL/C ever released - I do have
representative versions of every DevSDK or ClientSDK for Solaris,
though - plus ESQL/C 5.20 and 7.24.) I only have servers 7.31, 9.40,
10.00, 11.10 (32-bit and 64-bit) and 11.50 beta installed at the
moment - plus a 'nightly build' version; of those, only 4 are actually
up and running.