Skip to content

Port code to windows + mac#17

Merged
haz merged 11 commits intoQuMuLab:masterfrom
VincentDerk:enhancement/port-win-mac
May 27, 2022
Merged

Port code to windows + mac#17
haz merged 11 commits intoQuMuLab:masterfrom
VincentDerk:enhancement/port-win-mac

Conversation

@VincentDerk
Copy link
Contributor

@VincentDerk VincentDerk commented May 24, 2022

Changes

  • Extended platform-depended availableMem() with implementation for Windows and Mac (cf. src/src_sharpSAT/MainSolver/FormulaCache.cpp). Required some annoying changes, e.g.:

    • DT_AND conflicted with a macro in windows.h so I changed it to lowercase and pre-pended 'k', following some stylistic Google guideline.
    • using namespace std is not recommended in .h files, and was also causing some conflicts with 'set' from std.
    • uint to unsigned int
  • Fixed segmentation fault issue on Mac (not sure why it (only) occurred there).

  • Changed datatype of some memory related variables into size_t to support +4GB cache size. For example, before this pull request, -cs 6000 caused CSolverConf::maxCacheSize to overflow.

Note

Some files appear as entirely changed because they were using CRLF (Windows) as line endings instead of LF (Linux, Mac) and my editor/git converted them. E.g. in SomeTime.h only using namespace std; was removed. I can elaborate on changes if needed.

Verified output

None of the changes should have affected the produced results (model count, nnf, ...). Regardless, I tested on the two files in exp-testing and the statistics (incl. model count) remain the same.

@VincentDerk VincentDerk mentioned this pull request May 24, 2022
@haz
Copy link
Contributor

haz commented May 27, 2022

Very weird that those iterators weren't segfaulting elsewhere! I guess it would have been fine if the for-loop conditions were swapped to check the found first. Either way, it all looks pretty good to me! Tested it out with a few extra CNF's as well.

Thank you so much for all the efforts on it!

@haz haz merged commit 3172302 into QuMuLab:master May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants