Inline::C and binary incompatibility

X

xhoster

I have some programs on network storage which use Inline::C. The storage
is mounted by several different systems, all of which desire to run the
programs, but not all of which are binary-compatible. This leads to
conflicts over the contents of the Inline build directories.

One solution I found is to set Inline's DIRECTORY configuration option to
be a string including the machine name (from `uname -n`) so that every
computer gets its own directory, but this is non-portable, it requires
extra work to make sure the derived directory name already exists, it
really makes a mess of the directory structure, and it leads to a lot of
lost productivity when a grid/cluster of 200 binary-compatible machines all
need to independently compile the code that just one of them might have
needed to.

So to make a long story short, is there an easy way to ask Perl for a
string which is different for binary incompatibly instances of perl and the
same for binary compatible instances?

Xho
 
S

Sherm Pendley

So to make a long story short, is there an easy way to ask Perl for a
string which is different for binary incompatibly instances of perl and the
same for binary compatible instances?

#!/usr/bin/perl

use warnings;
use strict;

use Config;

my $arch_version = $Config{'archname'}.'-'.$Config{'version'};

sherm--
 
S

Sisyphus

Sherm Pendley said:
#!/usr/bin/perl

use warnings;
use strict;

use Config;

my $arch_version = $Config{'archname'}.'-'.$Config{'version'};

Just a minor correction to that - $Config{version} can return different
strings for binary compatible perls (eg 5.8.4 and 5.8.6).
Maybe all that is necessary is to chop() the returned string - or take a
look at the %Config keys 'api_revision', 'api_version' and
'api_versionstring'.
If different compilers are being used by the various perls, then $Config{cc}
may need to be added to the mix.

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,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top