I have a new project I'm trying to compile with OASIS. All my packages but one are installed with opam.
My _oasis file looks like this :
(* usual package fields *)
Executable myexe
Path: src
BuildTools: ocamlbuild
MainIs: myexe.ml
BuildDepends:
some_packages_installed_with_opam
mylocalpackage
I tried oasis setup then ./configure but OCamlfind answered that it couldn't find mylocalpackage. So I decided to take a look at where OCamlfind looks for packages and found out that you can set an OCAMLPATH variable to add directories where packages might be installed. So I did export OCAMLPATH=path_to_mylocalpackage:$OCAMLPATH and tried again.
oasis setup gives me this result :
findlib: [WARNING] While parsing 'path_to_my_local_package/META.in':
The `directory' directive is required in this META definition
and ocamlfind query mylocalpackage gives me this result :
ocamlfind: Package `mylocalpackage' not found
I don't know if I should write in _oasis where to find this package or if changing the OCAMLPATH variable is the solution. But if it is, I don't understand the warning.
Steps to reproduce
For those who would like to try it :
Download why3
./configure --enable-local makeCreate a new project with this
_oasisfileOASISFormat: 0.4 Name: myexe Version: 0.1 Synopsis: test file Authors: SO License: CC-BY-NC-SA Plugins: StdFiles (0.4), DevFiles (0.4) Alphafeatures: ocamlbuild_more_args XOCamlbuildExtraArgs: -use-ocamlfind Executable myexe Path: src BuildTools: ocamlbuild MainIs: myexe.ml BuildDepends: unix, str, num, dynlink, zip, menhirLib, why3 NativeOpt: -dtypes -g -annot ByteOpt: -dtypes -g -annot CompiledObject: bestoasis setup ./configure- You should have this error :
ocamlfind: Package 'why3' not found
Well, this is a pretty non-standard approach that you're trying. Not sure, why you need it, as usually it is better just to install the package. Anyway, when you're using the
OCAMLPATHvariable you need to pass it a path to the lib folder, that contains folders that, respectively, contains theMETAfiles. I'm having the following repository structure:and in the
projfolder, I'm running theconfigurescript with the following OCAMLPATH:After that everything works, and you don't even need to pass the
OCAMLPATHvariable anymore to the compilation, linking, or execution stages.