caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* custom toplevels and library errors
@ 2009-09-09  4:28 Robert Cloud
  0 siblings, 0 replies; only message in thread
From: Robert Cloud @ 2009-09-09  4:28 UTC (permalink / raw)
  To: caml-list

Hello,

I'm attempting to make a custom top level so that I can interface with
some c functions.  I can get it to work, but I get all kinds of errors
when I try to load in the required libraries.

here are the commands I'm attempting to create it with:
linear_algebra.c contains c functions interfaced to from ocaml,
funs.ml contains their ocaml declarations.


         gcc -c -I/usr/lib64/ocaml/ -I/usr/local/cuda/include/ linear_algebra.c
         ocamlfind ocamlc -custom -c -package bigarray,lacaml funs.ml
         ocamlfind ocamlmktop -custom -o cudatop -package
bigarray,lacaml -linkpkg linear_algebra.o funs.cmo -cc nvcc -ccopt
-lcublas


This works, and I have an executable I can run to get a ocaml prompt,
however, If I try to use the libraries I linked to create the top,
I get an unbound module error.  So actually loading them with the
#load directive, or more usefully topfind, seems to "work" but
the following errors are produced.  Information on what is going wrong
and what to do is very helpful.



# #use "topfind";;

- : unit = ()
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

- : unit = ()
# #require "lacaml";;
/usr/lib64/ocaml/bigarray.cma: loaded
Cannot load required shared library dllbigarray.
Reason: /usr/lib64/ocaml/stublibs/dllbigarray.so:
/usr/lib64/ocaml/stublibs/dllbigarray.so: undefined symbol:
caml_serialize_int_1.
/usr/lib64/ocaml/lacaml: added to search path
/usr/lib64/ocaml/lacaml/lacaml.cma: loaded
Cannot load required shared library dlllacaml_stubs.
Reason: /usr/lib64/ocaml/stublibs/dlllacaml_stubs.so:
/usr/lib64/ocaml/stublibs/dlllacaml_stubs.so: undefined symbol:
caml_string_length.
/usr/lib64/ocaml/lacaml/lacaml_top.cma: loaded
Cannot load required shared library dlllacaml_stubs.
Reason: /usr/lib64/ocaml/stublibs/dlllacaml_stubs.so:
/usr/lib64/ocaml/stublibs/dlllacaml_stubs.so: undefined symbol:
caml_string_length.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-09  4:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09  4:28 custom toplevels and library errors Robert Cloud

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).