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

Can we specify the target (byte or native) of an executable or libarary ? #112

Open
kit-ty-kate opened this issue Sep 11, 2014 · 10 comments

Comments

@kit-ty-kate
Copy link

If not it would be good to have it.

In the same order of idea, can we specify flags for a specific target ? I know there is the oflags field (through it is not referenced in the documentation) but it would be interesting to have target specific flags too.

@UnixJunkie
Copy link

Yes for your first question, at configuration step: obuild configure --enable-executable-bytecode

@UnixJunkie
Copy link

And unfortunately no, the oflags in X/obuild are for all targets, as far as I understand.

@UnixJunkie
Copy link

X.obuild

@kit-ty-kate
Copy link
Author

It can be useful to enforce it in the obuild file. For instance, it you do a js_of_ocaml library, the native version of the library cannot (and shouldn't) be built.

@UnixJunkie
Copy link

I agree this is useful, in oasis, here are the three modes they support:
byte, native or best.
best just means "native, if possible".

@jeromemaloberti
Copy link
Contributor

Is it mandatory in oasis ? or is there a default value ?

@kit-ty-kate
Copy link
Author

It's not mandatory.
If I'm right, it compiles both for libraries and by default, the bytecode version for executables.

@UnixJunkie
Copy link

@gildor478 can you answer on that one?
Thanks,
F.

@UnixJunkie
Copy link

I would prefer the default for obuild to be best.
That would prevent people from ever shipping something that would compile
in bytecode while it should have compile in native (as GODI did for years for the ocamldoc command it was shipping).

@gildor478
Copy link

Meaning of best:

  • best for library = native if possible AND byte
  • best for exec = native XOR byte depending if native is possible

Actually the default values are:

  • best for library
  • byte for executable (native have some constraint on some platform that the reason why it is not best)

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