Skip to content

Conversation

@maelvls
Copy link
Collaborator

@maelvls maelvls commented May 24, 2017

Hello,

I had to hack your excellent project to adapt it for win32+mingw and macos builds. In this PR, I propose

  • an update of quantor and picosat (solves most problems with windows and macos)
  • added a test for quantor
  • tests are now built and run from make test (I used oUnit2 to ease the testing)
  • build and run only the tests that correspond to the libraries enabled (quantor or depqbf)
  • fix the ld: -L warning
  • fix the ocamlbuild tags warnings my fix breaks the build for older versions of ocaml
  • add travis and appveyor (macos, linux and windows)
  • In quantor's configure script, mingw's gcc can't be recognized because it does not match *gcc or gcc*. I simply modified to *gcc* so that x86_64-w64-mingw32-gcc.exe works.
  • I couldn't build quantor-3.2 work with mingw64-x86_64, it only works on i686. This is a problem of ./configure that does not finds the right 'Word' size (mingw x86_64, sizeof(long long long) == sizeof(void*)). I also did a related small fix in ./configure (removed all \n from printf to avoid windows CRLF problems)

Like for the ocaml-minisat project where we discussed about simply naming the opam package minisat, I also propose to name the opam package qbf; but I can still go back to ocaml-qbf, no problem!

I also bumped to version 0.2 (I can discard that; as you wish)

maelvls added 2 commits May 24, 2017 15:26
I updated to this version as it fixes the compilation on Mac OS.
Fixes bugs in compilation for non-linux hosts
@c-cube
Copy link
Owner

c-cube commented May 24, 2017

This is very impressive. Thanks for the hard work. I have to test the changes, obviously, but this looks very nice. You must obviously add yourself to the list of maintainers and/or authors ;-)

@c-cube c-cube self-assigned this May 24, 2017
@maelvls maelvls force-pushed the master branch 3 times, most recently from a6fbfcf to ed58b47 Compare May 24, 2017 15:44
@maelvls
Copy link
Collaborator Author

maelvls commented May 24, 2017

Thanks! This is rewarding to have such nice feedback on PRs 😊

By the way, I also propose to add travis (linux, mac) and appveyor (if you wish!).

Note: I am still working on some commits (like the -fPIC one); I'll keep you updated

@c-cube
Copy link
Owner

c-cube commented May 24, 2017

I'll be informed by github notifications ;-)
Well it's nice to see such contributions! CI is a good thing to have (I think I have to authorize the repository at some point, we'll see after this gets merged).

@maelvls maelvls force-pushed the master branch 9 times, most recently from 933d3c5 to fe2d068 Compare May 27, 2017 20:02
maelvls added 12 commits May 31, 2017 18:20
…d -lpicosat

This commit intends to fix the warning

   ld: warning: directory not found for option '-L../libs/quantor/'

This warning is due to the fact that you must pass -L../libs/quantor/
in CCLib: field so that oasis can pass it to ocamlc and ocamlmklib. The
thing is that ocamlmklib actually remembers these options so that the
user of the stub library doesn't have to pass the -l and -L flags.

There is no (to my knowledge) way to avoid that and give specific
CFLAGS for build and for the CFLAGS that ocamlmklib will embed.

My workaround:
- In oasis, I pass the flag `-L. -lpicosat`
- I copy libpicosat.a and libquantor.a to _build to that the -L.
  will work at build time
- Even though -L. is embedded by ocamlmklib into qbf.cma (or wherever
  this information is stored), the -L. won't trigger a warning.
Note that I had to move the quantor and depqbf tests into two separate
folders because of _tags clashes.

You can run 'make test' now compiling and running the tests.
Notes:
- on mingw, -fPIC is ignored because all objects are created with position
  independent code. So this does not affect the windows build.
- on macos, -fPIC is also ignored because in order to compile a position
  independent code, the (clang) argument is -fno-common -DPIC. But
  it seems to be working fine on macos without these flags.

I also modified the makefile so that quantor and picosat are not
rebuilt on every 'make'.
maelvls added 4 commits May 31, 2017 18:30
In _oasis, mkdir -p wasn't working. I just moved it to Makefile
In quantor's ./configure, the printf(".....\n") were printing ^M
characters (yeah, windows native exec is printing CRLF characters).
I just had to remove the ending \n as they were not absolutely needed.
maelvls added 3 commits May 31, 2017 18:47
@maelvls
Copy link
Collaborator Author

maelvls commented Jun 2, 2017

I think I am done! It works on macos, linux and native windows (mingw 32 bits).

capture d ecran 2017-06-02 a 13 16 12

Travis and appveyor also run the tests at the end:

  • Travis (Linux and MacOS builds)
  • Appveyor (Windows)
@c-cube c-cube merged commit 6ccde63 into c-cube:master Jun 6, 2017
@maelvls
Copy link
Collaborator Author

maelvls commented Jun 8, 2017

Excellent! 👍

Now, what do you think about distributing it though opam? I can open a PR on opam-repository if you want (their continuous integration tests may fail on ocaml-qbf, I guess some work will still be required to pass them on all architectures)

You can also try to enable travis-ci and appveyor (but this is way less important 😃).

@c-cube
Copy link
Owner

c-cube commented Jun 8, 2017

Oh, it's not on opam yet? my bad.
I'm going to look at how to enable travis and appveyor, too.

Thanks for your work :-)

@c-cube
Copy link
Owner

c-cube commented Jun 8, 2017

Feel free to do the opam query (e.g. with opam-publish)!

@maelvls
Copy link
Collaborator Author

maelvls commented Jun 8, 2017

Ok! Just submitted the PR. I just had to fix the opam's descr before and create the tag 0.2

@maelvls
Copy link
Collaborator Author

maelvls commented Jun 8, 2017

Oh! I just noticed that the Source repo: might be wrong:

Source repo: https://github.com/c-cube/quantor.git
@c-cube
Copy link
Owner

c-cube commented Jun 8, 2017

You can modify stuff and re-run opam-publish :-)

@maelvls
Copy link
Collaborator Author

maelvls commented Jun 8, 2017 via email

@maelvls
Copy link
Collaborator Author

maelvls commented Jun 12, 2017

The package qbf is now on opam! Excellent!
Thanks again,

Maël

@c-cube
Copy link
Owner

c-cube commented Jun 12, 2017

Thanks to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants