QuMuLab/dsharp

Port to Mac OSX

haz opened this issue · 6 comments

haz commented

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

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

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

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.

  • Since it was included before, and even with the updated license, we can likely include the binary in our codebase.
  • Since it was included before, porting to other platforms should be viable. The only platform depended code is to compute available memory. The currently included windows dsharp binary always uses ~100MB, so it's it was probably hardcoded back then to very quickly resolve the porting to windows (/mac maybe same). The new port does not hardcode a number and should work more correctly.

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

haz commented

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

Cheers!

Took a while to get around to it, and had some issues along the way, but it seems to work now. Pull request: #17

haz commented

Closed with #17