snap
snap copied to clipboard
Added cmake support (linux/windows/cygwin/probably mac)
Hi,
I ported SNAP to cmake. The build process is as usual with cmake:
mkdir build && cd build
cmake .. # -G $generator_name
make
What's been ported
I ported the root Makefile to cmake, so snap-core, examples, test and tutorials are handled. This leaves snap-adv and snap-exp out of this, as they are not part of snap-core anyway (AFAIK). Each project in snap-adv can be added to cmake as it gets mature to be included to SNAP.
Compatibility issues
Some code assumes the definition of unix-only symbols (eg randr48), or uses keyword not supported by msvc (eg not). I solved these without modifying the current codebase (see the new cmake directory) and rook CMakeLists.txt. Parts I skipped and left out of the windows build (still present with other systems):
- the example zydemo assumes the library is present on the system (#include <zygote.h>). I could not get this library on windows (due to limited time), like very few other examples.
- the example motifcluster links to arpack, which I could not get on windows (same reason).
- some tutorials, due to using deprecated (inexistant) syscalls on windows (mkdir): gviz, bfsdfs, cncom, and hashvec-benchmark.
What's been tested
Linux (Debian 4.18.6-1 (2018-09-06) x86_64 GNU/Linux with g++ (Debian 8.2.0-7) 8.2.0):
- GVizTest.DrawGViz, which already fails on my machine when using the 4.1 tgz package from the site.
- all other tests ok
Windows (Win7 with visual studio 2017):
- gviz test fail due to missing libs.
- multimodal.GetSubgraph is failing due to an index out of bound error, worth having a look at imo
- TSysTm.Sleep
- all other tests ok
Cygwin64:
- GVizTest.{DrawGViz,DrawGVizColor} are failing, but I'm not too sure my vygwin has anything graphviz, I set it up for the occasion only.
- TSysTm.Sleep
- all other tests ok
Mac: I don't have a mac so I could not test anything. I ported all settings I found in the root Makefile, but testing is obviously needed.
Please have a look and let me know what you think. For instance, this PR does not remove current makefiles, and maybe it should.
Thanks
@arbenson or @pirroh maybe you can provide guidance on how to move this PR forward?
Any update on this?
It's been more than a year that this PR has been standing here. I've had no news from the SNAP team. I've seen a little of activity on their mailing list, you might want to ask them there.
Sorry for the delay. We have been swamped and this task has been pushed down in priority. We hope to be able to allocate more resources in the future, however, we do not have a specific timeline currently.