Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multicore compilation returns error #348

Closed
brettgilio opened this issue Nov 6, 2019 · 3 comments · Fixed by #363
Closed

multicore compilation returns error #348

brettgilio opened this issue Nov 6, 2019 · 3 comments · Fixed by #363

Comments

@brettgilio
Copy link

Hello! So I have been working on packaging MLton for GNU Guix (https://guix.gnu.org/) as I use that as my daily distribution. You can see my packaging efforts thus far at https://git.sr.ht/~brettgilio/cfg/tree/master/channel/non-gnu/packages/sml-ext.scm

Using parallel building by invokating the build process from Guix breaks the build process for Mlton. I decided to try and build it from source repeating the same configuration make all -j 8 and the issue is reproducible there too.

In the mean time I have #:parallel-build? #f ; FIXME: Borks the build step. in my recipe (Line 127) which preserves the issue and allows the build to complete successfully.

Is parallel building a known issue in Mlton?

Type checking ckit-lib library.
"/home/brettg/Repos/mlton/build/bin/mlton" -disable-ann deadCode -stop tc '$(SML_LIB)/ckit-lib/ckit-lib.mlb' >/dev/null
MLton 20191105.214249-g89891a411 raised: Io: openIn "/home/brettg/Repos/mlton/build/lib/mlton/targets/self/constants" failed with SysErr: No such file or directory [noent]
make[2]: *** [Makefile:136: libraries-check] Error 1
make[2]: Leaving directory '/home/brettg/Repos/mlton'
make[1]: *** [Makefile:147: libraries] Error 2
make[1]: Leaving directory '/home/brettg/Repos/mlton'
make: *** [Makefile:19: all] Error 2
@brettgilio
Copy link
Author

Also, thank you Matthew for the wonderful software you have made. I only discovered Standard ML about a year ago, and started using it after moving from OCaml/Coq a few months ago. This software made it so easy and fun to learn.

@MatthewFluet
Copy link
Member

See discussion and commentary at #132.

@MatthewFluet
Copy link
Member

In particular, the linked e-mail discussion at #132.

The major issue seems to be that there are a lot of Makefile rules that are essentially triggered for effects (like copying the Basis Library sources to their installed location). Also, bootstrapping intentionally deletes build artifacts and rebuilds them. The Makefiles have gotten a little cleaner over time, but they are still recursive and cross-directory dependencies are difficult.

MatthewFluet added a commit that referenced this issue Jan 21, 2020
Support parallel builds (i.e., `make -j`)

Simply perform separate `$(MAKE)` commands for sequential steps in
`Makefile`; in particular, for the `all` rule, perform `$(MAKE) dirs;
$(MAKE) runtime` rather than `$(MAKE) dirs runtime` and similarly for
other places where recursive `$(MAKE)` was invoked with multiple
(`.PHONY`) targets.

This mainly supports platforms/packagers that use a parallel make by
default; it does not obtain significant build speedups.  The main
(time consuming) self-compile is necessarily sequential.  On the other
hand, the runtime system can be built in parallel.

Closes #132
Closes #348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants