How can I use two versions of libsqilite 3 in linux? - linux

I posted this question a while ago in the qnap forum but had no answer (http://forum.qnap.com/viewtopic.php?p=480557&sid=8bb86fda3f81fff50c82dc0e74810188), so I decided to post it here also.
On my customers QNAP boxes, I have an old version of the sqlite3 library, /usr/lib/libsqlite3.so.0.8.6, but for software like duplicati backup, I need a higher version. I compiled sqlite amalgamation version 3080704 successfully on the box.
Is it enough to copy the compiled .so lib in /usr/lib to allow duplicati to use the good one (duplicati complains about an old version of the library if I use the builtin).
Duplicati is (L)GPL software written in C# (.NET) that runs just fine in MONO, but I guess I can't compile it to include the sqlite3 library statically.
Does anyone have a similar issue with lib versions, and may be a possible solution ?
Cheers, Francesco.

The solution lies in linux mono's "DllMaps", and it is documented in the article I posted in the qnap forum (see link in question).

Related

How do I use 7zip in a .NET Core app running on Linux?

We've got a .NET Core app that was hosted in Azure Service Fabric. Now we are moving it to Linux-based Docker containers.
We need to be able to create 7zip archives for an external service (one of those fancy "drop your files here via ftp" interfaces which requires 7zip archives).
Until now we could use a CLI wrapper ported from .NET Framework to .NET Core. But that does no longer work once we switch to a Linux environment.
We can't change the external service (because it is not ours) and we don't want to use Windows-based Docker containers.
There is a large number of 7zip NuGet packages for .NET Framework. Very few for .NET Core (mostly outdated and no longer maintained). And none I could find for .NET Core on Linux.
Do you have any suggestions on how we could solve that issue?
UPDATE: I found one similar question among the open issues of the SevenZipSharp project. Sadly there is no solution included.
UPDATE 2: Unfortunately we can't use an alternative implementation of the LZMA algorithm. Our 3rd party requires archives in the .7z format :-(
This is not an answer as it doesn't really provide a solution to the question, but it does address why it unlikely there will come an updated 7Zip library for Linux and address the problem with a good LZMA OS-cross-platform compression engine. So it should be seen as a long Comment, I hope it's okay.
It seems 7Zip is not maintained on Linux at all, current library is rather old, and I don't trust it's compatibility with the current and newer Windows 7Zip versions, so in my view 7Zip on Linux is a no-go. It's my understanding that Igor Pavlov (creator and maintainer of Zip) only target Windows. And he's not the creator of the current and old Linux 7Zip library.
A LZMA compression engine with both Linux and Windows support is LZip (.lz).
The latest library (zlib) is 1.11 and in July 2019 I sent a request to Domani Hannes to compile a new Windows version and he was to kind to reply with a download link and the following message:
I just now built plzip-1.8 with lzlib-1.11 and mingw-w64-winpthreads-v6.0.0.
There are no longer modifications necessary to be able to compile for Windows, so it's pretty straightforward.
I guess it mean it's easy to compile newer Windows versions in the future too.
Download link to this binary: plzip_zlib_1.11.exe.
I haven't have time to test it thoroughly yet for my own project, so if anyone go down this path please share your experiences (with a risk of hijacking this thread, so maybe not :-P).

Application deployment with 3rd-party dependencies for both Linux and Windows, using CMake and Conan

I'm working on a project, which targets both Windows and Linux (and possible in the future MacOS). It consists of some applications with several shared libraries. It is written in modern C++ and modern CMake. It also uses 3rd-party libraries like Qt, OpenCV, Boost, GraphicsMagick, samplerate, sndfile. Those dependencies are handled through Conan package manager. I'm building both on Linux (Ubuntu 18.04, GCC 8.1) and Windows (via WSL - also Ubuntu 18.04, MinGW-w64 8.1). I'm using fairly recent versions of 3rd-party libraries with custom built options (strictly speaking - different versions than available on Ubuntu's APT, e.g. Qt v5.11.3, or custom built of GraphicsMagick)
I'm using CPack. On Windows I'm building NSIS installer, but on Linux I would like to use DEB generator (may be other if needed). All of my targets (written apps and shared libs) have appropriate CMake's INSTALL configurations, so they are copied correctly into the generated installers (component based installation). The real problem comes with packaging of 3rd-party dependencies.
Problem
Strictly speaking, I have no idea, how to do it well using CMake+CPack+Conan, both on Linux and Windows. I've read a lot of articles and posts, but I'm stucked. I would like to have something, that automatically bundles into the installer all 3rd party libraries used by project with needed plugins and, what is the most important, with needed system/compiler libraries (libgomp, libstdc++ and so on).
Possible solution
To my surprise, on Windows, this task is fairly easy, because every DLL used by app (my libs, 3rd-party libs and system/compiler libs) needs to be located where executable is. I'm engaging Conan into this, by importing all used DLLs into bin directory. In the end, in most naive way of packaging, I will just copy the bin directory into the installer and it should work. But I'm not sure, if this approach is OK.
On Linux, things are more complicated. First, there is arleady a package manager. Unfortunately, libraries/compilers available there are too old for me (e.g. on APT there is only Qt 5.9.6 ) and are built using different compile options. So, the only way for me is to ship them with my software (like in Windows). There are also issues with searching for dynamic libraries by ld, RPATH handling and so on. At the moment, the only solution I see is to write something like 'launcher' for my app, which sets LD_LIBRARY_PATH before program starts. After that, in this case we can just copy bin or lib directory to the DEB installer and this should work. But still, I don't know if this is correct approach.
Other solutions
I've also looked into other solutions. One of them was BundleUtilities from CMake. It doesn't work for me. It has a lot of problems in recognizing, whether some library is system or local one. Especially in WSL, where it stucked in processing dependencies to USER32.dll, KERNEL32.dll. BundleUtilities in Windows worked for me only with MSYS, but in MSYS I've failed to compile some 3rd-party libraries (GraphicsMagicks via Conan) and that's the reason, why I'm using WSL.
Summary
I'm looking for good and verified method of packaging C++ projects with multiple apps, libs and shipped 3rd-party libs, both for Windows and Linux. How are you doing things like this? Are you just copying bin and/or lib dirs to the installers? How (in terms of CMake/CPack code) are you doing that? INSTALL(DIRECTORY ...), or similar? I'm not sure, but I think that this problem should be already solved in the industry. ;)
Thanks for all suggestions.
First, Conan is a package manager for development, not for distribution, that's why you didn't find an easy way to solve your problem. Second, most of discussions are made at Conan issue, including bugs and questions. There you will find a big community + Conan devs which are very helpful.
with needed system/compiler libraries
This is not part of Conan. Why you don't use static linkage for system libraries?
Talking about CPack, we have an open discussion about it usage with Conan: https://github.com/conan-io/conan/issues/5655
Please, join us.
I see few options for your case:
on package method, run self.copy and all dependencies from self.cpp_deps, which includes all libraries, so you can run Cpack
Use Conan deploy generator to deploy all artifacts, and using a hook you can run cpack or any other installer tool
Out friend SSE4 is writing a new blog post about Deployment + Conan, I think it can help you a lot. You can read a preview here.
Regards!

Program package to work with all the Linux distribution

I'm currently working on a Linux project. This project needs to run under every Linux distribution (without installing any package/libraries/others for the clients) and it's a bit hard to do it well.
I already tried to do it myself, see this, i have also tried to use CDE but it didn't work well since i got an error with some distribution. For example:
Ubuntu 8.04: Impossible to read the header ELF
Debian 7.8: version of GLIBC_2.14 not found
So, i would like to know if there is a way to get a package of my program who can run under every Linux distribution.
Thanks
Edit: I would like to avoid the static compilation, since my program is pretty big.
There are big differences between linux distributions, especially version of libraries and package management system.
The only way how to do it is to build/compile your project against all libraries you need to use statically, and distribute them with your project.
For example skype and ejabberd do it this way.

Install Webobjects 4.5.1 on ubuntu

My client using webobjects 4.5(one of the last versions that supports Objective-C) on backend. And I need to develop using this framework.
Problem is that I'm using Ubuntu linux
I've tried to found how I can install framework on my OS, but found only WO 5.4
What can you advise? How I can install WO 4.5 On ubuntu?
P.S. Found GnuStep project. Is it fully compatible alternative to WO 4.5?
I have no experience with any of these frameworks; but it appears there are at least two that are meant to be WebObjects 4.5-compatible (with extensions of their own): GNUstepWeb and SOPE.
GNUstepWeb is part of GNUstep, but GNUstep on the whole is more analogous to Cocoa, not just WebObjects. I am skeptical that there is anything "fully compatible", but these two might be worth checking out.
Since the Objective C runtime has never been ported to Ubuntu, and there is no reason for Apple to ever do this, one cannot run WO 4.5 on a Linux distro. I think it actually was shipped to also run on Windows NT and on HP/UX and Solaris, but these probably will not help you either.
I am not sure if you can use the GnuStep code for any commercial work. I would be surprised if any lawyer would ever sign off on its use. But YMMV.
Sorry, but there does not seem to be any good news for you.

Is the sound library WINMM.DLL found in every Windows Installation?

I'm making a little open source mp3 player for people to see the code, etc. Proper comments, examples and what not.
I was wondering though, is the winmm.dll library found in every Windows installation?
The documentation for winmm.dll functions (like PlaySound) says that they are available in Windows 2000 and later versions.

Resources