Version française
Home     About     Download     Resources     Contact us    
Browse thread
compiling a clib from further away
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andrew Warshaver <awarshaver@j...>
Subject: compiling a clib from further away
I am trying to compile a clib (with the eventual hope of it making its 
way into a compiled ocaml lib).  It is working fine if I am in the 
specific directory; but if I move too far out it fails.  My directories 
are like /../janebase/lib/cephes/  The c files live in cephes.

$ cat lib/cephes/libjane_stubs.clib
bdtr.o
btdtr.o
chbevl.o
...
$ cat _tags
<sexp> or <lib>: include

$ cat myocamlbuild.ml
open Ocamlbuild_plugin
open Command

let headers = ["lib/cephes/mconf.h"; "lib/cephes/protos.h"];;

dispatch begin function
   | After_rules ->
       dep ["compile"; "c"] headers;
   | _ -> ()
end

$ ocamlbuild lib/cephes/libjane_stubs.a
+ /usr/local/home/godi310/godi/bin/ocamlmklib -o /cephes/libjane_stubs 
lib/cephes/bdtr.o lib/cephes/btdtr.o lib/cephes/chbevl.o 
lib/cephes/chdtr.o lib/cephes/const.o lib/cephes/drand.o 
lib/cephes/expx2.o lib/cephes/fdtr.o lib/cephes/gamma.o 
lib/cephes/gdtr.o lib/cephes/igam.o lib/cephes/igami.o 
lib/cephes/incbet.o lib/cephes/incbi.o lib/cephes/kolmogorov.o 
lib/cephes/main.o lib/cephes/mtherr.o lib/cephes/nbdtr.o 
lib/cephes/ndtr.o lib/cephes/ndtri.o lib/cephes/pdtr.o 
lib/cephes/polevl.o lib/cephes/stdtr.o lib/cephes/unity.o
/usr/bin/ld: cannot open output file /cephes/dlllibjane_stubs.so: No 
such file or directory
collect2: ld returned 1 exit status
Command exited with code 2.

However, when I move one directory closer,

$ cd lib
[awarshaver@nyc-qws-029 lib]$ cat myocamlbuild.ml
open Ocamlbuild_plugin
open Command

let headers = ["cephes/mconf.h"; "cephes/protos.h"];;

dispatch begin function
   | After_rules ->
       dep ["compile"; "c"] headers;
   | _ -> ()
end
[awarshaver@nyc-qws-029 lib]$ ocamlbuild cephes/libjane_stubs.a
+ /usr/local/home/godi310/godi/bin/ocamlc.opt -c cephes/main.c
cephes/main.c: In function ‘main’:
cephes/main.c:9: warning: control reaches end of non-void function
Finished, 49 targets (0 cached) in 00:00:02.

Any ideas?

Thanks,
Andrew