ciaranm / glasgow-subgraph-solver

A solver for subgraph isomorphism problems, based upon a series of papers by subsets of McCreesh, Prosser, and Trimble.
MIT License
62 stars 23 forks source link

windows version? #8

Closed qai222 closed 2 years ago

qai222 commented 2 years ago

Hi, thanks for the great solver. I was trying to use it on Windows but the source code contains a few UNIX system calls (s.g. sys.wait).

Do you have any plan to make it buildable on Windows?

ciaranm commented 2 years ago

I don't have access to a Windows build environment for automated builds and testing, so this isn't something I can do easily myself.

As far as I recall, the only parts of the code that use Unix calls are places where we interface with external software, for symmetries or side constraints. These aren't really core functionality, so it may be possible to just #ifdef them out and throw an exception on non-Unix systems.

ChrisJefferson commented 2 years ago

One general hint: On Windows 10 or 11 you can install the "Windows Subsystem for Linux", which lets you run any Linux software (including this) easily.

ChrisJefferson commented 2 years ago

I decided to have a quick look to see how hard it would be to build on windows. The answer is, fairly easy. The two things are:

1) Comment out most of symmetries.cc 2) Remove uses of gethostname.

However, I wasn't sure of the best way to test the result to see if it actually works properly.

ChrisJefferson commented 2 years ago

Is this enough evidence of functioning?

$ ./run-tests.bash
+ grep '^status = true$' /dev/fd/63
++ ./glasgow_subgraph_solver --format lad test-instances/small test-instances/large
status = true
+ grep '^status = false$' /dev/fd/63
++ ./glasgow_subgraph_solver --induced --format lad test-instances/small test-instances/large
status = false
+ grep '^solution_count = 6$' /dev/fd/63
++ ./glasgow_subgraph_solver --count-solutions --format lad test-instances/small test-instances/large
solution_count = 6
+ grep '^solution_count = 12$' /dev/fd/63
++ ./glasgow_subgraph_solver --count-solutions test-instances/trident.csv test-instances/longtrident.csv
solution_count = 12
+ grep '^solution_count = 6$' /dev/fd/63
++ ./glasgow_subgraph_solver --count-solutions --induced test-instances/c3.csv test-instances/c3c2.csv
solution_count = 6
+ true
ciaranm commented 2 years ago

Yep, that looks fine. I'm happy with a big pile of ifdefs. Of course, I don't promise not to accidentally break it again later on...

ciaranm commented 2 years ago

Should be fixed thanks to Chris. Please poke if you have further issues.