Hi folks:
Running a simple Inline C program on a Linux system with late model
perl, Inline 0.44. Getting an error I don't know how to handle. Any
suggestions? Here is the error, the program, and the system information.
--- Error ---
Can't locate auto/main/solve_for.al in @INC (@INC contains:
/home/landman/_Inline/lib /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at
./gsltest2.pl line 34
-------------
--- Full output ---
[EMAIL PROTECTED]:~] 115 >./gsltest2.pl
<-----------------------Information
Section----------------------------------->
Information about the processing of your Inline C code:
Your source code needs to be compiled. I'll use this build directory:
/home/landman/_Inline/build/solve_for
and I'll install the executable as:
/home/landman/_Inline/lib/auto/solve_for/solve_for.so
No C functions have been successfully bound to Perl.
<-----------------------End of Information
Section---------------------------->
Starting Build Prepocess Stage
Finished Build Prepocess Stage
Starting Build Parse Stage
Finished Build Parse Stage
Starting Build Glue 1 Stage
Finished Build Glue 1 Stage
Starting Build Glue 2 Stage
Finished Build Glue 2 Stage
Starting Build Glue 3 Stage
Finished Build Glue 3 Stage
Starting Build Compile Stage
Starting "perl Makefile.PL" Stage
Writing Makefile for solve_for
Finished "perl Makefile.PL" Stage
Starting "make" Stage
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.8.8/ExtUtils/typemap solve_for.xs > solve_for.xsc &&
mv solve_for.xsc solve_for.c
cc -c -I/home/landman -I/usr/include -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall -pipe
-DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC
"-I/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE" solve_for.c
solve_for.xs: In function 'solve_for':
solve_for.xs:8: warning: 'x' is used uninitialized in this function
Running Mkbootstrap for solve_for ()
chmod 644 solve_for.bs
rm -f blib/arch/auto/solve_for/solve_for.so
LD_RUN_PATH="/usr/lib64" cc -shared -L/usr/local/lib64 solve_for.o -o
blib/arch/auto/solve_for/solve_for.so \
-lgsl \
chmod 755 blib/arch/auto/solve_for/solve_for.so
cp solve_for.bs blib/arch/auto/solve_for/solve_for.bs
chmod 644 blib/arch/auto/solve_for/solve_for.bs
Finished "make" Stage
Starting "make install" Stage
Installing /home/landman/_Inline/lib/auto/solve_for/solve_for.so
Installing /home/landman/_Inline/lib/auto/solve_for/solve_for.bs
Files found in blib/arch: installing files in blib/lib into architecture
dependent library tree
Writing /home/landman/_Inline/lib/auto/solve_for/.packlist
Finished "make install" Stage
Starting Cleaning Up Stage
Finished Cleaning Up Stage
Finished Build Compile Stage
Can't locate auto/main/solve_for.al in @INC (@INC contains:
/home/landman/_Inline/lib /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at
./gsltest2.pl line 34
------------------
--- Program ---
#!/usr/bin/perl
my (@k, $k_pointer, @f, $f_pointer, $s);
my ($x,$p,$K,$F,$x);
use Inline C;
use Inline (C => Config =>
LIBS => '-lgsl',
INC => '-I/usr/include',
DISABLE => 'AUTONAME',
NAME => 'solve_for',
BUILD_NOISY=> 'ENABLED',
PRINT_INFO => 'ENABLED'
);
@k = qw(
0.1, 0.2, 0.0,
0.0, 0.2, 0.3,
1.0, 1.0, 1.0
);
@f = qw(
4.0,
3.0,
2.0
);
$x = solve_for (@f,@k);
printf "x = %s\n",$x;
__END__
__C__
double *solve_for(double* f, double* k) {
double *x;
*x=0.0;
return x;
}
----------------
--- Perl info ---
[EMAIL PROTECTED]:~] 118 >perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.16, archname=x86_64-linux-thread-multi
uname='linux dvorak 2.6.16 #1 smp mon apr 10 04:51:13 utc 2006
x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr
-Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm
-Duseshrplib=true -Doptimize=-O2 -fmessage-length=0 -Wall
-D_FORTIFY_SOURCE=2 -g -Wall -pipe'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall
-pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING
-fno-strict-aliasing -pipe -Wdeclaration-after-statement'
ccversion='', gccversion='4.1.0 (SUSE Linux)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib64'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64/libc-2.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_REENTRANT_API
Built under linux
Compiled at Apr 22 2006 23:33:01
@INC:
/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/5.8.8
/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8
/usr/lib/perl5/vendor_perl
.
-----------------
--- OS Info ---
[EMAIL PROTECTED]:~] 119 >uname -a
Linux balto 2.6.16.13-4-default #1 Wed May 3 04:53:23 UTC 2006 x86_64
x86_64 x86_64 GNU/Linux
-----------------
--- _Inline contents ---
[EMAIL PROTECTED]:~] 122 >find _Inline/
_Inline/
_Inline/config
_Inline/build
_Inline/lib
_Inline/lib/auto
_Inline/lib/auto/solve_for
_Inline/lib/auto/solve_for/solve_for.so
_Inline/lib/auto/solve_for/solve_for.bs
_Inline/lib/auto/solve_for/solve_for.inl
-----------------------
--- Sanity check ---
[EMAIL PROTECTED]:~] 124 >cat inline.pl
#!/usr/bin/perl
use Inline C;
greet('Joe');
__END__
__C__
void greet(char* name) {
printf("Hello %s!\n", name);
}
[EMAIL PROTECTED]:~] 125 >./inline.pl
Hello Joe!
----------------------
--
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: [EMAIL PROTECTED]
web : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax : +1 734 786 8452 or +1 866 888 3112
cell : +1 734 612 4615