Giter VIP home page Giter VIP logo

Comments (6)

rikyoz avatar rikyoz commented on June 3, 2024 1

Hey, sorry for the late reply!

I am sorry, I wasn't very clear regarding the operating system. I wanted to use Linux, however the problem is that (as for my understanding) there are no official build scripts for 7-zip for Linux. I wanted to build shared library for version 23.01.

I see. Building the 7-Zip library for Linux is actually fairly easy.
In the source code of 7-Zip, you go to the directory CPP/7zip/Bundles/Format7zF/, and from there, you run the command make -j -f ../../cmpl_gcc.mak (if you want to use GCC) or make -j -f ../../cmpl_clang.mak (if you wish to use Clang).
After the build finishes, you will find the 7z.so in a subdirectory of CPP/7zip/Bundles/Format7zF/.

For example:

> cd $7ZIP_SRC/CPP/7zip/Bundles/Format7zF/
> make -j -f ../../cmpl_gcc.mak
...
> ls -lh b/g/7z.so
-rwxrwxrwx 1 rikyoz rikyoz 2.7M Feb 28 08:47 b/g/7z.so

or even better to build 7-zip optionally during installation of bit7z. But I guess this will be a lot of work

In the mid-term, I plan to write some documentation in the Wiki on how to build the libraries on all the supported platforms. In the long term, I plan to make it easy to build the libraries, possibly within the same process of building bit7z.

from bit7z.

rikyoz avatar rikyoz commented on June 3, 2024

Hi!

It is my first day with it and I've read about compatibility issues with 7zip versions. I see that the library is downloading 7zip sources, but does not build them. Does it mean that I should build them on my own or am I missing something?

I assume you're referring to the 7-Zip Version section of the README.

To be clear, on Windows, there should be no compatibility issues between different versions of the 7-Zip library and bit7z since the interfaces exposed by 7-Zip haven't changed in a long time.
So, for example, if you're using the DLLs from 7-Zip v21.01 with a bit7z built with 7-Zip 23.01, you should have no problems.
I have done many such tests and never had any problems.
In general, however, I always recommend building bit7z for the same version of the DLLs you want to use in your program. This is more to be on the safe side and to avoid unforeseen compatibility problems.

The situation is different on Linux and MacOS, where 7-Zip 23.01 and later have introduced some breaking changes to the public API of the libraries. In this case, either specify the correct version using the BIT7Z_7ZIP_VERSION CMake option or, if you plan to use the shared libraries from 7-Zip 22.01 and earlier (or from p7zip), enable the BIT7Z_USE_LEGACY_IUNKNOWN build flag.

As for the need to build the libraries, it is not needed on Windows: you can use the 7z.dll that comes with 7-Zip (i.e., the one installed in C:\Program Files\7-Zip\/C:\Program Files (x86)\7-Zip\); if you only need to handle the 7z format, you can also download the 7za.dll from the 7-Zip website (the "extra" package).

Unfortunately, 7-Zip does not provide precompiled versions of the shared libraries for Linux and MacOS. I can provide the instructions for building them (which I'll eventually write down somewhere in the documentation anyway).

I hope to have explained it well, but if you have any further questions, feel free to ask.

PS. I've noticed that for version 4.0.5 (tag) CMake states: "Target Version: 4.0.4"

Thanks for pointing it out, I didn't notice it!
I must have forgotten to update the version in the CMake project.

from bit7z.

TrueWodzu avatar TrueWodzu commented on June 3, 2024

Hi @rikyoz thank you for the detailed answer. I am sorry, I wasn't very clear regarding the operating system. I wanted to use Linux, however the problem is that (as for my understanding) there are no official build scripts for 7-zip for Linux. I wanted to build shared library for version 23.01.
Have you tried to build 7-Zip on Linux?
Edit:
Ah, I see that you know how to do this! :) It is no rush, it would be great to have the instructions some day, or even better to build 7-zip optionally during installation of bit7z. But I guess this will be a lot of work :)

from bit7z.

TrueWodzu avatar TrueWodzu commented on June 3, 2024

BTW: I've found precompiled .so files for the newest version: https://packages.ubuntu.com/noble/7zip
The problem is that it probably depends on other new packages that are not available on Ubuntu 22.04 which I am using currently.

from bit7z.

TrueWodzu avatar TrueWodzu commented on June 3, 2024

Hey @rikyoz thank you very much, I would never figure out that the build script is there!

from bit7z.

rikyoz avatar rikyoz commented on June 3, 2024

You're welcome! :)

from bit7z.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.