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 6476463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:49:43+00:00 2026-05-25T06:49:43+00:00

I am trying to keep my project self-contained, with all major 3rd party library

  • 0

I am trying to keep my project self-contained, with all major 3rd party library dependencies built and referenced within the project repository. The main ocaml portions of my project rely on ocamlbuild.

But for complex packages like Batteries Included, there seems to be a strong expectation that they be linked into a project via ocamlfind. ocamlfind seems to assume that packages will be installed globally. (I realize it allows environment variables and its conf to point to alternate locations, but it fundamentally still seems to be built around the assumption that packages are globally configured–it has no equivalent of -I or -L flags to dynamically extend the search path for packages, for example. It may be possible to set environment variables to dynamically override the ocamlfind configuration to search the project-local tree, but this is much more awkward than mere arguments, and it also seems like it would be challenging to do so without simultaneously removing discoverability of the main system packages in the primary site-lib, which may also be needed.)

What is a sane strategy for building and building against nontrivial 3rd party packages within a project-local tree for a project using ocamlbuild?

  • 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-25T06:49:44+00:00Added an answer on May 25, 2026 at 6:49 am

    Using environment variables (or separate findlib.conf) is a way to go (and easy). And it doesn’t require removing discoverability of global packages, see reference manual for path and destdir in findlib.conf (OCAMLPATH and OCAMLFIND_DESTDIR environment variables respectively).

    Basically you set destdir to local path when installing project-local packages, and prepend to path when using them (don’t forget to create stublibs in destdir (and add it to ld.conf in stdlib if you are building bytecode binaries)).

    PS I think this is the approach used in ocsigen-bundler.

    Please tell if you experience any problems (cause I am interested in using this same approach too).

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

Sidebar

Related Questions

Trying to keep all the presentation stuff in the xhtml on this project and
I'm trying to recompile a project I've been working on and I keep getting
I am trying to add assert statements to a project, but they keep being
I'm trying to use SHFHKeychainUtils in my project, but I keep getting the following
I'm trying to keep dependencies to a minimum for a program I contribute to,
I'm trying to keep the database tables for a project I'm working on nice
Trying to compile a Web Project here but I keep on getting package does
I'm trying to get Blueprint (SCSS-Syntax) working with my Rails (3.1) project. To keep
I recently started a new project and I'm trying to keep my instance variables
I've been trying to setup gwt-phonegap in my project, but keep getting timeout, saying

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.