QuMuLab / dsharp

MIT License
16 stars 5 forks source link

Port to Mac OSX #4

Closed haz closed 2 years ago

haz commented 4 years ago

This branch is a start for porting DSHARP to the Mac:

Currently, it still has the following issue:

Below is the new error message, it now complains about missing sys/sysinfo.h. This looks like a Mac issue, so I used google and found this page:

g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o Basics.o src/src_sharpSAT/Basics.cpp
g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o SomeTime.o src/shared/SomeTime.cpp
g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o RealNumberTypes.o src/shared/RealNumberTypes.cpp
g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o AnalyzerData.o src/shared/Interface/AnalyzerData.cpp
g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o DecisionStack.o src/src_sharpSAT/MainSolver/DecisionStack.cpp
g++ -c -pipe -O3 -w -I. -Isrc/shared -I/usr/include  -o DecisionTree.o src/src_sharpSAT/MainSolver/DecisionTree.cpp
In file included from src/src_sharpSAT/MainSolver/MainSolver.h:14,
                 from src/src_sharpSAT/MainSolver/DecisionTree.cpp:23:
src/src_sharpSAT/MainSolver/FormulaCache.h:9:25: error: sys/sysinfo.h: No such file or directory
make: *** [DecisionTree.o] Error 1

An initial attempt fixes these errors:

https://bitbucket.org/cmungall/dsharp

VincentDerk commented 2 years ago

Hi again,

I need a binary for both Mac and Windows users so I am also trying to get the port to work.

I created a branch here. It required a few changes but so far it seems to work for Windows and linux. I asked a colleague with a Mac to test whether the changes compile for him too. Either way, if you're interested I can open a pull request once I'm done?

haz commented 2 years ago

Absolutely, thanks! May I ask why you aren't considering d4 instead, though? By all accounts, it seems to outperform D#...

VincentDerk commented 2 years ago

Absolutely, thanks! May I ask why you aren't considering d4 instead, though? By all accounts, it seems to outperform D#...

Sure, to provide some context: I'm trying to replace the previous dsharp binary used in problog to incorporate the new CNF parsing. We already support the SDD package (via PySDD) and there is code to support a c2d binary but it's not included due to licensing, I think. ProbLog will use PySDD when it's installed (no windows support) and otherwise will fall back to dsharp (or c2d if the user included the binary themself).

When incorporating model counters in our codebase we need to consider licensing and each platform should have at least one model counter working out of the box, such that users only need to pip install problog without installing more dependencies (themself). This role is currently served by dsharp so it seemed easier to just replace the bugged binary.

We could consider adding D4 support, but can't include binaries without checking licensing, dependencies etc first.

haz commented 2 years ago

Ah, entirely makes sense. The shift in licensing of D# shouldn't cause trouble -- it moved to something strictly more permissive.

Cheers!

VincentDerk commented 2 years ago

Took a while to get around to it, and had some issues along the way, but it seems to work now. Pull request: https://github.com/QuMuLab/dsharp/pull/17

haz commented 2 years ago

Closed with #17