Subject: | XS code does not compile with most FANN versions |
I tried to compile AI::FANN using the CPAN shell with two different
versions of
libfann and got similar compiler errors from different places each time.
This is using perl 5.8.8 on Debian Lenny/x86:
Using libfann1 1.2.0-1 included with Debian (also tried with the
download from
http://prdownloads.sourceforge.net/fann/libfann1_1.2.0-1_i386.deb?download):
CPAN.pm: Going to build S/SA/SALVA/AI-FANN-0.08.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for AI::FANN
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap
/usr/share/perl/5.8/ExtUtils/typemap -typemap typemap FANN.xs >
FANN.xsc && mv FANN.xsc FANN.c
cc -c -I. -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\"
-fPIC "-I/usr/lib/perl/5.8/CORE" morefann.c
morefann.c: In function ‘fann_train_data_set’:
morefann.c:43: error: ‘FANN_E_INDEX_OUT_OF_BOUND’ undeclared (first use
in this function)
morefann.c:43: error: (Each undeclared identifier is reported only once
morefann.c:43: error: for each function it appears in.)
cp lib/AI/FANN.pm blib/lib/AI/FANN.pm
make: *** [morefann.o] Error 1
Version 2.0.0-1 from SourceForge:
CPAN.pm: Going to build S/SA/SALVA/AI-FANN-0.08.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for AI::FANN
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap
/usr/share/perl/5.8/ExtUtils/typemap -typemap typemap FANN.xs >
FANN.xsc && mv FANN.xsc FANN.c
cc -c -I. -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\"
-fPIC "-I/usr/lib/perl/5.8/CORE" morefann.c
cp lib/AI/FANN.pm blib/lib/AI/FANN.pm
Running Mkbootstrap for AI::FANN ()
chmod 644 FANN.bs
cp FANN.bs blib/arch/auto/AI/FANN/FANN.bs
chmod 644 blib/arch/auto/AI/FANN/FANN.bs
cc -c -I. -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\"
-fPIC "-I/usr/lib/perl/5.8/CORE" FANN.c
In file included from FANN.xs:13:
constants.h:49: error: ‘FANN_SIN_SYMMETRIC’ undeclared here (not in a
function)
constants.h:50: error: ‘FANN_COS_SYMMETRIC’ undeclared here (not in a
function)
constants.h:51: error: ‘FANN_SIN’ undeclared here (not in a function)
constants.h:52: error: ‘FANN_COS’ undeclared here (not in a function)
make: *** [FANN.o] Error 1
It seems all the header file are being found (of course I installed the
corresponding -dev .debs) but the symbols aren't defined anywhere. I
can't find them anywhere in my /usr/include.