Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: 7zip v21.06 official binaries do not contain dynamic libraries to be linked on Linux and macOS. what now? #57

Open
1 task done
vladimir-kraus opened this issue Nov 29, 2021 · 4 comments

Comments

@vladimir-kraus
Copy link

Feature description

Thank you again for working on this very interesting project. I do not know however if this my question is not out of scope. But if I understand well, the bit7z library links dynamically to 7z.dll, 7z.so or 7z.dylib, depending on the platform. But as I noticed in the official downloads for the latest version of 7Zip (21.06) https://www.7-zip.org/download.html the versions for Linux and macOS contain only single-file console-only executables but no dynamic libraries. So there is nothing to link to. How can this problem be solved? Does this require the user to build 7zip dynamic library on their own? If so, couldn't bit7z somehow simplify the process?

Kudos to you!

Additional context

No response

Code of Conduct

@vladimir-kraus vladimir-kraus changed the title [Feature Request]: [Feature Request]: official 7zip v 21.06 binaries do not contain dynamic libraries to be linked on Linux and macOS. what now? Nov 29, 2021
@vladimir-kraus vladimir-kraus changed the title [Feature Request]: official 7zip v 21.06 binaries do not contain dynamic libraries to be linked on Linux and macOS. what now? [Feature Request]: 7zip v21.06 official binaries do not contain dynamic libraries to be linked on Linux and macOS. what now? Nov 29, 2021
@rikyoz
Copy link
Owner

rikyoz commented Nov 29, 2021

Hi!

Thank you again for working on this very interesting project.

Thank you for using it!

if I understand well, the bit7z library links dynamically to 7z.dll, 7z.so or 7z.dylib, depending on the platform.

Yeah, bit7z v4.0 will be able to link to either 7z.dll or 7z.so, according to the platform. I didn't test with 7z.dylib, though: on macOS, I did some tests with the 7z.so from p7zip, which works fine.

But as I noticed in the official downloads for the latest version of 7Zip (21.06) https://www.7-zip.org/download.html the versions for Linux and macOS contain only single-file console-only executables but no dynamic libraries. So there is nothing to link to. How can this problem be solved? Does this require the user to build 7zip dynamic library on their own?

Unfortunately, yes: at least for now, users must build the 7-zip dynamic libraries on their own.

Actually, building the 7z.so shared library is fairly simple on Linux:

cd $7ZIP_SRC/CPP/7zip/Bundles/Format7zF/
make -j -f ../../cmpl_gcc.mak

$7ZIP_SRC is the path to the folder containing the source code of 7-zip.

If so, couldn't bit7z somehow simplify the process?

Yeah, at least I could provide some documentation on how to build the libraries.
I'm also considering creating a build script for automating and simplifying the build process. But, for now, it's not my main objective.

@vladimir-kraus
Copy link
Author

vladimir-kraus commented Nov 30, 2021

Excellent! I am glad that this little obstacle does not prevent us from using bit7z. It seems to me that bit7z 4.0 has the potential to become the best archiving library ever. The power of 7Zip as backend and approachable API provided by bit7z, it is the perfect match! :)

@rikyoz
Copy link
Owner

rikyoz commented Nov 30, 2021

Excellent! I am glad that this little obstacle does not prevent us from using bit7z. It seems to me that bit7z 4.0 has the potential to become the best archiving library ever. The power of 7Zip as backend and approachable API provided by bit7z, it is the perfect match! :)

I hope so!
Thank you for appreciating and supporting the project! 🙏

@LynxesExe
Copy link

I'm also considering creating a build script for automating and simplifying the build process. But, for now, it's not my main objective.

I'm sure you already have a better solution in mind, however if someone is interested in automatically building and copying the 7zip.so artifact, I made this "quick n dirty" way of building it and copying to another location.

Unfortunately you still need to copy the final shared object in a user specified directory to then have the software load it, so I'm not sure how this could be implemented in a build script of bit7z... but as an end user I guess this could work somewhat fine?

Needless to say that this is a bad solution, during the CMake run time (not actual build of the software) it checks to see if a specific directory exists (the sources of 7zip itself), if it doesn't it copies it, builds it, and then copies the result 7z.so to another specified directory.

If you can cancel cmake mid build, you'll have to delete the entire dependency directory and let it re-copy and re-build everything, maybe checking if the resulting 7z.so file is a better idea.

Anyway, hope someone finds this useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants