-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
235 lines (154 loc) · 7.26 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
Compress-Raw-Lzma
Version 2.213
28 August 2024
Copyright (c) 2009-2024 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
DESCRIPTION
-----------
This module provides a Perl interface to allow reading and writing of lzma, lzip
and xz files/buffers.
PREREQUISITES
-------------
Before you can build Compress-Raw-Lzma you need to have the following
installed on your system:
* A C compiler
* Perl 5.006 or better.
* A copy of liblzma
liblzma is part of the XZ Utils which is available at
http://tukaani.org/xz/
Next you must edit the file config.in that comes with this distribution.
If necessary, change the INCLUDE and LIB variable to the directories where
liblzma and the lzma include file are installed.
BUILDING THE MODULE
-------------------
Assuming you have met all the prerequisites, the module can now be built
using this sequence of commands:
perl Makefile.PL
make
make test
INSTALLATION
------------
To install Compress-Raw-Lzma, run the command below:
make install
TROUBLESHOOTING
---------------
Build fails on Debian/Ubuntu
----------------------------
If you are running a Debian/Ubuntu derivative you need to install the
liblzma-dev package.
There is a similarly named package called lzma-dev that will not work
with this code.
You will get this error if you have the wrong (or neither) package installed
Lzma.xs:18:10: fatal error: lzma.h: No such file or directory
18 | #include "lzma.h"
| ^~~~~~~~
compilation terminated.
Install liblzma-dev by running
sudo apt install liblzma-dev
Test harness fails with: Undefined symbol "lzma_properties_size"
----------------------------------------------------------------
If the module appears to have built correctly, but the t/001version.t test
harness fails with the error
Undefined symbol "lzma_properties_size"
it means you have two libraries called liblzma installed on your system.
The version of liblzma used by this module comes from http://tukaani.org/xz/.
There is another distribution, that comes from
http://tokyocabinet.sourceforge.net/misc/ that also builds a library called
liblzma. The tokyocabinet version of liblzma is not compatible with this
module. Note that the Perl module Compress-Lzma-Simple uses the
tokyocabinet version of liblzma.
The solution is either:
1. Set the ZLIB_LIB variable in config.in to point to the directory where
the correct liblzma library is installed.
2. Remove the offending version of liblzma.
Solaris build fails with "language optional software package not installed"
---------------------------------------------------------------------------
If you are trying to build this module under Solaris and you get an
error message like this
/usr/ucb/cc: language optional software package not installed
it means that Perl cannot find the C compiler on your system. The cryptic
message is just Sun's way of telling you that you haven't bought their
C compiler.
When you build a Perl module that needs a C compiler, the Perl build
system tries to use the same C compiler that was used to build perl
itself. In this case your Perl binary was built with a C compiler that
lived in /usr/ucb.
To continue with building this module, you need to get a C compiler,
or tell Perl where your C compiler is, if you already have one.
Assuming you have now got a C compiler, what you do next will be dependent
on what C compiler you have installed. If you have just installed Sun's
C compiler, you shouldn't have to do anything. Just try rebuilding
this module.
If you have installed another C compiler, say gcc, you have to tell perl
how to use it instead of /usr/ucb/cc.
This set of options seems to work if you want to use gcc. Your mileage
may vary.
perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" "
make test
If that doesn't work for you, it's time to make changes to the Makefile
by hand. Good luck!
Solaris build fails with "gcc: unrecognized option `-KPIC'"
-----------------------------------------------------------
You are running Solaris and you get an error like this when you try to
build this Perl module
gcc: unrecognized option `-KPIC'
This symptom usually means that you are using a Perl binary that has been
built with the Sun C compiler, but you are using gcc to build this module.
When Perl builds modules that need a C compiler, it will attempt to use
the same C compiler and command line options that was used to build perl
itself. In this case "-KPIC" is a valid option for the Sun C compiler,
but not for gcc. The equivalent option for gcc is "-fPIC".
The solution is either:
1. Build both Perl and this module with the same C compiler, either
by using the Sun C compiler for both or gcc for both.
2. Try generating the Makefile for this module like this perl
perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" " LD=gcc
make test
This second option seems to work when mixing a Perl binary built
with the Sun C compiler and this module built with gcc. Your
mileage may vary.
HP-UX Notes
-----------
I've had a report that when building Compress-Raw-Lzma under HP-UX that it
is necessary to have first built the lzma library with the -fpic
option.
SUPPORT
-------
General feedback/questions/bug reports should be sent to
https://github.com/pmqs/Compress-Raw-Lzma/issues
FEEDBACK
--------
How to report a problem with Compress-Raw-Lzma.
To help me help you, I need all of the following information:
1. The Versions of everything relevant.
This includes:
a. The *complete* output from running this
perl -V
Do not edit the output in any way.
Note, I want you to run "perl -V" and NOT "perl -v".
If your perl does not understand the "-V" option it is too
old. This module needs Perl version 5.004 or better.
b. The version of Compress-Raw-Lzma you have.
If you have successfully installed Compress-Raw-Lzma, this one-liner
will tell you:
perl -MCompress::Raw::Lzma -e 'print qq[ver $Compress::Raw::Lzma::VERSION\n]'
If you are running windows use this
perl -MCompress::Raw::Lzma -e "print qq[ver $Compress::Raw::Lzma::VERSION\n]"
If you haven't installed Compress-Raw-Lzma then search Compress::Raw::Lzma.pm
for a line like this:
$VERSION = "2.213" ;
c. The version of lzma you have used.
If you have successfully installed Compress-Raw-Lzma, this one-liner
will tell you:
perl -MCompress::Raw::Lzma -e "print q[lzma ver ]. Compress::Raw::Lzma::ZLIB_VERSION.qq[\n]"
If not, look at the beginning of the file zlib.h.
2. If you are having problems building Compress-Raw-Lzma, send me a
complete log of what happened. Start by unpacking the Compress-Raw-Lzma
module into a fresh directory and keep a log of all the steps, including
the setting of configuration environment variables (if applicable).
[edit config.in or set environment varialbes, if necessary]
perl Makefile.PL
make
make test TEST_VERBOSE=1
Paul Marquess <pmqs@cpan.org>