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

Choosing flambda optimizations via ocamlbuild #67

Closed
martin-neuhaeusser opened this issue Mar 29, 2016 · 6 comments
Closed

Choosing flambda optimizations via ocamlbuild #67

martin-neuhaeusser opened this issue Mar 29, 2016 · 6 comments

Comments

@martin-neuhaeusser
Copy link
Contributor

Is there any way of enabling the flambda optimization (e.g. -O3) in a build process with ocamlbuild?

@gasche
Copy link
Member

gasche commented Mar 29, 2016

We haven't added yet to the set of base flags yet. This should be rather easy, just adding flags to ocaml_specific.ml -- feel free to send a Pull Request implementing these.

Note that these flags will only work on OCaml compilers that have been configured (at compiler-build time) to use flambda.

@martin-neuhaeusser
Copy link
Contributor Author

I am preparing a PR for the flambda optimization flags.
My suggestion for a name would be "optimize" with parameters classic, 2, or 3. Any objections?

@gasche: Can (and should?) ocamlbuild detect whether the underlying ocaml compiler includes flambda? Adding optimization flags in a non-flambda compiler results in a warning message...

@gasche
Copy link
Member

gasche commented Mar 30, 2016

The names are fine with me. Are you planning to also support the tuning options documented in the manual?

I think we could just pass the flags to the underlying compiler, and let users handle warnings if they do the wrong thing.

@martin-neuhaeusser
Copy link
Contributor Author

Which other tuning options should we support? I will try to incorporate them.
However, I am unsure which of them should be exposed in ocamlbuild?

Personally, I think the optimization levels (-O) and the inlining heuristic (-inline) are the most crucial ones. Please let me know if I should include, e.g. -rounds, -unbox-closures, or -remove-unused-arguments.

@Drup
Copy link

Drup commented Mar 30, 2016

Which other tuning options should we support?

All of them. There is no reason not to expose flags at the ocamlbuild level.

@martin-neuhaeusser
Copy link
Contributor Author

I have a first draft for supporting the flambda options ready in #68.

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

No branches or pull requests

4 participants