ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Perl and AIX question

Post new topic  Reply to topic
 Perl and AIX question « View previous topic :: View next topic » 
Author Message
Cliff
PostPosted: Tue Feb 04, 2003 9:32 am    Post subject: Perl and AIX question Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Folks,

I have to provide a utility function for my client which will build a little XML message, put it on a queue, wait for a reply and set a return code based on the content of the reply. Not difficult you quite rightly say. However, this is to run on AIX 5 (not my strongest area), and there is no C compiler, so I can't use that. And no, they don't have PL/1 or COBOL either.

So, the question is, is it easy/idiot proof to install the Perl support from CPAN (I am trying to peruade them that this is the way to go) and most importantly can it be done without a C compiler?

Any pointers, tips etc gratefully received.

Thanks -

Cliff
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Tue Feb 04, 2003 10:11 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

I've written MQ applications in Perl on AIX, and yes, installing the MQSeries package from CPAN is fairly easy. However, the perl routines are actually calling underlying C routines (in a .xs file). This, and the fact that you must use the make command to install the perl module means that you need a C compiler. Here's a snippet from an external site which explains it in more detail:
Quote:
Hey, I thought I was programming in Perl - why do I need a C compiler, you ask? Good question. The first reason is that this is simply a familiar way for UNIX admins to install software, even though there may not even be any code to compile. The second reason is that some Perl modules make system calls or other low-level stuff that is not available using pure Perl code. So, they write a some of the code in C to go along with the Perl module. You may already know that C code needs to be compiled into binary form for each specific operating system. It's not possible for the module author to provide pre-compiled versions for every operating system known to man. So, they just give you the C source code instead and let you compile it yourself for your own particular system. This is no big deal for most UNIX admins because, as I mentioned, this is a familiar way to install software. In fact, UNIX comes with a C compiler all set up and ready to use.

_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cliff
PostPosted: Wed Feb 05, 2003 12:16 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Thanks, Brandon.

I'd hoped it was a binary distribution for AIX. What also surprises me is the apparent lack of a C compiler for AIX here - I rather thought it was intrinsic to the whole shooting match, but then I'm more of a mainframe/NT chap.

Which brings me to my next problem - all this talk about make and makefiles means nothing to me. Is there a really clear step by step idiot's guide to installing on NT/Win2K so at least I can get a proof of concept working? I've been struggling with it for hours and the install instructions are very unix-orientated. They rather assume you know what you're doing, so for folks with weak Unix skills (but it's for NT..) and very rusty Perl, it's difficult bordering on the impossible.

Again, any words of wisdom gratefully recieved.

Thanks,

Cliff
Back to top
View user's profile Send private message Send e-mail
fschofer
PostPosted: Wed Feb 05, 2003 2:14 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

You can use the GNU C Compiler for compiling you MQ program.

I think it should also work to compile your perl.
Wait, there's also a binary version of perl for download

Here you can get the GCC, perl and lot of other stuff

http://aixpdslib.seas.ucla.edu/

http://aixpdslib.seas.ucla.edu/packages/gcc.html

http://aixpdslib.seas.ucla.edu/packages/perl.html

By the way you can also develop in java using the
support pack ma88.
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Wed Feb 05, 2003 11:53 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Yes, we were amazed as well that after spending several million dollars on top of the line AIX servers that there wasn't a C compiler on any of them. Of course IBM made us pay more (a monthly fee!) to use their AIX C compiler. As far as setting up the perl module, it's very simple. If you forget about CPAN and simply download the tar.gz for the perl MQ module, once you unpack it, you simply enter the following commands:
perl Makefile.pl
make
make install

And you're done! As you mentioned, you don't know about make, and you don't need to. All you need to know is that make comes with a C compiler. And without make you're definitely not going to get this perl module to install.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cliff
PostPosted: Tue Feb 11, 2003 5:06 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Brandon,

thanks, I can see how straightforward the Unix install is, but my point was about making it work on NT/2000. It ain't clear to me, that's for sure. I know I have to compile and/or link some modules (I have MS Visual C++ 6.0) but some guidance from someone who's actually done this would be most helpful.

Kind regards,

Cliff
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Tue Feb 11, 2003 9:24 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Cliff,
I'm sorry if I gave you the impression I've done this on NT, but unfortunately I haven't. But it would follow a very similar path to UNIX. Install Perl, download the MQSeries perl module at: http://www.cpan.org/modules/by-module/MQSeries/
and follow the instructions in the accompanying readme. In order to compile the MQSeries module, you should only need a C compiler like gcc, which you can get for free from:
http://www.gnu.org/software/gcc/gcc.html
If you click on the "binaries" link, you should be able to download a compiled version of gcc for windows which you simply need to install. At this point, you should be able to follow the instructions in the MQSeries readme to compile it, just as though you were doing it on UNIX.
Hope this helps!
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cliff
PostPosted: Tue Feb 11, 2003 9:49 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Brandon,

thanks for your reply. I have the MS C compiler, I have Perl installed and the MQ Perl module downloaded from CPAN, no problem, the problem starts with the README! It is entirely Unix-specific and gives no help for installing on NT.

Hopefully someone out there has overcome this little hurdle and is prepared to share their knowledge! When I thought "well, I'll just knock up a quick proof of concept to impress the natives" I expected it to be rather more straightforward... That'll teach me....

Yours in hope,

Cliff
Back to top
View user's profile Send private message Send e-mail
TJW
PostPosted: Tue Feb 18, 2003 6:48 am    Post subject: Compiling MQSeries Perl module on Window platform Reply with quote

Novice

Joined: 11 Dec 2002
Posts: 16
Location: UK

Here's how to compile the MQSeries Perl module on the Windows platform (using VisualC++)...

To compile perl modules you will need a Make utility. VisualC++ should come with Nmake.exe.

If nmake.exe isn't in the VisualC++ bin directory then it is available from http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe. Executing this self-extracting program generates the files nmake.err, nmake.exe and readme.txt. Copy nmake.exe and nmake.err to a directory on your path, eg C:\WINNT\system32\

Start a Windows command prompt.

From the prompt run the batch file Vcvars.bat (found in the VisualC++ bin directory). This will set up environment variables that enable VisualC++ to be used from the command line.

'cd' to the directory where you have extracted the MQSeries module source files

Now follow the commands from the MQSeries Perl module documentation, substituting Nmake for make ...

perl Makefile.PL
Nmake
Nmake test
Nmake install

Before building the module, you need to edit the CONFIG file and
change, minimally, the name of the queue manager against which the
tests will run. The rest of the defaults should be reasonable, but
you will have to customize this file to match your local environment.
The CONFIG file has comments which document each of the parameters, so go read it for more information.

You will obviously need to create the queue used for the test suite on the queue manager you specified in the

CONFIG file.

NOTE: If you do not support client channel table files, then you may have to set the MQSERVER environment variable in order to allow the client tests to work.

Any failure in the test suite should a cause for concern. In order to get more details from it, run it via:

Nmake test TEST_VERBOSE=1

If you can't figure out what broke, then send the author <of the MQSeries module> the output from ``perl -V'', as well as the output from the verbose test run. Please include as many details as possible about the operating system and MQSeries software on both the host being used to compile this extension, as well as the queue manager to which the test suite is connecting.[/url]
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Feb 18, 2003 7:19 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Might be easier to write a small Java program. Runs anywhere for free.
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue Feb 18, 2003 9:05 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

I would make the case that once the environment is set up, perl is about the easiest way to throw together an MQ app - plus *in most cases* it'll run anywhere too!

_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Cliff
PostPosted: Tue Feb 18, 2003 11:46 pm    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Thanks to Tim for his help, and I'm sure a Java prog would do the job but I don't know Java (yet..). Also I love the flexibility of Perl and as I said before, I need the practice!

The sting in the tail is that IBM have changed the include *.h header files for MQ v 5.3, so the process outlined by Tim fails since the headers fail parsing. At least this is true with v 1.12 of the perl support - I'll try the latest and take it from there but it looks like a bit of judicious editing of the .pl files is required!

More news later -

Cliff
Back to top
View user's profile Send private message Send e-mail
zpat
PostPosted: Wed Feb 19, 2003 12:24 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

REXX is the easiest MQI language I have used - but in classic IBM style - instead of giving REXX away and it becoming widespread - they insisted on charging for it (except on OS/390).

I would like to use Perl and MQ but the set up is just insanely complex for someone who is not a UNIX/C/Perl guru.
Back to top
View user's profile Send private message
Cliff
PostPosted: Wed Feb 19, 2003 4:38 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

I entirely agree with you about REXX - hey, it's PL/1 pretty much and I love PL/1 - but when (if?) I get the Perl interface working correctly I'll be sure post the info here.

I think that if PL/1 had been made freely available on Unix then C wouldn't be as prevalent as it is now, but that's another story....

Cheers -

Cliff
Back to top
View user's profile Send private message Send e-mail
Cliff
PostPosted: Thu Feb 20, 2003 6:29 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Well, it seems that my problems were down to a mismatch in versions. If you have up to date Perl and the MQ Perl support from CPAN, the thing installs fine with the process in this thread noted by Tim.

I am currently up and limping!

Cheers -

Cliff
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Perl and AIX question
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.