Parallel::Pvm and Inline C

I

ilp

Has anyone gotten inline C to work with Parallel::pvm. It seems to
choke on the "use Inline C;" statement. Thank.
 
S

Sisyphus

ilp said:
Has anyone gotten inline C to work with Parallel::pvm. It seems to
choke on the "use Inline C;" statement. Thank.

Not sure that anyone has tried :)

In general, there's no problem combining perl extensions with Inline::C. A
simple demo script might help. (Make it as minimal as possible - and also
provide a copy'n'paste of the error messages produced.)

Cheers,
Rob
 
I

ilp

Not sure that anyone has tried :)

In general, there's no problem combining perl extensions with Inline::C. A
simple demo script might help. (Make it as minimal as possible - and also
provide a copy'n'paste of the error messages produced.)

Cheers,
Rob

Welp, I'd have to butcher a rather long module, but here's the jist of
it:
Assume that pvm is running and has a few hosts added.
mod1.pl:

use Parallel::pvm;

my ($ntask,$tids) = Parallel::pvm::spawn( "/foo/bar.pl", 1);

1;
------
bar.pl:

use Inline CPP => DATA =>
LIBS => '-lalib;

print "Hello Parallel World!";

1;
 
I

ilp

Welp, I'd have to butcher a rather long module, but here's the jist of
it:
Assume that pvm is running and has a few hosts added.
mod1.pl:

use Parallel::pvm;

my ($ntask,$tids) = Parallel::pvm::spawn( "/foo/bar.pl", 1);

1;
------
bar.pl:

use Inline CPP => DATA =>
LIBS => '-lalib;

print "Hello Parallel World!";

1;
----

output:

Terminated


Sorry, 'bar.pl' would actually be:

bar.pl:

use Inline C => DATA =>
LIBS => '-lalib;

print "Hello Parallel World!";

1;

__DATA__
__C__


__END__
__C__
 
S

Sisyphus

..
..
Sorry, 'bar.pl' would actually be:

bar.pl:

use Inline C => DATA =>
LIBS => '-lalib;

print "Hello Parallel World!";

1;

__DATA__
__C__


__END__
__C__

You might get some hint of what's going wrong if you run verbosely - by
starting that script with:


use Inline C => DATA =>
BUILD_NOISY => 1,
LIBS => '-lalib';

Do you really need the "LIBS => '-lalib'" entry to produce the error ? I
wouldn't expect a line as inoccuous as that to have any effect on whether an
error occurs or not - though, admittedly, I don't know what Parallel::pvm
does, and if it's doing something a bit weird then I guess anything is
possible :)

Cheers,
Rob
 
J

jon

Tried those things. No dice. The C compilation phase completes
without error. This is really annoying. I guess I've sorta reached
that grey area where Perl is no longer the best language choice. --jn
 
S

Sisyphus

jon said:
Tried those things. No dice. The C compilation phase completes
without error. This is really annoying. I guess I've sorta reached
that grey area where Perl is no longer the best language choice. --jn

Perhaps so. But if it's just Inline that's creating the problem, then
there's always the solution of dispensing with Inline, and using a normal
perl extension (module) - one that offers the same functions as the Inline
script, but it does it without using Inline. Take your Inline::C/CPP
functions and rewrite them as an XS file that can be used with a
Makefile.PL, .pm file to build the perl extension in the usual way (ie 'perl
Makefile.PL', 'make', 'make test', 'make install'), without any dependence
on Inline. It's quite easy using InlineX::C2XS/InlineX::CPP2XS (both of
which can also write the Makefile.PL for you).

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top