472,991 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,991 software developers and data experts.

Help to compile C UDFs using gcc on AIX (bldrtn)

Hi,

the following gcc compile/link (in bldrtn) works fine on our Linux
Servers

# Set the runtime path since routines run as setuid.
EXTRA_LFLAG="-Wl,-rpath,$DB2PATH/lib"

# If an embedded SQL program, precompile and bind it.
if [ -f $1".sqc" ]
then
./embprep $1 $2
fi

# Compile the program.
gcc $EXTRA_C_FLAGS -fpic -I$DB2PATH/include -c $1.c -D_REENTRANT

# Link the program and create a shared library
gcc $EXTRA_C_FLAGS -shared -o $1 $1.o $EXTRA_LFLAG -L$DB2PATH/lib -ldb2
-lpthread

However, when I try to use the same on our AIX Server (64bit on 5.3), I
get strange gcc errors on the Link

ld: 0706-012 The -p flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -t flag is not recognized.
ld: 0706-012 The -h flag is not recognized.
collect2: ld returned 255 exit status
cp: application_id: No such file or directory

If I leave off the $EXTRA_LFLAG, it compiles/Links fine, but gives
runtime errors so I guess it is needed ...

Anyone else have working gcc commands to use in bldrtn on AIX?
- the default bldrtn on AIX has commands for xlc_r and not gcc

Many thanks.

PaulR.

Nov 12 '05 #1
5 3472
PaulR wrote:
Hi,

the following gcc compile/link (in bldrtn) works fine on our Linux
Servers ....
However, when I try to use the same on our AIX Server (64bit on 5.3), I
get strange gcc errors on the Link


DB2 for AIX supports the following programming languages and compilers:

C
IBM C for AIX Version 5.0.2.3

IBM C for AIX Version 6.0
C++
IBM VisualAge C++ Version 5.0.2.3 with the March 2003 C++ Runtime PTF:
http://www-1.ibm.com/support/docview...id=swg24004427

IBM VisualAge C++ Version 6.0 with the March 2003 C++ Runtime PTF: 4
http://www-1.ibm.com/support/docview...id=swg24004427
Jan M. Nelken
Nov 12 '05 #2
Jan,.

Thanks for that - Frustrating though it is, considering we only
need it for the userexits and a few UDFs.

Nov 12 '05 #3
Tested an UDF.

Only compiled with gcc (there are advices to use ld even when using gcc
as main compiler), linked with ld, ld is always part of the AIX
distribution.

ld -o myroutine myroutine.o -L$DB2PATH/lib -ldb2 -ldb2apie
-bE:myroutine.exp -e MYROUTINE1 -lc

Bernard Dhooghe

Nov 12 '05 #4
PaulR wrote:
Jan,.

Thanks for that - Frustrating though it is, considering we only
need it for the userexits and a few UDFs.

Don't mind Jan. As long as you don't call him via 1-800-IBM what matters
is what works, not which compiler IBM supports ;-)

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5
Thanks for the options.

I did try ld, it compiled fine but then gave some horrible run-time
error!

Anyway, we have got the project to cough up the 700 for xlc, and all
is working fine. (cheaper in the long run!)

Thanks again.

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Mayo | last post by:
There is something very strange going on here. Tested with ADO 2.7 and MSDE/2000. At first, things look quite sensible. You have a simple SQL query, let's say select * from mytab where col1 =...
4
by: Pete H | last post by:
Hi All; I'm trying to get some of the samples that are amply illustrated in multiple docs to work. When I try to create a Warehouse Center view "...for MQ Series messages" or use the UDF wizard in...
5
by: Gustavo Randich | last post by:
Hello, (Using DB2/LINUX 8.2.0) HOW-TO: recreate a big set of interdependent UDFs... without having to do it manually because of the imposed drop order due to the RESTRICT keyword of the DROP...
7
by: Rhino | last post by:
I am updating some Java UDFs from DB2GENERAL to DB2JAVA as suggested in the manuals for DB2 Version 8 but I'm having problems with setSQLstate() and setSQLmessage(). If I'm reading the manuals...
3
by: Rhino | last post by:
I am trying to figure out if a UDF can accept a UDT (User-defined Distinct Type, *not* structured type) as one of its parameters. I'm running DB2 for Linux, Unix, and Windows V8.2 (FP 8) on Windows...
0
by: johwat | last post by:
Read my blog on CodeFez where I demonstrate how to test a suite of UDFs using TSQLUnit:...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
0
by: Helmut Tessarek | last post by:
Hi everybody, I've written some UDFs to generate passwords within DB2. They are compatible to the functions that are used in Apache's htpasswd utility. Maybe someone can use them. ...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.