Making ESQL/C and 4GL executables use $INFORMIXDIR
Posted in 2006
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Versions, Editions & End-of-Life
Question: How do I get an ESQL/C or 4GL executable to follow $INFORMIXDIR in order to find it's libraries instead of using the path that $INFORMIXDIR was set to when it was compiled? Background: IDS 10.00.FC4 on HP-UX 11i Prod CSDK 2.81.HC1 and Connect-cr 2.70.HC1R1 $INFORMIXDIR=/opt/informix_prod3 Dev I4GL-cr 7.32.HC1 and I4GLRT-cr 7.32.HC1 $INFORMIXDIR=/opt/informix_dev $INFORMIXDIR in both cases are symbolic links pointing to the actual installation directory which is the standard in our shop. The installation directories happen to be the same but I cannot guarentee that they will alway stay the same. In my environment $PATH is set using $INFORMIXDIR after $INFORMIXDIR is set so that when I switch from one environment to another on the same machine the entire environment is switched. If I compile a program on my dev box and move it into production I'll get an error that says something about not being able to find a library, I don't have the exact error in front of me right now. If I create a link on my dev called /opt/informix_prod3 pointing to the same location as /opt/informix_dev and set my $INFORMIXDIR to this value then reset my environment to use this new $INFORMIX the compiled code will then work on my production server. Thanks DL Redden
DL Redden wrote: > Question: > > How do I get an ESQL/C or 4GL executable to follow $INFORMIXDIR in order to find it's libraries instead of using the path that $INFORMIXDIR was set to when it was compiled? > You need to set your LD_LIBRARY_PATH (or whatever H-P calls it) to include ${INFORMIXDIR}/lib;${INFORMIXDIR}/lib/esql;${INFORMIXDIR}/lib/tools You can, of course, write yourself a little shell program to dynamically change the value of ${LD_LIBRARY_PATH} in your current environment (which is executed with "dot progname" in Bourne or Korn shells -- BASH, C-Shell, you're on your own); e.g., have one named "dev" and the other named "prod." That would be the easy way. The hard way is examine the executable (with, say, the strings utility or even grep) to get the compiled environment, and then execute a "dev" or "prod" to set ${LD_LIBRARY_PATH}. -- Everything works -- if you let it.
All these needs to be set in order to compile, execute and connect INFORMIXDIR Path should include $INFOMRIXDIR/bin, $INFORMIXDIR/lib, LD_LIBRARY_PATH (SHLIB_PATH for HP) should include $INFORMIXDIR/lib, $INFORMIXDIR/lib/esql INFORMIXSQLHOSTS - if not using the default sqlhosts HTH, Rajshekar DL Redden wrote: > Question: > > How do I get an ESQL/C or 4GL executable to follow $INFORMIXDIR in order to find it's libraries instead of using the path that $INFORMIXDIR was set to when it was compiled? > > Background: > > IDS 10.00.FC4 on HP-UX 11i > > Prod > CSDK 2.81.HC1 and Connect-cr 2.70.HC1R1 > $INFORMIXDIR=/opt/informix_prod3 > > Dev > I4GL-cr 7.32.HC1 and I4GLRT-cr 7.32.HC1 > $INFORMIXDIR=/opt/informix_dev > > $INFORMIXDIR in both cases are symbolic links pointing to the actual installation directory which is the standard in our shop. The installation directories happen to be the same but I cannot guarentee that they will alway stay the same. > > In my environment $PATH is set using $INFORMIXDIR after $INFORMIXDIR is set so that when I switch from one environment to another on the same machine the entire environment is switched. > > If I compile a program on my dev box and move it into production I'll get an error that says something about not being able to find a library, I don't have the exact error in front of me right now. > > If I create a link on my dev called /opt/informix_prod3 pointing to the same location as /opt/informix_dev and set my $INFORMIXDIR to this value then reset my environment to use this new $INFORMIX the compiled code will then work on my production server. > > Thanks > > DL Redden