Skip to content

PR#7172: ocamlc -config: add int_size, word_size, natdynlink, ext_exe#970

Merged
gasche merged 1 commit intoocaml:trunkfrom
gasche:extend-ocamlc-configure
Dec 14, 2016
Merged

PR#7172: ocamlc -config: add int_size, word_size, natdynlink, ext_exe#970
gasche merged 1 commit intoocaml:trunkfrom
gasche:extend-ocamlc-configure

Conversation

@gasche
Copy link
Member

@gasche gasche commented Dec 13, 2016

See MPR#7172.

Among the options that @dbuenzli asked, one that is not included is "nativecomp", which he specified as "whether native compilation is available". First, I'm not completely sure how to implement that (there is no obvious makefile variable I can reuse), and second it is unclear to me that we actually can give it a specification: config.mlp tells about how the compiler distribution was configured to be built, but not about what was actually installed on the user machine, so while I can say if native-compilation was disabled at configure-time, if I say true at config-time you still have to check that ocamlopt is actually installed to be sure.

Makefile Outdated
-e 's|%%ARCH%%|$(ARCH)|' \
-e 's|%%MODEL%%|$(MODEL)|' \
-e 's|%%SYSTEM%%|$(SYSTEM)|' \
-e 's|%%EXT_EXE%%||' \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly sure this logic isn't correct - Cygwin should have .exe and possibly also Linux cross-compiling using mingw? (both of which use configure, not Makefile.nt)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I'll change it to be whatever configure decided it would use for the installed binaries.

@dra27
Copy link
Member

dra27 commented Dec 14, 2016

The "proper" way would be to alter configure so that native code compilation becomes effectively part of make world (i.e. no opt or opt.opt stages) but that would require a lot of care for bootstrapping, I think (though possibly no more than requiring one to disable native code compilation via configure specifically when bootstrapping). One for @shindere, I expect!

A more compatible, though time-consuming, way would be to alter config.mlp during make opt, but that would mean that make opt would need to recompile the bytecode compilers, which is unfortunate.

@dra27
Copy link
Member

dra27 commented Dec 14, 2016

Actually, a third possibility for compatibility would be to have make install fail if ocaml is configured to build the native code compiler but you haven't. That sounds much more straightforward?

@gasche gasche force-pushed the extend-ocamlc-configure branch 2 times, most recently from 2d41101 to 9e68432 Compare December 14, 2016 12:14
@gasche
Copy link
Member Author

gasche commented Dec 14, 2016

I think your last suggestion is excellent, but I would like to keep nativecomp out of the scope of the present PR for simplicity. Could you post it on the mantis discussion?

@dra27
Copy link
Member

dra27 commented Dec 14, 2016

Could we keep natdynlink of it for the same reason?

@gasche
Copy link
Member Author

gasche commented Dec 14, 2016

This is a reasonable argument, so I removed natdynlink for now.

@gasche gasche force-pushed the extend-ocamlc-configure branch from 9e68432 to c6fea83 Compare December 14, 2016 13:50
@dra27
Copy link
Member

dra27 commented Dec 14, 2016

This (unsurprisingly) all looks fine - anything to add, @dbuenzli?

Merge once the CI confirms? I'm happy to be assigned the rest of PR to be ready for 4.05, unless you have a burning desire to do it? It would be good (both philosophically and practically) not to be relying on tools such as OPAM to determine the installed state of the compiler.

@gasche gasche merged commit d89b1a7 into ocaml:trunk Dec 14, 2016
@gasche
Copy link
Member Author

gasche commented Dec 14, 2016

Thanks, I went ahead and merged.

I don't plan on working on the rest of the PR before 4.05, so you should feel free to do so if you wish. (Also I'm not comfortable hacking on the build system and I entertain the wishful thought that others such as you may enjoy it more.) That said, please be aware that this mantis issue is not high-priority, it's a nice-to-have: feel free to assign yourself for task-tracking purposes, but don't feel bad if you slip the 4.05 deadline.

@shindere
Copy link
Contributor

shindere commented Dec 14, 2016 via email

@dra27
Copy link
Member

dra27 commented Dec 14, 2016

The only question is what happens if a bootstrap cycle is required? make world.opt would normally fail at this point because you should run make world bootstrap [bootstrap] opt (I think - I still don't fully have my head wrapped around that part of the build system!)

@dbuenzli
Copy link
Contributor

Re nativecomp

First, I'm not completely sure how to implement that (there is no obvious makefile variable I can reuse),

@gasche As you mentioned you need a configuration variable to disable the construction of native code compilers for that.

config.mlp tells about how the compiler distribution was configured to be built,

I think we can reasonably devise a system where what you configure to be built coincides with what the default install procedure will install.

if I say true at config-time you still have to check that ocamlopt is actually installed to be sure.

Or not, you may be only interested in e.g. compiler-libs libraries. Checking for binaries is very brittle. For example checking the availability of ocamlopt doesn't work if you have a byte-code only switch and a system compiler installed with native code.

FWIW to determine this I currently check for the availability of libasmrun in the standard library directory reported by ocamlc -config.

@dra27
Copy link
Member

dra27 commented Dec 15, 2016

Regarding the brittleness - the ocaml autoconf macros also check that ocamlopt and ocamlc use the same standard library directory. Though this is not perfect (OCAMLLIB can get in the way here), it does help eliminate the real problem of ocamlopt being detected from a different ocaml installation. You could, with excessive paranoia, also check that, say, pervasives.cmi has the correct magic numbers for the compiler.


- PR#7172, GPR#970: add extra (ocamlc -config) options
int_size, word_size, ext_exe
(Gabriel Scherer, request by Daniel Buenzli)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gabriel, you have lost Mr. Bünzli's umlaut. I guess he's too modest to complain. Once I sign the CLA, I'll fix this sacrilege.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a CLA for tiny changes!

However, it's not lost - ue is a permitted alternative (note Daniel's GitHub handle)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually like umlaüten, so Bünzli is the spelling I tend to use, no idea why this one was different. There are also two clearly wrong "Bunzli" in the Changes file (I think it is Alain's fault), so we could do a pass to harmonize this. I'll have a look at whether other names should be fixed as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed several here (including this one): 7dc4993.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, getting useful commits stuck in an ambitious pull request is bad. I can cherry-pick and go from there -- I just did a pass on the Changelog.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact your commit is tangled with a Changes entry, so I won't cherry-pick it -- I had done the same changes independently, plus some.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: e65050e.

gasche added a commit that referenced this pull request Feb 25, 2017
gasche added a commit that referenced this pull request Feb 25, 2017
gasche added a commit that referenced this pull request Mar 9, 2017
camlspotter pushed a commit to camlspotter/ocaml that referenced this pull request Oct 17, 2017
camlspotter pushed a commit to camlspotter/ocaml that referenced this pull request Oct 17, 2017
sadiqj pushed a commit to sadiqj/ocaml that referenced this pull request Feb 21, 2023
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Mar 21, 2023
b11eea1 flambda-backend: Introduce Import_info (ocaml#1036)
bc5b135 flambda-backend: Fix `ocamlobjinfo` on flambda2 .cmx files (ocaml#1029)
c8babbd flambda-backend: Compilation_unit optimisations (ocaml#1035)
e8d3e22 flambda-backend: Use 4.14.0 opam switch for building (includes upgrading ocamlformat to 0.24.1) (ocaml#1030)
eb14a86 flambda-backend: Port PR81 from ocaml-jst (ocaml#1024)
131bc12 flambda-backend: Merge ocaml-jst 2022-12-13 (ocaml#1022)
06c189a flambda-backend: Make stack allocation the default (ocaml#1013)
98debd5 flambda-backend: Initial support for value slots not of value kind (ocaml#946)
deb1714 flambda-backend: Add is_last flag to closinfo words (ocaml#938)
d07fce1 flambda-backend: Disable poll insertion in Configure (ocaml#967)
0f1ce0e flambda-backend: Regenerate ocaml/configure autoconf 2.69 (instead of 2.71) (ocaml#1012)
27132d8 flambda-backend: Fix for spurious typing error related to expanding through functor arguments (ocaml#997)
724fb68 flambda-backend: Use `Compilation_unit.t` instead of `Ident.t` for globals (ocaml#871)
396d5b8 flambda-backend: Add a test for frametable setup in natdynlinked libraries (ocaml#983)
b73ab12 flambda-backend: Fix invocation of `caml_shared_startup` in native dynlink (ocaml#980)
7c7d75a flambda-backend: Fix split_default_wrapper which did not trigger anymore with flambda2 (ocaml#970)
8fb75bd flambda-backend: Port ocaml#11727 and ocaml#11732 (ocaml#965)
fdb7987 flambda-backend: Fix include functor issue after 4.14 merge. (ocaml#948)
9745cdb flambda-backend: Print -dprofile/-dtimings output to stdout like 4.12 (ocaml#943)
5f51f21 flambda-backend: Merge pull request ocaml#932 from mshinwell/4.14-upgrade
841687d flambda-backend: Run make alldepend in ocaml/ (ocaml#936)
72a7658 flambda-backend: Remove reformatting changes only in dynlink/dune (preserving PR889 and adjusting to minimise diff)
6d758cd flambda-backend: Revert whitespace changes in dune files, to match upstream
c86bf6e flambda-backend: Remove duplicate tests for polling
971dbeb flambda-backend: Testsuite fixes
32f8356 flambda-backend: Topeval fix for symbols patch
befea01 flambda-backend: Compilation fixes / rectify merge faults
a84543f flambda-backend: Merge ocaml-jst
8e65056 flambda-backend: Merge ocaml-jst
4d70045 flambda-backend: Remove filename from system frametable (amd64) (ocaml#920)
5e57b7d flambda-backend: Bugfix for runtime frame_descr logic for C frames (ocaml#918)
6423d5e flambda-backend: Merge pull request ocaml#914 from mshinwell/merge-ocaml-jst-2022-10-24
ead605c flambda-backend: Add a missing Extract_exception (ocaml#916)
c8f1481 flambda-backend: Resolve conflicts and add specialise/specialised attributes to Builtin_attributes
cf4d0d3 flambda-backend: Merge fixes (ocaml#21)
c2f742f flambda-backend: Re-enable some tests for Flambda2 (ocaml#881)
3d38d13 flambda-backend: Long frames in frametable (ocaml#797)
85aec7b flambda-backend: Add loop attribute to Builtin_attributes
c0f16e3 flambda-backend: Compilation fixes
90dea23 flambda-backend: Merge flambda-backend/main
5acc6ea flambda-backend: Fixes after merge
e501946 flambda-backend: Merge ocaml-jst
115083b flambda-backend: Merge ocaml-jst
9943b2e flambda-backend: Revert "Revert "Transform tail-recursive functions into recursive continuations (ocaml#893)"" (ocaml#909)
ce339f1 flambda-backend: Fix alloc modes and call kinds for overapplications (ocaml#902)
e6a317c flambda-backend: Revert "Transform tail-recursive functions into recursive continuations (ocaml#893)"
853c488 flambda-backend: Transform tail-recursive functions into recursive continuations (ocaml#893)
5a977e4 flambda-backend: Fix missing End_region primitives on switch arms (ocaml#898)
7fa7f9d flambda-backend: Add missing dependencies to Dune files (ocaml#889)
3cd36f0 flambda-backend: Have Lambda `Pgetglobal` and `Psetglobal` take `Compilation_unit.t` (ocaml#896)
7565915 flambda-backend: [@poll error] attribute (ocaml#745)
9eb9448 flambda-backend: Backport the main safepoints PRs (ocaml#740)
689bdda flambda-backend: Add strict mode for ocamldep (ocaml#892)

git-subtree-dir: ocaml
git-subtree-split: b11eea1
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
* Add outreachy video field

* Add links to videos

---------

Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
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 this pull request may close these issues.

5 participants