in reply to Re^2: Inline::C produces compilation errors
in thread Inline::C produces compilation errors

I did not compile with this compiler...

I don't know if that's the problem - it's just something that strikes me as a possible cause of the errors you're getting.

If, when building Inline, make test ran without reporting any failures, then I would venture to suggest it's *not* the problem. If you didn't actualy build Inline yourself from source (eg you installed an rpm), try building Inline from source and see what make test produces.

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: Inline::C produces compilation errors
by holandes777 (Scribe) on Nov 22, 2007 at 16:28 UTC
    I followed you suggestion downloading and installing perl 5.8.8. from source. I then tried to install Inline-0.44 and got the list of error messages shown below.
     
    I checked a few of the ".so" files it says it "Had problems bootstrapping Inline module" and they were there. Example:
    t/01syntax.....Uncaught exception from user code: Had problems bootstrapping Inline module '_01syntax_t_6b3a'
    When I go to the directory and do a listing it is there:
    [root@FC4-Casinfo Inline-0.44]# ls -l /CASINFO/packages/Inline-0.44/C/ +_Inline_test/lib/auto/_01syntax_t_6b3a/_01syntax_t_6b3a.so -r-xr-xr-x 1 root root 10547 Oct 26 11:20 /CASINFO/packages/Inline-0. +44/C/_Inline_test/lib/auto/_01syntax_t_6b3a/_01syntax_t_6b3a.so [root@FC4-Casinfo Inline-0.44]#
    There is precious little useful in google regarding this except for cpan tester results
     
    Any ideas??
     
    [root@FC4-Casinfo Inline-0.44]# make test make[1]: Entering directory `/CASINFO/packages/Inline-0.44/C' make[1]: Leaving directory `/CASINFO/packages/Inline-0.44/C' PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" " +test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00init......ok t/01usages....ok t/02config....ok t/03errors....ok t/04create....ok t/05files.....skipped all skipped: no reason given All tests successful, 1 test skipped. Files=6, Tests=14, 1 wallclock secs ( 1.02 cusr + 0.07 csys = 1.09 +CPU) make[1]: Entering directory `/CASINFO/packages/Inline-0.44/C' PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" " +test_harness(0, '../blib/lib', '../blib/arch')" t/*.t t/00init.......ok t/01syntax.....Uncaught exception from user code: Had problems bootstrapping Inline module '_01syntax_t_6b3a' Can't load '/CASINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_01s +yntax_t_6b3a/_01syntax_t_6b3a.so' for module _01syntax_t_6b3a: /CASIN +FO/packages/Inline-0.44/C/_Inline_test/lib/auto/_01syntax_t_6b3a/_01s +yntax_t_6b3a.so: undefined symbol: pthread_getspecific at /usr/local/ +lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at ../blib/lib/Inline.pm line 500 at t/01syntax.t line 28 BEGIN failed--compilation aborted at t/01syntax.t line 37. at t/01syntax.t line 37 One or more DATA sections were not processed by Inline. t/01syntax.....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED tests 1-5 Failed 5/5 tests, 0.00% okay t/02config.....ok 1/3Uncaught exception from user code: Had problems bootstrapping Inline module '_02config_t_733b' Can't load '/CASINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_02c +onfig_t_733b/_02config_t_733b.so' for module _02config_t_733b: /CASIN +FO/packages/Inline-0.44/C/_Inline_test/lib/auto/_02config_t_733b/_02c +onfig_t_733b.so: undefined symbol: pthread_getspecific at /usr/local/ +lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at ../blib/lib/Inline.pm line 500 at t/02config.t line 38 BEGIN failed--compilation aborted at t/02config.t line 40. at t/02config.t line 40 t/02config.....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED test 3 Failed 1/3 tests, 66.67% okay t/03typemap....Uncaught exception from user code: Had problems bootstrapping Inline module '_03typemap_t_a52c' Can't load '/CASINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_03t +ypemap_t_a52c/_03typemap_t_a52c.so' for module _03typemap_t_a52c: /CA +SINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_03typemap_t_a52c/ +_03typemap_t_a52c.so: undefined symbol: pthread_getspecific at /usr/l +ocal/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at ../blib/lib/Inline.pm line 500 at /usr/local/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 0 INIT failed--call queue aborted. at t/03typemap.t line 0 t/03typemap....dubious Test returned status 9 (wstat 2304, 0x900) t/04perlapi....Uncaught exception from user code: Had problems bootstrapping Inline module '_04perlapi_t_3c76' Can't load '/CASINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_04p +erlapi_t_3c76/_04perlapi_t_3c76.so' for module _04perlapi_t_3c76: /CA +SINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/_04perlapi_t_3c76/ +_04perlapi_t_3c76.so: undefined symbol: pthread_getspecific at /usr/l +ocal/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at ../blib/lib/Inline.pm line 500 at /usr/local/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 0 INIT failed--call queue aborted. at t/04perlapi.t line 0 t/04perlapi....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/05xsmode.....Uncaught exception from user code: Had problems bootstrapping Inline module 'xsmode' Can't load '/CASINFO/packages/Inline-0.44/C/_Inline_test/lib/auto/xsmo +de/xsmode.so' for module xsmode: /CASINFO/packages/Inline-0.44/C/_Inl +ine_test/lib/auto/xsmode/xsmode.so: undefined symbol: pthread_getspec +ific at /usr/local/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230. at ../blib/lib/Inline.pm line 500 at /usr/local/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 0 INIT failed--call queue aborted. at t/05xsmode.t line 0 t/05xsmode.....dubious Test returned status 9 (wstat 2304, 0x900) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/01syntax.t 9 2304 5 10 200.00% 1-5 t/02config.t 9 2304 3 2 66.67% 3 t/03typemap.t 9 2304 ?? ?? % ?? t/04perlapi.t 9 2304 1 2 200.00% 1 t/05xsmode.t 9 2304 1 2 200.00% 1 Failed 5/6 test scripts, 16.67% okay. 8/11 subtests failed, 27.27% oka +y. make[1]: *** [test_dynamic] Error 9 make[1]: Leaving directory `/CASINFO/packages/Inline-0.44/C' [root@FC4-Casinfo Inline-0.44]#
      It's that one undefined symbol pthread_getspecific that's causing the problem. It's not apparent to me just why that problem arises. Nor do I know what needs to be done to fix it.

      Can you build any extensions (modules containing XS code) at all ? Can you, eg, successfully build Math::FFT from source ?

      What does perl -V output ?

      Cheers,
      Rob
        More Info:
        I reinstalled version-0.74 and Parse-RecDescent-v1.95.1, both of whom are prerequesistes to installing Inline::C. The make test ended with "Failed 5/6 test scripts, 16.67% okay. 8/11 subtests failed, 27.27% okay." as it had before.
        When I tried running the original program I get the same result.So I tried the following minimalist program:
        my $kk = kk(); print "perl kk=$kk\n"; use Inline C => <<'END_OF_C_CODE'; #include <stdio.h> #include <stdlib.h> #include <string.h> int kk () { printf("Hello!\n"); return(0); } END_OF_C_CODE
        And I got the following output:
        Hello! perl kk=0
        So I can compile something, I then kept adding the lines I needed one at a time until I got to this:
        my $kk = kk(); print "perl kk=$kk\n"; use Inline C => Config => LIBS => '-L/HASP/perltestP -llibhasp_linux.a +'; use Inline C => <<'END_OF_C_CODE'; #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; char filename[] = "prg"; printf("Hello!\n"); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); // switch (status) { // case HASP_STATUS_OK: // printf("OK\n"); // hasp_logout(handle); // return(1); // break; // default: // printf("BAD\n"); return(0); } END_OF_C_CODE
        Which broke complaining that :perl: symbol lookup error: /HASP/perltestP/_Inline/lib/auto/c2_pl_4339/c2_pl_4339.so: undefined symbol: hasp_login".
         
        However, if I approach this from the C side as follows, it recolves hasp_login without a problem.
        #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; printf("start : "); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); switch (status) { case HASP_STATUS_OK: printf("OK\n"); hasp_logout(handle); return(1); break; default: printf("BAD\n"); return(0); } } int main(void) { int result; result = kk(); printf("result was %d\n",result); }
        This would indicate that Inline::C is unable to resolve extenal references that are not from itself ??? I think it all relates the the tests that are being failed on the "make test" of the Inlince::C installation. I've googled and I have checked the bug reports in cpan.org. Nothing really looks like this. Should I report it as a bug to "INGY" on cpan.org's site?
        At the moment I don't think I can build anything with XS. The output of execution says it cannt find the Inline.pm module, and that is true since the deinstallation of perl 5.8.6 previous to installing 5.8.8 removed the packages. I had to reinstall all of them.
         
        output of perl -V is :
         
        [root@FC4-Casinfo perltestP]# perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.11-1.1369_fc4, archname=i686-linux uname='linux fc4-casinfo 2.6.11-1.1369_fc4 #1 thu jun 2 22:55:56 e +dt 2005 i686 i686 i386 gnulinux ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after- +statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT +S=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement + -I/usr/local/include' ccversion='', gccversion='4.0.2 20051125 (Red Hat 4.0.2-8)', gccos +andvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl. +a gnulibc_version='2.3.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Nov 22 2007 07:57:47 @INC: /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl . [root@FC4-Casinfo perltestP]#