caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Shared library problem (newbi)
@ 2004-08-15 13:08 Lionel Sacks
  2004-08-15 15:44 ` Paul Snively
  2004-08-18  2:53 ` Jacques Garrigue
  0 siblings, 2 replies; 4+ messages in thread
From: Lionel Sacks @ 2004-08-15 13:08 UTC (permalink / raw)
  To: caml-list

I wonder if you might be able to help me...

Problem is this; I'm trying to install/run nab on my little iBookG4/Panther.
http://nab.epfl.ch/

It requires ocaml, gtk and lablgtk.
I've used fink to install ocaml (3.07+2) and gtk (1.2.10)
Lablgtk comes from
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
Complied and installed my self (version 1.2.7)

So far so good. Test/demo progs work. Labgtk and gtk are v.1 as required (I
haven't installed the v.2 series)

Nab compiles fine and the command line version works OK.
However, when I try to run the graphical version (that uses the tcltc/labtk
etc). I get:

lsacks$ ./bin/nabviz-top
Fatal error: cannot load shared library dllstr
Reason: dyld: ocamlrun multiple definitions of symbol _re_partial_match
/sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match
/sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match


Now I'm stumped.
I haven't done much dev on the mac etc.

Any ideas about the above?

Any help welcome,

Cheers,
 Lionel.



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] Shared library problem (newbi)
  2004-08-15 13:08 [Caml-list] Shared library problem (newbi) Lionel Sacks
@ 2004-08-15 15:44 ` Paul Snively
  2004-08-15 21:57   ` David Brown
  2004-08-18  2:53 ` Jacques Garrigue
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Snively @ 2004-08-15 15:44 UTC (permalink / raw)
  To: Lionel Sacks; +Cc: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Aug 15, 2004, at 6:08 AM, Lionel Sacks wrote:

> I wonder if you might be able to help me...
>
> Problem is this; I'm trying to install/run nab on my little 
> iBookG4/Panther.
> http://nab.epfl.ch/
>
> It requires ocaml, gtk and lablgtk.
> I've used fink to install ocaml (3.07+2) and gtk (1.2.10)
> Lablgtk comes from
> http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
> Complied and installed my self (version 1.2.7)
>
> So far so good. Test/demo progs work. Labgtk and gtk are v.1 as 
> required (I
> haven't installed the v.2 series)
>
> Nab compiles fine and the command line version works OK.
> However, when I try to run the graphical version (that uses the 
> tcltc/labtk
> etc). I get:
>
> lsacks$ ./bin/nabviz-top
> Fatal error: cannot load shared library dllstr
> Reason: dyld: ocamlrun multiple definitions of symbol _re_partial_match
> /sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match
> /sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match
>
>
> Now I'm stumped.
> I haven't done much dev on the mac etc.
>
> Any ideas about the above?
>
Yes.

Short answer: Mach-O (Darwin/Mac OS X executable file format) sucks 
dead donkey dingos, and you can quote me on that.

Longer answer: apparently the version of O'Caml provided as a Fink 
package was not compiled with the correct link options.

Slightly longer answer still: don't use Fink; it almost always ends up 
costing you more than it buys you. You can build O'Caml, gtk, and 
lablgtk from source. The trick when you build O'Caml, though, will be 
to ensure that the LDFLAGS that the stub libraries get include "-bundle 
- -undefined suppress -flat_namespace". There's actually a good 
discussion of the issues at 
<http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en>

> Any help welcome,
>
> Cheers,
>  Lionel.
>
>
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: 
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>
Best of luck, and please let me know if you continue to encounter 
difficulties.

Paul

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iEYEARECAAYFAkEfhOkACgkQbot1wzHBQBVBWACglBxgrmn7+JeeOTOWeHdl6YKB
2jYAn36HKsl8L3oxA/Awq6Hhyi89Lkff
=5sts
-----END PGP SIGNATURE-----

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] Shared library problem (newbi)
  2004-08-15 15:44 ` Paul Snively
@ 2004-08-15 21:57   ` David Brown
  0 siblings, 0 replies; 4+ messages in thread
From: David Brown @ 2004-08-15 21:57 UTC (permalink / raw)
  To: Paul Snively; +Cc: Lionel Sacks, caml-list

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

On Sun, Aug 15, 2004 at 08:44:32AM -0700, Paul Snively wrote:

> Longer answer: apparently the version of O'Caml provided as a Fink 
> package was not compiled with the correct link options.
> 
> Slightly longer answer still: don't use Fink; it almost always ends up 
> costing you more than it buys you. You can build O'Caml, gtk, and 
> lablgtk from source. The trick when you build O'Caml, though, will be 
> to ensure that the LDFLAGS that the stub libraries get include "-bundle 
> -undefined suppress -flat_namespace". There's actually a good 
> discussion of the issues at 
> <http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en>

"Fink is broken, don't use it" is a silly answer.  How about reporting a
bug?  Other than a strange bug that isn't reproduceable, no-one has ever
filed a bug against ocaml, so until this point, I've never had any reason
to think there was something wrong with the fink package.

Actually, the fink script just builds ocaml, and only specifies options
because of the prefix.  If it isn't building correctly on OSX, probably
most people who build it themselves would do it wrong as well.  In this
case, the bug would be against ocaml itself.

But, if it could be fixed, fink allows the package to include patches, at
which point it becomes significantly more helpful than trying to compile it
yourself.

Dave

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [Caml-list] Shared library problem (newbi)
  2004-08-15 13:08 [Caml-list] Shared library problem (newbi) Lionel Sacks
  2004-08-15 15:44 ` Paul Snively
@ 2004-08-18  2:53 ` Jacques Garrigue
  1 sibling, 0 replies; 4+ messages in thread
From: Jacques Garrigue @ 2004-08-18  2:53 UTC (permalink / raw)
  To: lionelsacks; +Cc: caml-list

From: Lionel Sacks <lionelsacks@yahoo.co.uk>

> Problem is this; I'm trying to install/run nab on my little iBookG4/Panther.
> http://nab.epfl.ch/
> 
> It requires ocaml, gtk and lablgtk.
> I've used fink to install ocaml (3.07+2) and gtk (1.2.10)
> Lablgtk comes from
> http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
> Complied and installed my self (version 1.2.7)
> 
> So far so good. Test/demo progs work. Labgtk and gtk are v.1 as required (I
> haven't installed the v.2 series)
> 
> Nab compiles fine and the command line version works OK.
> However, when I try to run the graphical version (that uses the tcltc/labtk
> etc).

You got me confused here: you're using lablgtk, not labltk...

> lsacks$ ./bin/nabviz-top
> Fatal error: cannot load shared library dllstr
> Reason: dyld: ocamlrun multiple definitions of symbol _re_partial_match
> /sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match
> /sw/lib/ocaml/stublibs/dllstr.so definition of _re_partial_match

Interesting problem. Looking at the Makefile the cause is clear:
str.cma is linked twice in nabviz-top. Apparently, OSX's dyld doesn't
like to open the same dll twice. Will have to do something about it.
By the way, the fink discussion is irrelevant here: ocaml will use the
same dynamic loading whether you use fink or not (or I hope so.)

I join a patch for nab's Makefile.

More generally, when you have problems with dynamic loading, the
fastest way to solve them is to add -custom in the linking step.
This also solves the problem in this case.

Cheers,

Jacques Garrigue 

--- Makefile	Wed Aug 18 11:37:35 2004
+++ Makefile.new	Wed Aug 18 11:44:54 2004
@@ -103,8 +103,8 @@
 THREADS_LIB = $(LIB_DIR)/threads/threads$(CMA)
 
 
-GTK_LIBS = $(GTK_DIR)/lablgtk$(CMA) $(UNIX_LIB) $(STR_LIB)
-GTK_TH_LIBS = $(UNIX_LIB) $(THREADS_LIB) $(STR_LIB)  $(GTK_DIR)/lablgtk$(CMA)
+GTK_LIBS = $(GTK_DIR)/lablgtk$(CMA) $(UNIX_LIB)
+GTK_TH_LIBS = $(UNIX_LIB) $(THREADS_LIB) $(GTK_DIR)/lablgtk$(CMA)
 GTK_TH_OBJS =  $(GTK_DIR)/gtkThread$(CMO)  $(GTK_DIR)/gtkInit$(CMO) $(GTK_DIR)/gtkThInit$(CMO)
 GTK_INIT_OBJS = $(GTK_DIR)/gtkInit$(CMO)
 

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2004-08-18  2:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-15 13:08 [Caml-list] Shared library problem (newbi) Lionel Sacks
2004-08-15 15:44 ` Paul Snively
2004-08-15 21:57   ` David Brown
2004-08-18  2:53 ` Jacques Garrigue

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