rdicosmo / parmap

Parmap is a minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.
http://rdicosmo.github.io/parmap/
Other
94 stars 20 forks source link

map_file moved from Bigarray to Unix #83

Closed madroach closed 4 years ago

madroach commented 5 years ago

This is required to build on OCaml 4.08.0. Unix.map_file was available since OCaml 4.06.0. This is still more recent than anything provided by for example Debian. So is there some backwards compatibility needed?

rdicosmo commented 5 years ago

Indeed, I would really like a solution that enables to still compile Parmap on a pre 4.06 system. Any idea on how to do this purely in OCaml? Otherwise, autoconf is the way to go.

UnixJunkie commented 5 years ago

You could use cppo (a preprocessor for OCaml).

#if OCAML_VERSION >= (4,08)
 ...
#else
...
#endif

Also, invoking cppo has to be dealt with in the build process.

madroach commented 5 years ago

I did it with autoconf, but if at some time more compatibility fixes are needed you may still need to switch to using cpp.

UnixJunkie commented 5 years ago

There is another fix for this proposed in https://github.com/rdicosmo/parmap/pull/88 Without a configure hack.

PS: nice hack still ;)

UnixJunkie commented 5 years ago

@madroach why the '~-1' at line 113 instead of just '-1'?

madroach commented 5 years ago

@UnixJunkie its not necessary. To be honest I don't really understand when just - suffices and when unary ~- is neeeded.

XVilka commented 4 years ago

Are there any updates with the fix?

UnixJunkie commented 4 years ago

@rdicosmo you should accept this PR. This is a simple fix for the problem.

XVilka commented 4 years ago

@rdicosmo @madroach Note, that Debian should not stop you, since they plan to move to OCaml 4.08+ anyway, see their progress. In fact, parmap is one of the blockers to do so.