How do I debug Inline::C trying to call a library routine?

2012-03-14 Thread Chloe
This is my sample Perl program, and I'm trying to call a library routine. I 
think it should work, but don't know how to debug what it is doing in the 
background or where it is failing. It is not providing any error messages that 
are useful. I don't see any options to turn on verbose or debugging.


use Inline C => Config => ENABLE => "AUTOWRAP" => LIBS => '-L/usr/local/lib 
-lgretl' => INC => '-I/home/Chloe/gretl-1.9.7/lib/src';

libgretl_init();

__END__
__C__
#include "libgretl.h"
#include "gretl_utils.h"
/*void libgretl_init();*/
--

This is the error message
-
$ perl sample.pl
Undefined subroutine &main::libgretl_init called at sample.pl line 4.
---

These are the files generated, but I don't see any .c files. Only the config-*, 
*.dll, and *.inl have any size.
-
$ ls -R _Inline/
_Inline/:
build config-i686-cygwin-thread-multi-64int-5.010001 lib
_Inline/build:
_Inline/lib:
auto
_Inline/lib/auto:
e_03e7
_Inline/lib/auto/e_03e7:
e_03e7.bs e_03e7.dll e_03e7.inl


This does work, however

$ perl -le 'use Inline C => q{ double erf(double); }, ENABLE => "AUTOWRAP"; 
print "$_ @{[erf($_)]}" for (0..10)'
0 0
1 0.842700792949715
2 0.995322265018953
...
--
 
System version

$ uname -a
CYGWIN_NT-5.1 dumbopc 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
-

The header file:
-
$ find gretl-1.9.7 -name \*.h | xargs grep libgretl_init
gretl-1.9.7/lib/src/gretl_utils.h:void libgretl_init (void);
--


[rt.cpan.org #75664] Fails 09parser test in Cygwin with *** fatal error

2012-03-14 Thread Sisyphus via RT
Wed Mar 14 04:13:11 2012: Request 75664 was acted upon.
Transaction: Correspondence added by SISYPHUS
   Queue: Inline
 Subject: Fails 09parser test in Cygwin with *** fatal error
   Broken in: 0.50
Severity: Important
   Owner: Nobody
  Requestors: starrych...@oliveyou.net
  Status: open
 Ticket https://rt.cpan.org/Ticket/Display.html?id=75664 >


On Wed Mar 14 02:34:10 2012,

> I updated some Cygwin packages, and then it gave me an error saying I
> needed
> to run "rebaseall", which I've never seen before. I had to run it from
> only
> ash or dash, which I've never heard of before. I ran it, it did
> something,
> and then I tried to install Inline::C again and it worked this time.

Thanks for that - good to know that 'rebaseall' fixes the problem.
I can actually reproduce the problem on my Cygwin installation ... and I
expect 'rebaseall' will fix the problem here, too, if I can just
discover wtf one needs to do in order to successfully run that command. 

I keep getting an error which, in essence, tells me that I need to do
exactly what I just did, in order to successfully run 'rebaseall'.

Cheers,
Rob 



Re: How do I debug Inline::C trying to call a library routine?

2012-03-14 Thread Sisyphus


- Original Message - 
From: "Chloe"


use Inline C => Config => ENABLE => "AUTOWRAP" => LIBS => 
'-L/usr/local/lib -lgretl' => INC => '-I/home/Chloe/gretl-1.9.7/lib/src';


libgretl_init();

__END__
__C__
#include "libgretl.h"
#include "gretl_utils.h"


These are the files generated, but I don't see any .c files. Only the 
config-*, *.dll, and *.inl have any size.


If they were built, and I guess they were, then they've been cleaned up at 
the end of the build. (The CLEAN_AFTER_BUILD=>0 config option will prevent 
that from happening.)



This does work, however

$ perl -le 'use Inline C => q{ double erf(double); }, ENABLE => 
"AUTOWRAP"; print "$_ @{[erf($_)]}" for (0..10)'

0 0
1 0.842700792949715
2 0.995322265018953


Yes, but this script doesn't:

##
use Inline C => Config => ENABLE => "AUTOWRAP";

print "$_ @{[erf($_)]}" for (0..10)

__END__
__C__
double erf(double);

##

It outputs: Undefined subroutine &main::erf called at try.pl line 3.
Whereas this script does work:

##
use Inline C => Config => ENABLE => "AUTOWRAP";
use Inline C => <<'EOC';
double erf(double);
EOC

print "$_ @{[erf($_)]}" for (0..10)

##

See the picture ?
I think something like this might work for you (though I'm not well versed 
in AUTOWRAP) :


##
use Inline C => Config => ENABLE => "AUTOWRAP" => LIBS => 
'-L/usr/local/lib -lgretl' => INC => '-I/home/Chloe/gretl-1.9.7/lib/src';

use Inline C => <<'EOC';

#include "libgretl.h"
#include "gretl_utils.h"

EOC

libgretl_init();

##

Or, perhaps the includes lines need to be rewritten as:
#include 
#include 

Cheers,
Rob