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

Unable to build with MLton with MPL installed #170

Open
hai-nguyen-van opened this issue Jan 30, 2023 · 1 comment
Open

Unable to build with MLton with MPL installed #170

hai-nguyen-van opened this issue Jan 30, 2023 · 1 comment

Comments

@hai-nguyen-van
Copy link
Contributor

I am unable to build a project with MLton after MPL has been installed using its make install. I need to build this project using make hmc and I face the following errors:

mlton -verbose 1 -output hmc src/hmc/hmc.mlb
MLton 20210117.153942-gb1f1f0f09-dirty starting
   Compile SML starting
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 181.13-182.43.
  Invalid type for _import.
    C_Pthread_Key.t * 'a array -> unit
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 193.13-193.87.
  Unknown primitive: Array_update_noWriteBarrier.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 196.13-196.68.
  Unknown primitive: Ref_assign_noWriteBarrier.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 199.13-199.76.
  Unknown primitive: Array_sub_noReadBarrier.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 202.13-202.59.
  Unknown primitive: Ref_deref_noReadBarrier.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 215.9-215.48.
  Unknown primitive: Ref_cas.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 218.9-218.67.
  Unknown primitive: Array_cas.
Error: $(SML_LIB)/basis/primitive/prim-mlton.sml 356.9-357.50.
  Invalid type for _import.
    'a ref * 'b ref * 'c ref * thread -> bool
   Compile SML reported errors in 1.55 + 0.78 (34% GC)
MLton 20210117.153942-gb1f1f0f09-dirty reported errors in 1.55 + 0.78 (34% GC)
make: *** [Makefile:34: hmc] Error 1

I have discussed with @MatthewFluet about a very similar issue (MLton/mlton#488 (comment)) who seems to indicate that the problem comes from MPL rather than MLton. Interestingly, I am able to build project using the root Docker shwestrick/mpl... so I don't really understand 🤔

@shwestrick
Copy link
Collaborator

Ah, I have a suspicion this is because the MPL install scripts are only slightly modified from MLton's, so it might be overwriting some of the local install of MLton when doing make install.

Perhaps it's enough to install MPL somewhere else, such as make install PREFIX=/opt/mpl?

Alternatively, you could try out mpl-switch, which is a small python script to help manage local installs of MPL. It installs to a directory ~/.mpl/ and lets you have multiple versions of MPL installed simultaneously, so it should work with any local install of MLton you have, too.

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

No branches or pull requests

2 participants