Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6612681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:07:38+00:00 2026-05-25T20:07:38+00:00

I have installed some libraries, and am trying to compile a code. 1) ocamlc

  • 0

I have installed some libraries, and am trying to compile a code.

1) ocamlc -I /usr/lib -I /usr/local/lib/ocaml/3.11.2/apron -I /usr/local/lib/ocaml/3.11.2/gmp -c mlexample2.ml generates well mlexample2.cmi and mlexample2.cmo

2) ocamlopt -I /usr/lib -I /usr/local/lib/ocaml/3.11.2/apron -I /usr/local/lib/ocaml/3.11.2/gmp -o mlexample2.opt generates well mlexample2.cmx

3) However, If I follow the native-code compilation of this page:
ocamlopt -I /usr/lib -I /usr/local/lib/ocaml/3.11.2/apron -I /usr/local/lib/ocaml/3.11.2/gmp -o mlexample2.opt \ bigarray.cmxa gmp.cmxa apron.cmxa boxMPFR.cmxa polkaMPQ.cmxa mlexample2.ml returns File "mlexample2.ml", line 1, characters 0-1: Error: Cannot find file bigarray.cmxa, where usr/lib represents $APRON/lib in the doc. But big.array.cmxa is effectively in /usr/lib/ocaml/bigarray.cmxa. By the way, this command does generate .cmi, .cmx and .o.

So my questions are:

How could I progress from .cmi and .cmo of 1)?

How could I progress from .cmx of 2)

What can I do with the error in 3)

Could anyone help? Thank you very much!

Edit1: 2) should be: ocamlopt -I /usr/lib -I /usr/local/lib/ocaml/3.11.2/apron -I /usr/local/lib/ocaml/3.11.2/gmp -c mlexample2.ml generates .cmi, .cmx and .o.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:07:38+00:00Added an answer on May 25, 2026 at 8:07 pm

    From your other questions, it seems like you got some sample lines to compile and just blindly walking though without understanding the compile options.

    1) You’re compile line has the -c option. This option does not link, thus it allows someone to compile an individual module and link them later. This is helpful to allow the project to be built in pieces and updated in pieces for quicker final compilation. So, the -c option passed to ocamlc produces your cmi and cmo, byte-code complied module.

    2) You are missing something here in your sample compile line –it doesn’t mention anything regarding to produce an additional file. I’m going to assume that you also use the -c option. This is because a .cmx is also a compiled module, but natively compiled via ocamlopt.

    3) This should be a pretty obvious compilation error to fix. Where in your included directories does bigarry.cmxa reside? None of them. You’ve said it yourself that it is in /usr/lib/ocaml/, a directory you did not include! The directories do not search recursively, and you’ve experienced that before in other questions.

    I strongly suggest you read the manual on compilation. This documentation you’re wading through is correct in how to compile, but you’ve set your environment up in a different way and discerning the differences is going to be frustrating until you get a handle on what those commands are actually doing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Eclipse Carbon now and I have some installed Plugins. How to move
I have installed Sphinx in order to document some Python modules and class I'm
I have just installed Delphi 2010 and got some troubles with idHTTP component. If
I have only installed Ruby1.9 on my machine. Have some kind of problems with
I have to upgrade a running wordpress site's wordpress CMS and some installed plugins.and
I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I
I installed Resharper in VS2008 and it seems to have taken over some of
I have written some code that makes use of an open source library to
I'm trying to run some precompiled code (source code is not available) on Ubuntu,
I am a very beginner to Java, recently trying to use some existing libraries

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.