In Mac OS X (snow leopard) have libxml2 installed in /usr/local and I'm trying to install XML::LibXML, but for some reason the Makefile can't find it. I need some help. Here is the output when I run Makefile.PL.
perl Makefile.PL LIBS='-L/usr/local/lib -lxml2 -lz -lpthread -liconv - +lm' INC='-I/usr/local/include/libxml2' Set up build environment without MacOSX10.4u SDK (will build native bi +naries) enable native perl UTF8 looking for -lxml2... no looking for -llibxml2... no libxml2 not found Try setting LIBS and INC values on the command line Or get libxml2 from http://xmlsoft.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are.
So I ran with DEBUG turned on & here is what I see:
perl Makefile.PL LIBS='-L/usr/local/lib -lxml2 -lz -lpthread -liconv - +lm' INC='-I/usr/local/include/libxml2' DEBUG=1 Set up build environment without MacOSX10.4u SDK (will build native bi +naries) enable native perl UTF8 looking for -lxml2... perl Makefile.PL 'INC=-I/usr/local/include/libxm +l2' 'LIBS=-L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm' 'DEFINE= + -DHAVE_UTF8' Set up build environment without MacOSX10.4u SDK (will build native bi +naries) INC = -I/usr/local/include/libxml2 LIBS = -L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm DEFINE = -DHAVE_UTF8 Writing Makefile for Conftest make test 'OTHERLDFLAGS=' cp Conftest.pm blib/lib/Conftest.pm /usr/local/ActivePerl-5.10/bin/perl /usr/local/ActivePerl-5.10/lib/Ext +Utils/xsubpp -typemap /usr/local/ActivePerl-5.10/lib/ExtUtils/typema +p Conftest.xs > Conftest.xsc && mv Conftest.xsc Conftest.c gcc -c -I/usr/local/include/libxml2 -fno-common -DPERL_DARWIN -DUSE_S +ITECUSTOMIZE -fno-merge-constants -DPRIVLIB_LAST_IN_INC -fno-strict-a +liasing -pipe -O3 -DVERSION=\"1\" -DXS_VERSION=\"1\" "-I/usr/local +/ActivePerl-5.10/lib/CORE" -DHAVE_UTF8 Conftest.c Running Mkbootstrap for Conftest () chmod 644 Conftest.bs rm -f blib/arch/auto/Conftest/Conftest.bundle LD_RUN_PATH="/usr/local/lib:/usr/lib" env MACOSX_DEPLOYMENT_TARGET=10. +3 cc -bundle -undefined dynamic_lookup -Wl,-search_paths_first Conft +est.o -o blib/arch/auto/Conftest/Conftest.bundle \ -L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm \ ld: warning: in /usr/local/lib/libiconv.dylib, missing required archit +ecture x86_64 in file chmod 755 blib/arch/auto/Conftest/Conftest.bundle cp Conftest.bs blib/arch/auto/Conftest/Conftest.bs chmod 644 blib/arch/auto/Conftest/Conftest.bs PERL_DL_NONLAZY=1 /usr/local/ActivePerl-5.10/bin/perl "-Iblib/lib" "-I +blib/arch" test.pl 1..1 # Running under perl version 5.010000 for darwin # Current time local: Wed Jan 26 19:57:39 2011 # Current time GMT: Thu Jan 27 03:57:39 2011 # Using Test.pm version 1.25 Can't load 'blib/arch/auto/Conftest/Conftest.bundle' for module Confte +st: dlopen(blib/arch/auto/Conftest/Conftest.bundle, 2): no suitable i +mage found. Did find: blib/arch/auto/Conftest/Conftest.bundle: mach-o, but wrong archite +cture at /usr/local/ActivePerl-5.10/lib/DynaLoader.pm line 206. at test.pl line 2 Compilation failed in require at test.pl line 2. BEGIN failed--compilation aborted at test.pl line 2. not ok 1 # Failed test 1 in test.pl at line 1 # test.pl line 1 is: use Test; BEGIN { plan tests => 1; } END { ok($l +oaded) } make: *** [test_dynamic] Error 2 system call to 'make test 'OTHERLDFLAGS='' failed at Makefile.PL line +470. no looking for -llibxml2... perl Makefile.PL 'INC=-I/usr/local/include/li +bxml2' 'LIBS=-L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm' 'DEFI +NE= -DHAVE_UTF8' Set up build environment without MacOSX10.4u SDK (will build native bi +naries) INC = -I/usr/local/include/libxml2 LIBS = -L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm DEFINE = -DHAVE_UTF8 Writing Makefile for Conftest make test 'OTHERLDFLAGS=' cp Conftest.pm blib/lib/Conftest.pm /usr/local/ActivePerl-5.10/bin/perl /usr/local/ActivePerl-5.10/lib/Ext +Utils/xsubpp -typemap /usr/local/ActivePerl-5.10/lib/ExtUtils/typema +p Conftest.xs > Conftest.xsc && mv Conftest.xsc Conftest.c gcc -c -I/usr/local/include/libxml2 -fno-common -DPERL_DARWIN -DUSE_S +ITECUSTOMIZE -fno-merge-constants -DPRIVLIB_LAST_IN_INC -fno-strict-a +liasing -pipe -O3 -DVERSION=\"1\" -DXS_VERSION=\"1\" "-I/usr/local +/ActivePerl-5.10/lib/CORE" -DHAVE_UTF8 Conftest.c Running Mkbootstrap for Conftest () chmod 644 Conftest.bs rm -f blib/arch/auto/Conftest/Conftest.bundle LD_RUN_PATH="/usr/local/lib:/usr/lib" env MACOSX_DEPLOYMENT_TARGET=10. +3 cc -bundle -undefined dynamic_lookup -Wl,-search_paths_first Conft +est.o -o blib/arch/auto/Conftest/Conftest.bundle \ -L/usr/local/lib -lxml2 -lz -lpthread -liconv -lm \ ld: warning: in /usr/local/lib/libiconv.dylib, missing required archit +ecture x86_64 in file chmod 755 blib/arch/auto/Conftest/Conftest.bundle cp Conftest.bs blib/arch/auto/Conftest/Conftest.bs chmod 644 blib/arch/auto/Conftest/Conftest.bs PERL_DL_NONLAZY=1 /usr/local/ActivePerl-5.10/bin/perl "-Iblib/lib" "-I +blib/arch" test.pl 1..1 # Running under perl version 5.010000 for darwin # Current time local: Wed Jan 26 19:57:40 2011 # Current time GMT: Thu Jan 27 03:57:40 2011 # Using Test.pm version 1.25 Can't load 'blib/arch/auto/Conftest/Conftest.bundle' for module Confte +st: dlopen(blib/arch/auto/Conftest/Conftest.bundle, 2): no suitable i +mage found. Did find: blib/arch/auto/Conftest/Conftest.bundle: mach-o, but wrong archite +cture at /usr/local/ActivePerl-5.10/lib/DynaLoader.pm line 206. at test.pl line 2 Compilation failed in require at test.pl line 2. BEGIN failed--compilation aborted at test.pl line 2. not ok 1 # Failed test 1 in test.pl at line 1 # test.pl line 1 is: use Test; BEGIN { plan tests => 1; } END { ok($l +oaded) } make: *** [test_dynamic] Error 2 system call to 'make test 'OTHERLDFLAGS='' failed at Makefile.PL line +470. no libxml2 not found Try setting LIBS and INC values on the command line Or get libxml2 from http://xmlsoft.org/ If you install via RPMs, make sure you also install the -devel RPMs, as this is where the headers (.h files) are.
Any idea what I'm doing wrong?

In reply to Installation problem - XML::LibXML on snow leopard with ActivePerl by rovingeyes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.