Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005890OCamlcompiler driverpublic2013-01-14 16:322017-06-29 12:15
Assigned Toshindere 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005890: ocamlc does not fully take into consideration -o parameter
DescriptionWhen one tries to build an Ocaml library directly from multiple ml-files this way:

  ocamlc -a -o library.cma

things work fine. Essential *.cmi and *.cmo files are created in the same place as library.cma target.

However, when one tries to specify non-current output directory:

  ocamlc -a -o /tmp/library.cma

then *.cmo and *.cmi files are created in the current directory and only library.cma file is created in the designated /tmp directory.

While the manual page does not explicitly make any promises in this regard, the current behavior is surprising. It does not seem probably that user would want object files to be generated in one directory and resulting library in a different directory.
TagsNo tags attached.
Attached Files

- Relationships
related to 0006191assignedshindere Missing argument for ocamldep to tell it where output binaries will be placed 
has duplicate 0007573acknowledged Direct selection of output directory (or file names) for OCaml compiler 
related to 0006475resolvedwhitequark -o is ignored for C files 

-  Notes
kosik (reporter)
2013-01-14 16:34

ocamlopt has a similar (surprising) property
doligez (administrator)
2013-06-28 18:19

I personally don't find this surprising at all, but this is related to a feature wish I seem to remember, for a "-odir" option to specify in what directory to put the generated files that are not specified with -o and thus have an implicit file name.
doligez (administrator)
2016-03-23 14:45

This PR suggests putting auxiliary files in the same directory as the -o file.
That may fail if we have write access to the -o file but not its directory, so this would be a slightly dangerous change.

The -odir option seems safer and easier to use.

- Issue History
Date Modified Username Field Change
2013-01-14 16:32 kosik New Issue
2013-01-14 16:34 kosik Note Added: 0008749
2013-06-28 18:19 doligez Note Added: 0009641
2013-06-28 18:19 doligez Status new => acknowledged
2013-07-12 09:22 doligez Target Version => 4.01.0+dev
2013-07-22 12:46 frisch Target Version 4.01.0+dev => later
2013-08-19 15:58 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser}) => OCaml tools (ocaml{lex,yacc,dep,browser,debug})
2013-09-12 16:00 doligez Target Version later => 4.02.0+dev
2014-08-18 20:15 doligez Target Version 4.02.0+dev => 4.03.0+dev / +beta1
2016-02-10 15:54 doligez Relationship added related to 0006475
2016-03-23 14:45 doligez Note Added: 0015589
2016-03-23 14:46 doligez Severity minor => feature
2016-03-23 14:46 doligez Target Version 4.03.0+dev / +beta1 =>
2016-12-07 16:37 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser,debug}) => OCaml tools (ocaml{lex,yacc,dep,debug})
2016-12-09 08:48 shinwell Category OCaml tools (ocaml{lex,yacc,dep,debug}) => OCaml general
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-02 14:48 doligez Category -OCaml general => compiler driver
2017-03-24 13:06 doligez Relationship added related to 0006191
2017-03-24 13:06 doligez Assigned To => shindere
2017-03-24 13:06 doligez Status acknowledged => assigned
2017-06-29 12:15 dra Relationship added has duplicate 0007573

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker