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

Feature: Recommend ocamlc as driver for compiling C sources for stublibs #5733

Open
vicuna opened this issue Aug 17, 2012 · 6 comments
Open

Comments

@vicuna
Copy link

vicuna commented Aug 17, 2012

Original bug ID: 5733
Reporter: gerd
Status: confirmed (set by @damiendoligez on 2012-11-15T14:30:52Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.00.0
Category: documentation
Tags: junior_job
Monitored by: @ygrek @hcarty @dbuenzli

Bug description

Basically, it is up to the user how to call the C compiler for compiling stublibs. However, in many build systems I see that users do it the wrong way (e.g. hardcode the compiler "gcc", or forget to pass switches like -fPIC which are sometimes required). My wish is that the section "Interfacing C with OCaml" includes examples how to do it right - which is absolutely simple, because you just need to use ocamlc as driver even for C sources.

There could e.g. be a new section before "Statically linking C code with OCaml code" about "Compiling C code". Contents:

  • How to use ocamlc as driver for C sources: Sample command
  • Mention that the stdlib is automatically in the include path
  • Mention that the switches are ok for dynamically loadable code
  • The created .o files can be args of ocamlmklib
  • use -I, -ccopt, -cclib to pass args
  • Mention that ocamlc -config can be used to extract the compiler path and switches if lower-level calls are needed
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 15, 2020
@gasche gasche removed the Stale label Jun 22, 2020
@gasche gasche reopened this Jun 22, 2020
@gasche
Copy link
Member

gasche commented Jun 22, 2020

This is an interesting improvement proposal for the documentation, and also a good task for a new contributor. Reopening.

@moyodiallo
Copy link
Contributor

Hi @gasche, I'm new and I want to work on this.

@gasche
Copy link
Member

gasche commented Oct 6, 2021

Please feel free to work on this. Note that writing a good proposal for the manual probably requires some familiarity with the C/OCaml FFI, so this may be one of the harder "good first issue" tasks.

@moyodiallo
Copy link
Contributor

Cool. I have some knowledge about C/OCaml FFI.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Oct 12, 2022
@Octachron Octachron removed the Stale label Oct 12, 2022
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