Initial zlib uncompress, compress support. Based partially on #553.#1206
Initial zlib uncompress, compress support. Based partially on #553.#1206StefanKarpinski merged 1 commit intoJuliaLang:masterfrom
Conversation
|
(I should add that I couldn't get his C wrapper code to work. Julia finds libz.so fine, but the c-wrapper code couldn't see any of the functions. I never did figure out why, but since these functions work fine in Julia, I didn't worry about it too much.) Kevin |
extras/zlib.jl
Outdated
There was a problem hiding this comment.
Perhaps we can drop the _jl_ in front of library handles, now that it is in a module?
|
Does it make sense to have a CompressedByteArray type, and have |
|
This should be ready for review. Discussion on CompressedByteArray and related things here: https://groups.google.com/d/topic/julia-dev/PlZjZRBARck/discussion |
|
Finally figured out how to squash commits and have that appear on github! |
|
Is it possible to have an |
|
The doubling of the allocated result in This may be a larger issue over and above the basic zlib interface - whether we should have some kind of a header in the compressed array that saves the size of the uncompressed data. |
|
On Saturday, August 25, 2012, Viral B. Shah wrote:
I can fix up the "CompressedByteArray" branch and submit that as a separate Kevin |
I should be able to do that. I think the best way is to create a separate In reality, we need to wrap the streaming zlib interface, which will Kevin |
|
@ViralBShah, let me know what you think of this and what else might be needed. |
|
One thought: when building zlib on a 64-bit machine, it would be nice (though not necessary) to specify -64. Is there an easy way of knowing if we're on a 64-bit machine? (OpenBLAS seems to have some tests, but they seemed a little too specific.) |
|
I think we are in reasonable shape for a first cut. As we start using it more, we will have more clarity on the higher level interfaces (CompressedArray) and lower-level zlib functions. As for building, doesn't zlib configure detect it is on a 64-bit machine? What are the benefits of -64? |
|
On Sun, Aug 26, 2012 at 12:10 AM, Viral B. Shah notifications@github.comwrote:
Ok, that should have been -m64, and it's not actually necessary. So, carry Kevin |
|
BTW, I'm in the process of finalizing/documenting this. One final change I plan to make is to split out the header stuff (similar to glpk_h.jl), so that I can use it in a separate gzip module. |
|
Anything else? Should I squash this to one commit? |
|
I am ok with merging this. Unless anyone says otherwise, I will merge it in a day or so. |
|
Okay, really done now. I switched the types to the expected corresponding julia types, and added a test to make sure they match the compile types of zlib. The functions are a bit cleaner this way, IMHO. |
|
I think this makes more sense as a single, squashed commit. I don't think the refactoring history will be much use in master. |
|
Done! |
Initial zlib uncompress, compress support. Based partially on #553.
) Stdlib: LinearAlgebra URL: https://github.com/JuliaLang/LinearAlgebra.jl.git Stdlib branch: master Julia branch: master Old commit: e7da19f New commit: f781708 Julia version: 1.13.0-DEV LinearAlgebra version: 1.12.0(Does not match) Bump invoked by: @KristofferC Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/LinearAlgebra.jl@e7da19f...f781708 ``` $ git log --oneline e7da19f..f781708 f781708 use the custom sysimage when running documentation (and doctests) as well (#1226) 8fdbfd5 Add `getindex` for `SymTridiagonal` using a `BandIndex` (#1223) 91b8845 Use `BandIndex` directly in `diagzero` call in `getindex` (#1222) ef7ef3a Restrict triangular type aliases to `AbstractMatrix`es (#1220) af7a9ac Use `BandIndex` directly in `diagzero` call in `getindex` for banded matrices 579b5f7 Specialize Diagonal * Adjoint (#1207) 5cf41c4 Indirection in matrix multiplication to avoid ambiguities (#1210) 0a9c164 Remove specialized `issymmetric`/`ishermitian` for `Diagonal{<:Number}` (#1213) ff5648a Make unitary matrices in `svd`/`eigen` of `Diagonal` be unitless (#1155) e096a03 Don't mutate arrays in symmetric trig functions (#1206) c234bed Loop over `diagind` in `diag` for banded matrices (#1211) 57785c7 More resizing for truncating return values from LAPACK (#1190) b464203 Materialize adjoint in mul with `HermOrSym` (#1191) 16d9d61 Restrict Diagonal sqrt branch to positive diag (#1203) baa48b7 Verbose `showerror` for `SingularException` (#1204) e0b59a7 Remove `LinearAlgebra` qualifications in `cholesky.jl` (#1209) 95d009b Remove `LinearAlgebra` qualifications in `cholesky.jl` c550974 change to pivot ed35a37 Add fast path in generic matmul (#1202) 8c7fe68 Detailed `showerror` for `SingularException` 2a1696a Explicitly declare type constructor imports (#1196) 101f766 Added note to BLAS.[g|s]et_num_threads about Apple Accelerate not supporting it (#1195) 5aca26f Simplify `getproperty` for `Cholesky*` (#1197) 924dda4 remove copy-allocation on accessing `cholesky` factors (`.L`, `.U`) (#1186) 6f02532 Use `BLAS.trsm!` instead of `LAPACK.trtrs!` in left-triangular solves (#1194) ``` Co-authored-by: KristofferC <1282691+KristofferC@users.noreply.github.com>
RIght now, this only includes compress and uncompress functions. These are a "high-level" interface in zlib. @choffstein had originally started writing a wrapper in C around these functions, but it turns out they are easily callable directly from Julia. Lower level C functions offering more control of the compression/decompression process are available, but require passing of structs, and therefore may be more challenging to interact with without a C wrapper.
I've exposed a number of zlib.h internal constants. Most of these are not used by compress/uncompress and related functions. Some are used by the gzip related functions, and some are used by lower-level functions that I'm not planning to implement right now (though someone else should feel free to if they have a need). I do have julia wrapper functions for almost all of the gzip file functions, along with an IOStream-like interface. I'll send a pull request for that once this gets through comments (or package it separately in its own repo).
Question of the day: this depends on zlib, another C library. It's a pretty core library in many places, but is it something you want as part of the main distribution, or should it be put into a separate module?
Kevin