caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Undefined symbols error (Was: ocamlc vs ocamlc.opt?)
@ 2007-02-02 22:51 Nathaniel Gray
  2007-02-03  9:13 ` [Caml-list] " Robert Roessler
  0 siblings, 1 reply; 3+ messages in thread
From: Nathaniel Gray @ 2007-02-02 22:51 UTC (permalink / raw)
  To: Robert Roessler; +Cc: Caml-list

On 1/31/07, Robert Roessler <roessler@rftp.com> wrote:
> I just ran into a problem where building a bytecode executable failed
> with findlib ("ocamlfind ocamlc ...") but the equivalent non-findlib
> command worked.  Then I saw that I could force the same error message
> in my non-findlib build by just matching findlib's ocamlc.opt, while I
> had used ocamlc.
>
> The command line is:
> ocamlc -o bait -I +lablgtk2 -I +lablscintilla -thread threads.cma
> lablgtk.cma gtkInit.cmo scintilla.cma bait.ml
>
> which works fine.  Changing ocamlc to ocamlc.opt yields:
> Error on dynamically loaded library:
> /usr/lib/ocaml/stublibs/dlllablscintilla.so: undefined symbol:
> caml_names_of_builtin_cprim
>
> This is on FC6, with a Yum-installed OCaml 3.09.3 package.  Both of
> the versions of the compiler identify themselves as 3.09.3 with the
> same standard library location, and both were built on Dec 2 of 2006.
>
> So should the versions of ocamlc behave the same excepting performance
> issues, or ?

I'm getting this error on a g++ build step:

g++ -L/sw/lib/ -o dlllablscintilla.so  ml_scintilla.o
liblablscintilla.a "/usr/local/godi/lib/ocaml/std-lib"/libcamlrun.a
"/usr/local/godi/lib/ocaml/std-lib"/lablgtk2/liblablgtk2.a
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangoft2-1.0 -lpango-1.0 -lfreetype.6 -lgobject-2.0 -lgmodule-2.0
-ldl -lglib-2.0 -lgthread-2.0
/usr/bin/ld: Undefined symbols:
_caml_names_of_builtin_cprim
_caml_builtin_cprim

It may or may not be a coincidence, but I'm trying to build your
lablscintilla package.  This is on OS X 10.4 with godi-installed OCaml
3.09.3.  FWIW, these symbol references appear to come from
libcamlrun.a.  They don't appear in libasmrun.

[n8gray@golux n8gray]$ nm -a
/usr/local/godi/lib/ocaml/std-lib/libcamlrun.a | grep builtin_cprim
         U _caml_names_of_builtin_cprim
         U _caml_builtin_cprim
         U _caml_names_of_builtin_cprim
[n8gray@golux n8gray]$ nm -a
/usr/local/godi/lib/ocaml/std-lib/libasmrun.a | grep builtin_cprim

Building the native-code version works fine.
Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Undefined symbols error (Was: ocamlc vs ocamlc.opt?)
  2007-02-02 22:51 Undefined symbols error (Was: ocamlc vs ocamlc.opt?) Nathaniel Gray
@ 2007-02-03  9:13 ` Robert Roessler
  2007-02-04 14:08   ` Robert Roessler
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Roessler @ 2007-02-03  9:13 UTC (permalink / raw)
  To: Caml-list

Nathaniel Gray wrote:
> On 1/31/07, Robert Roessler <roessler@rftp.com> wrote:
>> I just ran into a problem where building a bytecode executable failed
>> with findlib ("ocamlfind ocamlc ...") but the equivalent non-findlib
>> command worked.  Then I saw that I could force the same error message
>> in my non-findlib build by just matching findlib's ocamlc.opt, while I
>> had used ocamlc.
>>
>> The command line is:
>> ocamlc -o bait -I +lablgtk2 -I +lablscintilla -thread threads.cma
>> lablgtk.cma gtkInit.cmo scintilla.cma bait.ml
>>
>> which works fine.  Changing ocamlc to ocamlc.opt yields:
>> Error on dynamically loaded library:
>> /usr/lib/ocaml/stublibs/dlllablscintilla.so: undefined symbol:
>> caml_names_of_builtin_cprim
>>
>> This is on FC6, with a Yum-installed OCaml 3.09.3 package.  Both of
>> the versions of the compiler identify themselves as 3.09.3 with the
>> same standard library location, and both were built on Dec 2 of 2006.
>>
>> So should the versions of ocamlc behave the same excepting performance
>> issues, or ?
> 
> I'm getting this error on a g++ build step:

I am more inclined to believe that there is something weird about the 
ocamlc.opt build or packaging in the FC6 Yum repo, since my problem 
clears up if I keep what I am trying to build constant and just change 
which version of the OCaml compiler I invoke.

> g++ -L/sw/lib/ -o dlllablscintilla.so  ml_scintilla.o
> liblablscintilla.a "/usr/local/godi/lib/ocaml/std-lib"/libcamlrun.a
> "/usr/local/godi/lib/ocaml/std-lib"/lablgtk2/liblablgtk2.a
> -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
> -lpangoft2-1.0 -lpango-1.0 -lfreetype.6 -lgobject-2.0 -lgmodule-2.0
> -ldl -lglib-2.0 -lgthread-2.0
> /usr/bin/ld: Undefined symbols:
> _caml_names_of_builtin_cprim
> _caml_builtin_cprim
> 
> It may or may not be a coincidence, but I'm trying to build your
> lablscintilla package.  This is on OS X 10.4 with godi-installed OCaml
> 3.09.3.  FWIW, these symbol references appear to come from
> libcamlrun.a.  They don't appear in libasmrun.

And libcamlrun.a is sitting right there on the command line - or at 
least an instance of this library is... OTOH, are you sure you want to 
build the DLL this way?  I build the static lib with libasmrun, but 
supply the ocamlrun lib to the DLL build.  Check the 
lib$(PACKAGE).$(A) and dll$(PACKAGE).$(SO) targets in the Makefile.

> [n8gray@golux n8gray]$ nm -a
> /usr/local/godi/lib/ocaml/std-lib/libcamlrun.a | grep builtin_cprim
>         U _caml_names_of_builtin_cprim
>         U _caml_builtin_cprim
>         U _caml_names_of_builtin_cprim
> [n8gray@golux n8gray]$ nm -a
> /usr/local/godi/lib/ocaml/std-lib/libasmrun.a | grep builtin_cprim
> 
> Building the native-code version works fine.

So you had to build on the platform I can't test on. ;)  When you get 
something going, I would like to integrate it into my Makefile as the 
"macosx" case.

Robert Roessler
roessler@rftp.com
http://www.rftp.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Undefined symbols error (Was: ocamlc vs ocamlc.opt?)
  2007-02-03  9:13 ` [Caml-list] " Robert Roessler
@ 2007-02-04 14:08   ` Robert Roessler
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Roessler @ 2007-02-04 14:08 UTC (permalink / raw)
  To: Caml-list

Robert Roessler wrote:
> ...
> And libcamlrun.a is sitting right there on the command line - or at 
> least an instance of this library is... OTOH, are you sure you want to 
> build the DLL this way?  I build the static lib with libasmrun, but 
> supply the ocamlrun lib to the DLL build.  Check the lib$(PACKAGE).$(A) 
> and dll$(PACKAGE).$(SO) targets in the Makefile.

Ack.  I am not sure if I intended to go off on a discussion of Windows 
vs Linux builds, but ocamlrun.lib is used on Windows for the DLL, 
while libcamlrun.a is used for the DLL (.so) on Linux.

They both use libasmrun.$(A) for their respective static lib builds.

Robert Roessler
roessler@rftp.com
http://www.rftp.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-04 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-02 22:51 Undefined symbols error (Was: ocamlc vs ocamlc.opt?) Nathaniel Gray
2007-02-03  9:13 ` [Caml-list] " Robert Roessler
2007-02-04 14:08   ` Robert Roessler

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).