You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2003/11/11 17:19:09 UTC

[Chance Younkin ] Re: [Chance Younkin ] XML::Xerces trouble

Jason:

Thanks for the reply.  Further information is embedded below...

CRY

Jason E. Stewart wrote:

>jason@openinformatics.com (Jason E. Stewart) writes:
>
>  
>
>>I have attempted several times to build XML::Xerces for Perl.  I still 
>>haven't been successful.  I've done several searches on the web to find 
>>help but have come up empty.  Thus I've decided to bother you...I hope 
>>you can help me.
>>
>>BACKGROUND:
>>My operating system:        SunOS 5.7
>>My C++ compiler:            Sun WorkShop 6 2000/04/07 C++ 5.1
>>My version of perl:         v5.6.0
>>    
>>
>
>if you want to use unicode, you'll want to upgrade that.
>
>  
>
>>My version of XercesC++:    xerces-c_2_3_0-Sol2.7ForCC
>>My version of XML::Xerces:  XML-Xerces-2.3.0-3
>>    
>>
>
>so far so good.
>
>  
>
>>I downloaded the binary version of XercesC++ to my home directory, 
>>extracted everything from the .gz file, set appropriate environment 
>>variables, and the samples ran just fine.
>>    
>>
>
>ok, that's useful
>
>  
>
>>I then proceeded to follow instructions on downloading and building the 
>>XML::Xerces for Perl.  I created a small script to set up the build 
>>environment.  That script is a csh file whose contents are:
>>
>># Begin csh file
>>setenv PERLLIB /home/younkin/install/XML-Xerces-2.3.0-3/blib/lib
>>setenv MYXERCESCROOT /home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC
>>setenv XERCES_CONFIG $MYXERCESCROOT/etc/config.status
>>setenv XERCES_INCLUDE $MYXERCESCROOT/include
>>setenv XERCES_LIB $MYXERCESCROOT/lib
>>setenv LD_LIBRARY_PATH  $MYXERCESCROOT/lib
>>setenv LD_RUN_PATH 
>>"/lib:/home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/lib:/apps/base/SUNWspro/WS6/lib"
>># End csh file
>>    
>>
>
>Ok, you didn't define XERCESCROOT - which (unfortunately) is critical
>for building things with xerces-c.
>
Yeah, I initiallly tried using XERCESCROOT, but then I got an error 
message saying that the config.status file couldn't be found.  So, I saw 
on your web page that I could use XERCES_LIB and XERCES_INCLUDE 
directly, so I tried that.  Again, it couldn't find config.status.  So, 
I found config.status myself, looked at Makefile.PL, and saw that it 
used XERCES_CONFIG.  That's why you see XERCES_INCLUDE, XERCES_LIB, and 
XERCES_CONFIG set explicitly.  When that still failed, I removed 
XERCESCROOT entirely, but to no avail.

>
>  
>
>>Then I started in following the steps provided on your web page:
>>
>>STEP 1:  perl Makefile.PL
>>This step worked fine, with the following output:
>>
>># Begin output
>>Using XERCES_LIB = /home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/lib
>>Using XERCES_INCLUDE = 
>>/home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/include
>>Using Xerces-C version info from 
>>/home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/include/xercesc/util/XercesVersion.hpp
>>Checking to see if libxerces is in your library path...Success!!
>>Using Xerces-C version: 2.3.0
>>Checking if your kit is complete...
>>Looks good
>>Processing hints file hints/solaris_2.pl
>>Writing Makefile for Handler
>>Writing Makefile for XML::Xerces
>># End output
>>    
>>
>
>Because you didn't define XERCESCROOT, Makefile.PL doesn't know where
>to look to find the config.status file. The Xerces-C people promised
>me that they would start included it for the binary
>distributions. Because I can't read your config.status file, I can't
>find where your C++ compiler is located, nor can I find any of the
>CFLAGS or LDFLAGS used to build Xerces-C - which means Perl has to
>guess, and it is notoriously bad at guessing...
>

See above...

>
>  
>
>>cc -c -I. -IHandler 
>>-I/home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/include -D_REENTRANT 
>>-O     -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" -KPIC 
>>-I/apps/base/lib/perl5/5.6.0/sun4-solaris/CORE  PerlCallbackHandler.cpp
>>cc: No input file specified, no output generated
>>    
>>
>
>This is the error you get when using cc on a C++ file - I can't
>remember why - whether it's a license issue, or what.
>
>  
>
>>I determined that the generated makefiles set the CC variable to 'cc' so 
>>I tried 'CC' (upper case as opposed to lower case).  This helped but I 
>>got the following compiler error:
>>
>># Begin output
>>CC -c -I. -IHandler 
>>-I/home/younkin/install/xerces-c_2_3_0-Sol2.7ForCC/include -D_REENTRANT 
>>-O     -DVERSION=\"2.3.0-3\" -DXS_VERSION=\"2.3.0-3\" -KPIC 
>>-I/apps/base/lib/perl5/5.6.0/sun4-solaris/CORE  Xerces.cpp
>>"Xerces.cpp", line 499: Error: PERL_MAGIC_tied is not defined.
>>"Xerces.cpp", line 845: Warning: String literal converted to char* in 
>>initialization.
>>"Xerces.cpp", line 862: Warning: String literal converted to char* in 
>>initialization.
>>"Xerces.cpp", line 879: Warning: String literal converted to char* in 
>>initialization.
>>"Xerces.cpp", line 896: Warning: String literal converted to char* in 
>>initialization.
>>1 Error(s) and 4 Warning(s) detected.
>># End output
>>
>>
>>I did a 'find' in both the XML_Xerces and xercesc directories and did 
>>not find any definition of PERL_MAGIC_tied anywhere.
>>    
>>
>
>Sorry, 2.3.0-4 solves this problem, that is a Perl-5.8 variable, and
>you're using 5.6. If you don't want to upgrade XML::Xerces again, you
>can simply modify the one use of PERL_MAGIC_tied to be the character:
>'P'. 
>
I changed the PERL_MAGIC_tied to be 'P'.  That made everything build, 
but the "make test" command still fails.

>
>  
>
>>When I tried the previous version of XML::Xerces, I got the same problem 
>>with CC=cc, but it did build after I changed it to upper case.  
>>    
>>
>
>correct, it is a C++ project, you must use CC. XML::Xerces will autodetect
>this if you set the XERCESCROOT variable.
>  
>
As you see from above, this didn't happen for me.

>  
>
>>However, the make test failed and the sample perl scripts provided
>>all caused a core dump.  Like I said, I haven't found anything on
>>the web where folks are having the same problems that I'm having.
>>I've tried several things that aren't worth explaining to you, but
>>have not had any success.
>>    
>>
>
>Please rebuild after setting XERCESCROOT, and if the test scripts
>still dump core, please post the results to the list, and we'll see
>what we can do.
>

I did try it again, just in case I'm crazy...but it failed again.  As I 
said, I still have to manually change the CC make variable from cc to 
CC.  I need to define XERCES_CONFIG myself, and then I can't run "make 
test."

The error I get is:

t/DOMCreate.........Can't load 'blib/arch/auto/XML/Xerces/Xerces.so' for 
module XML::Xerces: ld.so.1: /apps/base/bin/perl: fatal: relocation 
error: file blib/arch/auto/XML/Xerces/Xerces.so: symbol 
__1cLxercesc_2_3QXMLPlatformUtilsKisRelative6FkpkH_c_: referenced symbol 
not found at /apps/base/lib/perl5/5.6.0/sun4-solaris/DynaLoader.pm line 200.
 at blib/lib/XML/Xerces.pm line 7
Compilation failed in require at t/DOMCreate.t line 11.
BEGIN failed--compilation aborted at t/DOMCreate.t line 11.
t/DOMCreate.........dubious

I get this many times, once for each file in the t directory.  When I 
run a script from the samples directory, I get this error:

Can't locate loadable object for module XML::Xerces in @INC (@INC 
contains: /home/younkin/install/XML-Xerces-2.3.0-3/blib/lib 
/apps/base/lib/perl5/5.6.0/sun4-solaris /apps/base/lib/perl5/5.6.0 
/apps/base/lib/perl5/site_perl/5.6.0/sun4-solaris 
/apps/base/lib/perl5/site_perl/5.6.0 /apps/base/lib/perl5/site_perl .) 
at /home/younkin/install/XML-Xerces-2.3.0-3/blib/lib/XML/Xerces.pm line 7
Compilation failed in require at DOMCount.pl line 67.

This seems related to the "make test" errors.  I've tried mucking with 
LD_LIBRARY_PATH and LD_RUN_PATH but nothing seems to help.  Another 
thing to note that I hadn't told you, I've tried 2 previous versions of 
XML::Xerces and had basically the same problems with all three 
versions.  The PERL_MAGIC_tied was a new one with the newest version, 
but the inability to find config.status, the changing of the make var 
CC, and the unlocatable so files has been consistent throughout.

I see that you posted a new version of XML::Xerces yesterday.  I'll give 
it a try and report back.

Lastly, I see that you asked me to "post results to the list" if I have 
trouble.  Well, if I could find "the list" I  would be happy to do that 
and stop bothering you directly.  But I didn't see where I could do 
that.  I checked on-line and in the downloaded doc files and couldn't 
find any information on a list.  Please tell me where it is and I'll 
make sure to use it in the future.

>
>Cheers,
>jas.
>
>.
>
>  
>

-- 
cry@owt.com





---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: XML::Xerces trouble

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Chance Younkin <cr...@owt.com> writes:

> 1.  Yes, I still get the wrong value for CC in the makefile after
>     running Makefile.PL.

Sorry, not sure here. Did you set XERCES_CONFIG properly? If so,
please show me the output of Makefile.PL, thanks.

> 3.  I'll try the next version of XML::Xerces today and see where that
>     gets me.  I'll post any info after that.

Unfortunately, it's not very unlikey to help. Those inline
declarations in Xerces-c are causing the trouble. I've just tried
building the XML-Xerces-2.3.0-4 code against the latest CVS snapshot,
and unfortunately they've changed the public API again.

So you have a few choices:

* build xerces-c-2.3.0 from source, and then delete the offending
  inline directives from XMLPlatformUtils.cpp

* I can add %ignore directives in XML-Xerces to eliminate offending
  methods from Xerces.so

* wait for me to make an experimental XML-Xerces-2.4 release so that
  you can build against the CVS Xerces-C snapshot.

The first is probably the most flexible.

> 4.  I have actually tried building the xerces-c in the past, too.  But
>     I ended up with the same results when building the perl code.
>     That is, "make test" still failed and the sample perls still
>     dumped core.  Basically, I've been having the same problems from
>     the beginning no matter which version of Xerces-C or XML::Xerces
>     perl I've used.  I have a suspicion that it's something simple on
>     my end that would fix all this.  I just can't figure out what the
>     'something simple' is.

I don't think so. If you look at the list archives for last month,
you'll see three other reports of this same problem. In all cases that
I know of, removing the inline directives solved the problem.

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Re: XML::Xerces trouble

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Hi Chance,

Thanks for being so persistent...

jason@openinformatics.com (Jason E. Stewart) writes:

> >Ok, you didn't define XERCESCROOT - which (unfortunately) is critical
> >for building things with xerces-c.
>
> Yeah, I initiallly tried using XERCESCROOT, but then I got an error 
> message saying that the config.status file couldn't be found.  So, I saw 
> on your web page that I could use XERCES_LIB and XERCES_INCLUDE 
> directly, so I tried that.  Again, it couldn't find config.status.  So, 
> I found config.status myself, looked at Makefile.PL, and saw that it 
> used XERCES_CONFIG.  That's why you see XERCES_INCLUDE, XERCES_LIB, and 
> XERCES_CONFIG set explicitly.  When that still failed, I removed 
> XERCESCROOT entirely, but to no avail.

Ah, I see. Yes, if you define XERCESCROOT I expect you to have built
it from source, sorry. You are correct, in that case, you'll have to
set the XERCES_CONFIG variable to be the path to the config.status
file. 

> I changed the PERL_MAGIC_tied to be 'P'.  That made everything
> build, 

Good, thanks.

> but the "make test" command still fails.

expected.

> I did try it again, just in case I'm crazy...but it failed again.
> As I said, I still have to manually change the CC make variable from
> cc to CC.  I need to define XERCES_CONFIG myself, and then I can't
> run "make test."

If you set XERCES_CONFIG to be the path to the config.status file,
what does it report when you run 'perl Makefile.PL'? Does it get the
C++ compiler correct?

> The error I get is:
> 
> t/DOMCreate.........Can't load 'blib/arch/auto/XML/Xerces/Xerces.so' for 
> module XML::Xerces: ld.so.1: /apps/base/bin/perl: fatal: relocation 
> error: file blib/arch/auto/XML/Xerces/Xerces.so: symbol 
> __1cLxercesc_2_3QXMLPlatformUtilsKisRelative6FkpkH_c_: referenced symbol 
> not found at /apps/base/lib/perl5/5.6.0/sun4-solaris/DynaLoader.pm line 200.
>
> I get this many times, once for each file in the t directory.  

Yuck. Ok, here goes...

the bad news:

This is a dynamic loading error that Test::Harness has uncovered. In
order to brutally test the modules, it runs in a special mode that
requires loading of *all* library symbols - usually the dynaloader
loads on demand, only loading the ones it needs for any given
application, but Test::Harness loads all of them, and you are missing
at least one.

the good news:

This is a known issue that is caused by some aggressive inlining of
certain methods in Xerces-C, and the fix is already available in the
latest nightly build of Xerces-C. 

> When I run a script from the samples directory, I get this error:
> 
> Can't locate loadable object for module XML::Xerces in @INC (@INC 
> contains: /home/younkin/install/XML-Xerces-2.3.0-3/blib/lib 
> /apps/base/lib/perl5/5.6.0/sun4-solaris /apps/base/lib/perl5/5.6.0 
> /apps/base/lib/perl5/site_perl/5.6.0/sun4-solaris 
> /apps/base/lib/perl5/site_perl/5.6.0 /apps/base/lib/perl5/site_perl .) 
> at /home/younkin/install/XML-Xerces-2.3.0-3/blib/lib/XML/Xerces.pm line 7
> Compilation failed in require at DOMCount.pl line 67.

This is surprising. Normally, the errors that you found don't actually
effect production code because the methods that got inlined are never
used by XML::Xerces... But you're still failing. It's finding the
Xerces.pm module in blib/lib but it's not able to load Xerces.so,
probably due to a loading error.

Huh.

> This seems related to the "make test" errors.  I've tried mucking with 
> LD_LIBRARY_PATH and LD_RUN_PATH but nothing seems to help.  Another 
> thing to note that I hadn't told you, I've tried 2 previous versions of 
> XML::Xerces and had basically the same problems with all three 
> versions.  The PERL_MAGIC_tied was a new one with the newest version, 
> but the inability to find config.status, the changing of the make var 
> CC, and the unlocatable so files has been consistent throughout.
> 
> I see that you posted a new version of XML::Xerces yesterday.  I'll give 
> it a try and report back.

I'm pretty certain this is a Xerces-C issue, so you'll need to get the
nightly build code. If you don't want to build Xerces-C from scratch I
can add a couple more method %ignore directives for the unneeded
XMLPlatformUtils methods that are causing your loading problem, that
way they will not be included in the Xerces.so library at all.

> Lastly, I see that you asked me to "post results to the list" if I have 
> trouble.  Well, if I could find "the list" I  would be happy to do that 
> and stop bothering you directly.  But I didn't see where I could do 
> that.  I checked on-line and in the downloaded doc files and couldn't 
> find any information on a list.  Please tell me where it is and I'll 
> make sure to use it in the future.

Sorry, it's on the To: line of this email (it is in the README, but I
agree, it's not obvious).

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org