usnistgov / trec_eval

Evaluation software used in the Text Retrieval Conference
232 stars 49 forks source link

native Windows compilation #25

Closed cmacdonald closed 4 years ago

cmacdonald commented 4 years ago

Please consider this pull request for review. This PR addresses the compilation and running of trec_eval on Windows, when using the standard Microsoft Visual Studio toolchain (e.g. rather than cygwin). This is required in order to get pytrec_eval working under Windows (see https://github.com/cvangysel/pytrec_eval/pull/27).

The changes to trec_eval include:

I also created a Github Action workflow that does compilation and testing on Linux, Mac and Windows (see .github/workflows). The last run is at https://github.com/cmacdonald/trec_eval/actions/runs/137772843

There were a lot of commits, so you might consider squash-merge to make the revision history simpler.

I would hope that once we have this merged, we can improve the action to put trec_eval.exe file in the Github releases directory when you do each release.

cmacdonald commented 4 years ago

Something like that. I think perhaps fread() etc are more preferable these days and cross-platform?

My REAME.windows.md did record some motivations.

A few additional includes are used:
 - `mman.h` - a mmap() implementation for Windows
 - `unistd.h` - dropin replacement for the Unix header file unistd.h
 - `ya_getopt.h` - BSD licensed getopt_log() implementation

Other advantages would also be Github actions for automatic testing - see https://github.com/cmacdonald/trec_eval/actions

cmacdonald commented 4 years ago

My search history for 16th June is full of read vs fread. I think read is a syscall and varies by platform; fread is more reliable and behaves in a standard way. Similar discussion about lseek vs fseek. (It might have been lseek that drove the change.)

GitHub actions shows this version passing on Windows, Ubuntu and Mac.

isoboroff commented 4 years ago

I do like the automatic testing doodad, that's a winner. Merging!

cmacdonald commented 4 years ago

woop. Do you need a version for version 10 branch?

isoboroff commented 4 years ago

I'm going to try to cherrypick it into v10-dev, if that doesn't work I'll hit you up. This seems good enough it should go in both. I already packaged up a new 9.0.8 release.

cmacdonald commented 4 years ago

Sure, let me know if you need help.

Other thing I want to suggest/help with is to use github actions to build the executables automatically (Windows, in particular).

Craig


From: Ian Soboroff notifications@github.com Sent: 03 September 2020 21:59 To: usnistgov/trec_eval trec_eval@noreply.github.com Cc: Craig Macdonald Craig.Macdonald@glasgow.ac.uk; Author author@noreply.github.com Subject: Re: [usnistgov/trec_eval] native Windows compilation (#25)

I'm going to try to cherrypick it into v10-dev, if that doesn't work I'll hit you up. This seems good enough it should go in both. I already packaged up a new 9.0.8 release.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/usnistgov/trec_eval/pull/25#issuecomment-686761740, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEXTCUC7MW3RMHOI55J7DDSD77SRANCNFSM4OAQE4HA.