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

Support shared library in build system #40

Open
rayegun opened this issue Sep 23, 2021 · 7 comments
Open

Support shared library in build system #40

rayegun opened this issue Sep 23, 2021 · 7 comments

Comments

@rayegun
Copy link

rayegun commented Sep 23, 2021

Hi!
I wanted to request the ability to build a shared library (.so, .dll etc) using the built in build system, alongside the static library and executables.

I can dig into the build system and try to add this, but if it's something you can do easily I'd much appreciate it! It'd be great if Kissat and Satch also supported this (hopefully for both the IPASIR and full C++ libraries. CryptoMiniSAT does this with a libcryptominisat and libcryptominisat_simple I believe).

@arminbiere
Copy link
Owner

I can port this from Kissat, where a similar feature, was added, but we are in the middle of "FMCAD'21" release and that has higher priority. So this will take at least one more release to put in.

@arminbiere
Copy link
Owner

Can you elaborate on your use case and application? In another enhancement thread I explained why I am hesitant to spent the work without knowing how it is is really used. Developers I know that work with CaDiCaL get away by picking up the source code directly and/or building their own scripts to link and include the CaDiCaL library (which might need specific configuration options such as '-fPIC' - see './configure -h' for more information).

@sfiruch
Copy link

sfiruch commented Sep 14, 2023

Can you elaborate on your use case and application?

In our case, we wat to use CaDiCaL from a .NET-based SAT formulation library (https://github.com/deiruch/SATInterface) and deploy that on Linux (x64). .NET can load dynamic libraries.

@kotopesutility
Copy link

Well, for example, I could call it from Python in my thesis:

import ctypes
cadical = ctypes.cdll.LoadLibrary("/usr/lib64/libcadical.so.1")
cadical.ccadical_release
<_FuncPtr object at 0x7fc32af44530>
cadical.ccadical_val
<_FuncPtr object at 0x7fc32af44600>
cadical
<CDLL '/usr/lib64/libcadical.so.1', handle 556c2d399d00 at 0x7fc32b0a9190>

Btw, could you also specify soname for shared library?

@arminbiere
Copy link
Owner

This looks cool. Do you have some simple python sample code?

Do you mean with "specify soname" do have an option for configure to give that name? I am not sure why you want that (unless we also add an install target).

In Kissat I have --shared as configuration option which would build libkissat.so.

@kotopesutility
Copy link

Do you mean with "specify soname" do have an option for configure to give that name? I am not sure why you want that

Oh, of course, no:) I only ask you to specify soname for your library:) For example, like this:
https://src.fedoraproject.org/rpms/cadical/blob/rawhide/f/cadical-shared.patch#_36

In Kissat I have --shared as configuration option which would build libkissat.so.

Cool!

@kotopesutility
Copy link

Do you mean with "specify soname" do have an option for configure to give that name? I am not sure why you want that

Oh, of course, no:) I only ask you to specify soname for your library:) For example, like this: https://src.fedoraproject.org/rpms/cadical/blob/rawhide/f/cadical-shared.patch#_36

-all: libcadical.a cadical mobical
+all: libcadical.so cadical mobical

But do not drop out the static library, please. cbmc uses it

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

4 participants