rwmjones_holiday has quit [Ping timeout: 245 seconds]
Edward_ has quit []
Amorphous has quit [Ping timeout: 245 seconds]
Amorphous has joined #ocaml
valross has quit [Remote host closed the connection]
<iris1>
Dear experts, I am having a problem with compilation. I am trying to (native) compile the example that comes from the Glpk module. Compiling example.ml to example.cmx goes fine, but in the second step, when I am trying to link stuff together with "ocamlopt glpk.cmxa -o example example.cmx", it fails with "/usr/bin/ld: cannot find -lglpk". I do have libglpk compiled but I am not able to install it outside my home directory. Therefore it
<iris1>
like I should figure out what file it is looking for, then tell ocamlopt where that file lives. Can you please help? (I am using Ubuntu Server) Thank you very much!
<julm>
iris1: your first post has been cut after "Therefore it" by the IRC server
<julm>
iris1: perhaps have a glance at man 8 ld.so, especially around the environments variables like LD_LIBRARY_PATH
<iris1>
The end is: ... Therefore it seems like I should figure out what file it is looking for, then tell ocamlopt where that file lives. Can you please help? (I am using Ubuntu Server) Thank you very much!
<julm>
or passing a -rpath to ld
<iris1>
Thank you very much for your advice!
<julm>
with something like ocamlopt -cclib -Wl,-rpath=/home/your/lib/
<iris1>
Let me try this...
<julm>
(from memory, and I'm tired, but you got it)
<iris1>
what do -Wl and -rpath do?
<julm>
-Wl tells gcc to pass options to ld
<julm>
-rpath adds a directory to the runtime library search path
<iris1>
-rpath seems very useful. But the -Wl is confusing to me. Does gcc play a role in ocamlopt?
<julm>
ocamlopt calls gcc, you can see it with -verbose IIRC
<julm>
to do the linking
<iris1>
it says gcc: unrecognized option '-rpath=/home/my/lib'
<julm>
works here
<julm>
have you well written "-Wl,-rpath" (no space)
bzzbzz has joined #ocaml
<iris1>
Ah no, sorry. You are right. With the no space, it does not complain about -rpath any more. However, it still cannot find -lglpk.
<iris1>
What is the exact filename it is trying to find? libglpk.XXX?
<julm>
probably libglpk.a or libglpk.so
<julm>
do you have any /home/my/lib/libglpk.{a,so} ?
<iris1>
yes I have both of them
<julm>
-cclib -L/home/my/lib/ helps?
<iris1>
YES!!! Thank you so much for your help!
<julm>
lol, your welcome
<julm>
you're*
<iris1>
julm: may I ask you one last question?
<julm>
yes, you may
<iris1>
Thanks!
<iris1>
This links glpk into my code dynamically, in that when I relocate my glpk compiled source tree, the example stops working
<iris1>
is there a way to tell the linker to statically link glpk (only)?
<julm>
that's likely due to the use of the hardcoded -rpath
<julm>
you may try -cclib -Wl,-static
<julm>
but to only statically link glpk I dunno; perhaps deleting the .so :>
<iris1>
when I do --cclib -Wl,-static, the linker fails with "ld: cannot find -lgcc_s" ...
<julm>
:/
<iris1>
YES YES YES!! removing libglpk.so caused the compilation to result in an executable that keeps working when I relocate my compiled glpk tree. Thank you so much for your help!
<iris1>
this would have taken me at least a week to figure out by myself :-)
<julm>
:)
<julm>
you could also hack around with -rpath=$ORIGIN/lib
<julm>
man 8 ld.so
valross has joined #ocaml
iris1 has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
<thelema>
mmm, I wish I had yield in ocaml
<thelema>
(not yield thread, but to use inverted control flow of a generator)
drunK has quit [Remote host closed the connection]
<flux>
thelema, use the continuations-library :)
<thelema>
delimcc?
<flux>
yes
Snark has joined #ocaml
Modius has quit [Quit: I'm big in Japan]
ulfdoz has quit [Ping timeout: 255 seconds]
joewilliams is now known as joewilliams_away
Tobu has quit [Ping timeout: 255 seconds]
valross has quit [Quit: Ex-Chat]
ttamttam has joined #ocaml
ygrek_ has joined #ocaml
ikaros has joined #ocaml
Snark has quit [Quit: Ex-Chat]
rwmjones_holiday has joined #ocaml
tmaeda has quit [Ping timeout: 240 seconds]
tmaeda has joined #ocaml
Yoric has joined #ocaml
ramses has quit [Read error: No route to host]
ramses has joined #ocaml
ftrvxmtrx has joined #ocaml
_andre has joined #ocaml
bacam_ is now known as bacam
Yoric has left #ocaml []
Yoric has joined #ocaml
Tobu has joined #ocaml
Snark_ has joined #ocaml
Snark_ is now known as Snark
Yoric has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
ygrek_ has quit [Ping timeout: 245 seconds]
kaustuv has joined #ocaml
ygrek_ has joined #ocaml
rks has joined #ocaml
albacker has quit [Max SendQ exceeded]
ygrek_ has quit [Ping timeout: 245 seconds]
avsm2 has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
Leonidas has quit [Ping timeout: 264 seconds]
Leonidas has joined #ocaml
yezariaely has joined #ocaml
notk0 has joined #ocaml
avsm has joined #ocaml
yezariaely has left #ocaml []
ccasin has joined #ocaml
RLa has joined #ocaml
rfg has joined #ocaml
npouillard has quit [Quit: Reconnecting]
npouillard has joined #ocaml
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
larhat has quit [Quit: Leaving.]
notk0 has quit [Ping timeout: 276 seconds]
joewilliams_away is now known as joewilliams
ttamttam has quit [Quit: Ex-Chat]
ygrek_ has joined #ocaml
init1 has joined #ocaml
boscop has quit [Ping timeout: 245 seconds]
boscop has joined #ocaml
rfg has quit [Ping timeout: 245 seconds]
rfg has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
lamawithonel has quit [Remote host closed the connection]
rfg_ has joined #ocaml
cods has quit [Ping timeout: 252 seconds]
cods has joined #ocaml
rfg has quit [Ping timeout: 245 seconds]
rfg_ has quit [Ping timeout: 245 seconds]
cthuluh_ has joined #ocaml
cthuluh_ has quit [Client Quit]
cthuluh has quit [Quit: Reconnecting]
cthuluh has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
rfg has joined #ocaml
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
Yoric has quit [Quit: Yoric]
ztfw has joined #ocaml
RLa has quit [Quit: Leaving]
drunK has joined #ocaml
ftrvxmtrx has joined #ocaml
lamawithonel has joined #ocaml
rfg has quit [Quit: rfg]
rfg has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
diml has quit [Quit: WeeChat 0.3.1.1]
diml has joined #ocaml
ramses has quit []
_andre has quit [Quit: *puff*]
ulfdoz has joined #ocaml
pikachuyann has joined #ocaml
Yoric has joined #ocaml
avsm has joined #ocaml
avsm has quit [Quit: Leaving.]
ccasin has quit [Quit: Leaving]
init1 has quit [Quit: Quitte]
metasyntax` has quit [Quit: Be seeing you.]
ulfdoz has quit [Ping timeout: 245 seconds]
ikaros_ has joined #ocaml
rudi_s has quit [Quit: leaving]
Snark has quit [Quit: Ex-Chat]
joewilliams is now known as joewilliams_away
rwmjones_holiday is now known as rwmjones
joewilliams_away is now known as joewilliams
Yoric has quit [Quit: Yoric]
ztfw has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 245 seconds]
cthuluh has quit [Read error: Operation timed out]