How do I install XML::Xerces? - perl

Please see Part 2 which list latest errors while installing module continued post.
Normally when I try to install XML::Xerces CPAN module using standard cpan> install XML::Xercers than I get following error message after some processing:
XML-Xerces-2.7.0-0/samples/SEnumVal.pl
...
XML-Xerces-2.7.0-0/postSource.pl
XML-Xerces-2.7.0-0/xerces-headers.txt
Removing previously used /home/adoshi/.cpan/build/XML-Xerces-2.7.0-0
CPAN.pm: Going to build J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
WARNING
You have not defined any of the following environment variables:
XERCESCROOT
XERCES_LIB
XERCES_INCLUDE
These instruct me how to locate the Xerces header files, and the
Xerces dynamic library. If they are installed in a standard system
directory, I will located them without those variables.
However, if they have been installed in a non-standard location
(e.g. '/usr/include/xerces'), then I will need help. See the README
for more info.
Proceeding ...
WARNING
You have not defined any of the following environment variables:
XERCESCROOT
XERCES_CONFIG
Without these I cannot find the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to properly
build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Couldn't find XercesVersion.hpp in your include directory at Makefile.PL line 1 88.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
After Setting Enviornment Variables to /home/username/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm, note here am not sure whether I should point my environment variable to Xerces.pm or Xerces.cpp or Xerces-extra.pm or Xerces.i, but for now am pointing environment variables to /home/username/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
After setting environment variables as mentioned and entering cpan>install XML::Xerces I get following message:
CPAN: Storable loaded ok
Going to read /home/username/.cpan/Metadata
Database was generated on Fri, 16 Oct 2009 18:27:06 GMT
Running install for module XML::Xerces
Running make for J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /home/adoshi/.cpan/sources/authors/id/J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz ok
Scanning cache /home/adoshi/.cpan/build for sizes
XML-Xerces-2.7.0-0/
...
XML-Xerces-2.7.0-0/postSource.pl
XML-Xerces-2.7.0-0/xerces-headers.txt
Removing previously used /home/adoshi/.cpan/build/XML-Xerces-2.7.0-0
CPAN.pm: Going to build J/JA/JASONS/XML-Xerces-2.7.0-0.tar.gz
Using XERCES_LIB = /home/adoshi/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
using XERCES_CONFIG: /home/adoshi/XML-Xerces-2.7.0-0/XML-Xerces-2.7.0-0/Xerces.pm
- Found CXX =
- Found CXXFLAGS =
- Found LDFLAGS =
Couldn't find XercesVersion.hpp in your include directory at Makefile.PL line 188, <CONF> line 6823.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
Note: I have tried downloading XML::Xercesand trying to again install it, both manually as well as using CPAN but am getting above mentioned error message.
What can be the possible reason and what can be suggested turn around to take care of this issue ?
Update: Even after building Xerces-C, XML::Xerces module is not building and am getting following error message.
[adoshi#upc01.dev XML-Xerces-2.7.0-0]$ perl Makefile.PL
Using XERCES_LIB = /adoshi/lib
Using XERCES_INCLUDE = /adoshi/include/xerces
WARNING
You have defined the XERCESCROOT variable, but the file:
XERCESCROOT/src/xercesc/config.status
does not seem to point to the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to
properly build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Couldn't find XercesVersion.hpp in your include directory /adoshi/include/xerces at Makefile.PL line 188.
Update2Here is the error which am getting, it says there is somekind of version mismatch.
Using XERCES_LIB = /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/lib
Using XERCES_INCLUDE = /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/include
WARNING
You have defined the XERCESCROOT variable, but the file:
XERCESCROOT/src/xercesc/config.status
does not seem to point to the config.status file that was used to
build your Xerces-C library. Without that file, I may not be able to
properly build the C++ glue files that come with Xerces.pm.
Proceeding anyway ...
Using Xerces-C version info from /home/adoshi/XML-Parser/Parser2/xerces-c_2_8_0-hppa-hpux-acc_3(1)/xerces-c_2_8_0-hppa-hpux-acc_3/include/xercesc/util/XercesVersion.hpp
*** Version Mismatch ***
You are attempt to build XML::Xerces-2.7.0-0 using Xerces-C-2.8.0,
this will most likely fail, so I am aborting.
You must use Xerces-C-2.7.0

Here's a general rule: any environment variable that is named something like "ROOT" is asking for a directory, not a file.
However, it does not appear that you have installed the Xerces library, which is necessary before you install the perl module. I'll quote some portions of the output you provided, as the hint you missed as to what to do next:
"...These instruct me how to locate the Xerces header files, and the Xerces dynamic library..."
"Without these I cannot find the config.status file that was used to
build your Xerces-C library"
So, did you install Xerces-C? You'll have much better results installing the Perl module after that.

Did you try using the PPM to install XML::Xerces?

Related

How do I install mod_perl using cpan for Apache httpd 2.4.41 (xampp) on windows?

I am trying to install a CPAN package (Apache::MP3), for which it requires a number of prerequisites including mod_perl-2.0.11 on Perl and Apache. According to previous question / answer, I may need Visual Studio (both previously compiled using VS) in order to even compile mod_perl module. Which doesn't make sense if perl is included with XAMPP.
But before I got to this point, I had to install dmake (C:\xampp\c\bin\dmake.exe) which I downloaded from CPAN, and extracted myself by placing it into the xampp directory in ...\c\bin... I also downloaded apxs.bat and placed it inside the xampp\apache\bin directory. Next I required a gcc compiler to build the library / modules according to previous errors.
I am now trying to follow the list of errors as I getting them, in order to be successful with the project. The original module (Apache::MP3) isn't important, as I just wanted to be sure that Perl worked in XAMPP. I can in fact use it as a cgi, but the mod_perl is not included with the installation.
The problem I am having is while trying to build while using gcc first with cygwin (which I placed all inside my PATH) ...
\xampp\perl\lib\CORE/win32.h:106:10: fatal error: direct.h: No such file or directory
106 | #include <direct.h>
| ^~~~~~~~~~
compilation terminated.
dmake: Error code 129, while making 'mod_perl.lo'
dmake.exe: Error code 255, while making 'modperl_lib'
and then with C:\MinGW\bin, I am getting this error message ...
C:\xampp\apache\include/http_log.h:37:10: fatal error: syslog.h: No such file or directory
37 | #include <syslog.h>
| ^~~~~~~~~~
compilation terminated. dmake: Error code 129, while making 'mod_perl.lo'
dmake.exe: Error code 255, while making 'modperl_lib'
This error has to do with the compiler and access to its built-in headers that have to do with windows. I tried adding the libraries directory to the PATH (restarted cmd.exe) as well, which had 0 effect. The next thing I might have to do is actually open the Makefile.PL and append the parameters to tell gcc where to find its own header files. Would I be better off installing each component and getting a copy of VS compiler?

How to fix No package 'atk-bridge-2.0' found error even though atk is installed and PKG_CONIG_PATH and LD_LIBRARY_PATH is set?

First I have installed all the dependent packages including atk 2.18.
Then, I have added them to path.
# echo $LD_LIBRARY_PATH
/opt/gtk_+3.12-RHEL6/dependencies/at-spi2-atk/lib:/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/lib:/opt/gtk_+3.12-RHEL6/dependencies/pango/lib:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/lib:/opt/gtk_+3.12-RHEL6/dependencies/freetype/lib:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/lib:/opt/gtk_+3.12-RHEL6/dependencies/cairo/lib:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/lib:/opt/gtk_+3.12-RHEL6/dependencies/libpng/lib:/opt/gtk_+3.12-RHEL6/dependencies/pixman/lib:/opt/gtk_+3.12-RHEL6/dependencies/atk/lib:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/lib:/opt/gtk_+3.12-RHEL6/dependencies/GLib/lib:
# echo $PATH
/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/bin:/opt/gtk_+3.12-RHEL6/dependencies/pango/bin:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/bin:/opt/gtk_+3.12-RHEL6/dependencies/freetype/bin:/opt/gtk_+3.12-RHEL6/dependencies/which/bin:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/sbin:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/bin:/opt/gtk_+3.12-RHEL6/dependencies/cairo/bin:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/bin:/opt/gtk_+3.12-RHEL6/dependencies/libpng/bin:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/bin:/opt/gtk_+3.12-RHEL6/dependencies/GLib/bin:/opt/python_2_7_11/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# echo $PKG_CONFIG_PATH
/opt/gtk_+3.12-RHEL6/dependencies/at-spi2-atk/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/pango/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/freetype/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/cairo/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/libpng/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/pixman/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/atk/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/GLib/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies
But, when I try to run ./configure, I am getting the following error:
checking for ATK... no
configure: error: Package requirements (atk atk-bridge-2.0) were not met:
No package 'atk-bridge-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ATK_CFLAGS
and ATK_LIBS to avoid the need to call pkg-config.
atk 2.18 is cleary added in the PKG_CONFIG_PATH and also LD_LIBRARY_PATH.
So, I though atk-bridge-2.0 is separate and found the packag: at-spi2-atk and at-spi2-core. But, no atk-bridge-2.0 is installed.
Please help.
The atk-bridge-2.0 API is provided by at-spi2-atk, not by ATK.
Your build environment is fairly broken, and it seems you're installing each component into its own prefix. You shouldn't. Create a temporary build root, and add that to $PATH, $PKG_CONFIG_PATH, $LD_LIBRARY_PATH, and $XDG_DATA_DIRS. Then, use the same prefix for every component.
You should look at how jhbuild works.

Perl undefined yp_get_default_domain detected by DynaLoader.pm when using ARSperl, yet library exists

I have a Ubuntu server that recently pushed a Perl update to 5.14.2 when I installed cpanminus. This broke compatibility with the BMC Remedy API module. It looks like I can't roll back to the old version of Perl, so I've tried recompiling ARSperl for Perl 5.14.2.
The problem is, when I run an old Perl script that used the old module, I get the following:
Can't load '/usr/local/lib/perl5/5.14.2/auto/ARS/ARS.so' for module ARS:
/usr/local/lib/perl5/5.14.2/auto/ARS/ARS.so: undefined symbol:
yp_get_default_domain at /usr/local/lib/perl5/5.14.2/i686-linux/DynaLoader.pm line 190.
So, a bit of Googling tells me that yp_get_default_domain lives in libnsl. I've gone so far as to try recompiling both the ARSperl module and Perl itself with "-lnsl" explicitly called out in the Makefile. Unfortunately, this has gotten me nowhere. The library is indeed installed on the system under /usr/lib/i386-linux-gnu/.
In ARSperl Makefile:
LDFLAGS = -fstack-protector -L/usr/local/lib -L/usr/lib -L/usr/lib/i386-linux-gnu -lnsl
My question is therefore two-fold for the Perl gurus out there.
-How can I determine which of Perl, DynaLoader, or the ARS.so itself can't find "yp_get_default_domain"?
-What is the best next step to troubleshoot the above DynaLoader message for a missing library that is actually present on the system and linked in the module?
Thank you in advance for sharing your knowledge and advice.
Add the directory where library is installed to the $ARS_LDPATH in Makefile.PL
Something like
$ARSAPI = "C:\\ARS_Library\\api764win";
if( $WINDOWS ){
$ARS_LDPATH = qq{-L"$ARSAPI/lib"};
$INCLUDES = qq{-I"$ARSAPI/include"};
}else{
$ARS_LDPATH = "-L$ARSAPI/lib";
$INCLUDES = "-I$ARSAPI/include";
}
We updated to ARSperl 1.93, started using AR API version 6.3 rather than 5.1.2 and added "-lsnl" to the ARSperl Makefile.PL $ARS_LIBS in the section for 6.3.
That resulted in Perl segfaulting every time the ARS.so module was run. After lots of testing and trying to diagnose why segfaults were occurring, we recompiled a separate instance of Perl-5.14.2 from source under /opt/ and removed the 64int option. Updating the shebang lines on all our Perl scripts that need the ARS module to redirect to the Perl version under /opt seems to have gotten things working again.
Thank you Chankey Pathak for pointing me toward the Makefile.PL, I wouldn't have immediately started looking at changing things there without this advice.

Building perl module gives metafile error

I'm working on installing a perl module (not using CPAN) on a Linux machine. When I run the command:
perl Build.PL
I get the following error:
ERROR: Missing required field 'dist_abstract' for metafile
Could not get valid metadata. Error is: Invalid metadata structure.
Errors: Missing mandatory field, 'abstract' (abstract) [Validation: 1.4],
value is an undefined string (abstract) [Validation: 1.4]
at /usr/local/share/perl5/Module/Build/Base.pm line 4559
Could not create MYMETA files
I've tried Googling bits and pieces of this error but haven't found any solutions. Just looking for a clue as to what might be causing this error.
Here's a link to a zip file containing the files required to install it:
https://oncourse.iu.edu/access/content/user/brilewis/Filemanager_Public_Files/DataDownloader.zip
First at all please make sure you have package Module::Build installed.
You need ungzip few gzipped files in this package. I don't realize why author gzipped them:
gzip -d *.gz
I really don't know why author archived each install file. It looks like some mistake to me.
Than you can install all dependencies (this module requires some):
./Build installdeps
And then finally install module itself:
./Build
./Build test
./Build install
However I must warn you that this module packaged in a bit strange way and there's no guarantee it works.
The NAME section of the module does not have a - in it, e.g.,
=head1 NAME
Foo::Bar implements a Foo framework.
will fail, but if you make it
=head1 NAME
Foo::Bar - implements a Foo framework.
then it will work.
Do you have root access on your machine? Can you use the cpan utility to build and install your module. Using cpan is fairly straight forward:
$ cpan
After that, it will do a lot of configuration, simply take the default values. When it finishes, it'll come to a cpan> prompt. All you have to do there is type this:
cpan> install Module::Name
Where Module::Name is the module you're trying to install. Check the CPAN archive to get the name of your module.
If there are any dependencies, CPAN will ask if you want to download and install those. Say Yes, and CPAN will install the dependencies, then your module.
Using cpan is the best way to install third party modules you find in the CPAN archive. It takes care of all the dependencies, testing, and building for you.
Try installing through CPAN, and then see if you still have your issues.

How can I safely compile a Perl 5.12 module for Perl 5.8.9?

I want to install File::Fetch, which is a core module in Perl 5.12, in my Perl 5.8.9. In general, I want to compile and install future-dated modules in my back-dated Perl because I cannot upgrade my Perl.
So I downloaded the module and also its dependencies. It's quite painful following the dependency tree but I'm more concerned about the fact that some of them are core modules. If I install these, my Perl 5.8.9 core will have patches from 5.12.
My question is how I can know whether I can safely install the future-dated modules, especially the core modules. Is there a tutorial for this purpose of testing backwardcompatability in Perl?
EDIT:
My module is dual lifed, but I cannot compile it using cpan. It said my FTPsite.yaml has a bad element. However, I followed the dependencies in the modules' META files, and I could compiled the module. Is this one of the odd bits with cpan? Thank you.
I cannot recreate the issue after I installed all those dependencies manually. But here is the error:
cpan[5]> install File::Fetch
Running install for module 'File::Fetch'
Running make for B/BI/BINGOS/File-Fetch-0.24.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Time::HiRes loaded ok (v1.9715)
CPAN: YAML loaded ok (v0.72)
Alert: While trying to 'parse' YAML file
'/Users/martin/.cpan/FTPstats.yml'
with 'YAML' the following error was encountered:
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 3
Document: 1
at /opt/local/lib/perl5/site_perl/5.8.9/YAML.pm line 36
If the module is available separately (i.e. "dual-lifed"), as both a standalone distribution and inside core Perl, then the standalone version is safe to install on an earlier Perl, assuming its Makefile allows it. That is, if you can do cpan <Module> and it builds and tests without errors, then you are good.
The only problem is if a module is not dual-lifed, which I opined about in this question -- which is where you are likely S.O.L.
If a perl core module is also available separately, that means that it is intended to work on older perls (unless it explicitly requires some version of perl), and if it doesn't, that's a bug.
That said, 5.10 was released almost three years ago, and you are going to start seeing more and more problems using newer modules with older versions of perl.
cpan or cpanplus will handle dependencies for you.