It is necessary/advisable to have the FlexDLL C objects compiled with the same C compiler as ocamlopt is using (this is compulsory for Visual Studio 2015; I think that previous version’s might be interchangeable) and you can build those without ocamlopt (make CHAINS=whatever support). flexlink is much less coupled – you can mix versions.

 

In the past, I used flexlink.exe from Alain’s latest binary distribution and compiled the FlexDLL objects from sources, allowing OCaml to be compiled and then once OCaml was compiled, recompiled and replaced flexlink.exe from source. A purist would then recompile OCaml again, but flexlink is just a linker, so I never bothered!

 

It’s not (yet) documented, but in 4.03 you can bootstrap it with OCaml:

1.       Ensure FlexDLL sources are in flexdll/ in the OCaml build tree

a.       If you're building from a git clone, issue git submodule update --init

b.       If you're building from a sources tarball, issue git clone https://github.com/alainfrisch/flexdll.git

2.       Follow usual configuration steps in config/

3.       make -f Makefile.nt flexdll world opt opt.opt install

 

flexlink.exe (and the .manifest files for the MSVC ports) are installed to bin. flexlink.exe will be a bytecode executable unless opt.opt is compiled. The correct .o/.obj files are installed to lib. Note that FlexDLL 0.35 or later is required for this, so you can't yet use a FlexDLL sources tarball.

 

 

David

 

 

From: caml-list-request@inria.fr [mailto:caml-list-request@inria.fr] On Behalf Of Pang, Wai (CA-CIB)
Sent: 29 March 2016 13:11
To: caml-list@inria.fr
Subject: [Caml-list] Circular dependency between Ocaml and FlexDLL

 

Hi All,

 

I am trying to build the latest version of Ocaml and FlexDLL on windows using msvc toolchain.

There appears to be a circular dependencies on these two packages.

 

OCaml build required Flexdll as specified  in the README.win32 file

 

set FLEXDLLDIR=%PFPATH%\flexdll

 

And the FlexDLL build requires ocamlopt from the ocaml package to build flexlink.exe

 

ocamlopt -g -w -105 -o flexlink.exe -cclib "-link version.res" version.ml coff.ml cmdline.ml create_dll.ml reloc.ml

 

How do we compile ocaml if we don’t have binary of flexlink? Also are they really completely backwards compatible so that we can use

any” older version of flexlink to compile the latest ocaml package to produce ocamlopt and then use ocamlopt to build the latest version of flexlink?

Do we than recompile ocaml package to use the newly build flexlink?

 

We have an old version of ocaml packages which is independent of flexlink 3.10. Can we use this version to compile the latest version of flexlink and then use this to compile a newer version of ocaml?

 

Wai

This email does not create a legal relationship between any member of the Crédit Agricole group and the recipient or constitute investment advice. The content of this email (including any attachments) is intended solely for the addressee and access by any other person is not authorised. It may contain information which is confidential, privileged or otherwise protected from disclosure. If you are not the intended recipient of this email, (i) you should send it back to us and delete it from your system, and (ii) you are prohibited from retaining, distributing, disclosing or using (in whole or part) any of its content. Email communication may be logged and archived, monitored and/or disclosed to third parties.

 

Crédit Agricole Corporate and Investment Bank is authorised by the Autorité de Contrôle Prudentiel et de Résolution (ACPR) and supervised by the ACPR and the Autorité des Marchés Financiers (AMF) in France and subject to limited regulation by the Financial Conduct Authority and the Prudential Regulation Authority. Details about the extent of our regulation by the Financial Conduct Authority and the Prudential Regulation Authority are available from us on request. Crédit Agricole Corporate and Investment Bank is incorporated in France with limited liability and registered in England and Wales. Registration number: FC008194. Registered office: Broadwalk House, 5 Appold Street, London, EC2A 2DA

 

Please refer to http://www.ca-cib.com/group-overview/dodd-frank-otc-derivatives.htm for any Dodd-Frank Disclosure for U.S. Persons pursuant to CFTC Regulation 23.431