Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005733OCamldocumentationpublic2012-08-17 15:022013-12-16 11:46
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version4.00.0 
Target VersionFixed in Version 
Summary0005733: Feature: Recommend ocamlc as driver for compiling C sources for stublibs
DescriptionBasically, 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
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-08-17 15:02 gerd New Issue
2012-11-15 15:30 doligez Status new => confirmed
2013-12-16 11:46 doligez Tag Attached: junior_job
2017-02-23 16:35 doligez Category OCaml documentation => Documentation
2017-02-23 16:44 doligez Category Documentation => documentation

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker