GMP on MacOS
Minh Nguyen
md6nguyen@yahoo.com
Fri, 6 Dec 2002 15:35:34 -0800 (PST)
--0-2095770377-1039217734=:29416
Content-Type: text/plain; charset=us-ascii
I'm afraid that's not enough because even if I avoid generating the symlink, the absolute path of the symlink is still hard coded to the shared library and that will still give run-time error. What I'm really looking for is a way to avoid having the path embedded in the shared library.
delta trinity <deltatrinity@hotmail.com> wrote:It is possible that the compiler doesn't recognize symbolic links.
While building for native Windows platforms, using MinGW, I had similar
problem.
To cure it, I had to modify the configure script to force 'hard' copy and
not make symbolic link.
Toward the end of the 'configure' shell script, there's something like:
...
# Make a symlink if possible; otherwise try a hard link.
ln -s $ac_rel_source $ac_dest 2>/dev/null ||
ln $srcdir/$ac_source $ac_dest ||
{ { echo "$as_me:22626: error: cannot link $ac_dest to
$srcdir/$ac_source" >&5
...
what I did is comment the second line, like this:
...
# Make a symlink if possible; otherwise try a hard link.
# ln -s $ac_rel_source $ac_dest 2>/dev/null ||
ln $srcdir/$ac_source $ac_dest ||
{ { echo "$as_me:22626: error: cannot link $ac_dest to
$srcdir/$ac_source" >&5
...
Note that this problem was related to the version of GCC that I were using
(that was part of the version of MinGW I had). Well, it doesn't hurt to at
least try it ;-)
>From: Minh Nguyen
>To: gmp-discuss@swox.com
>Subject: GMP on MacOS
>Date: Fri, 6 Dec 2002 11:00:05 -0800 (PST)
>
>
>Hi all, I'm building GMP shared library on MacOS. Everything worked fine.
>Here is the library listing
>
>#### SNIP ####
>
>rhea 11% ls -l $HOME/gmp-4.1/.libs
>
>-rwxr-xr-x 1 mnguyen maple 1372168 Dec 5 14:54 libgmp.3.3.0.dylib*
>
>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.3.dylib@ ->
>libgmp.3.3.0.dylib
>
>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.dylib@ ->
>libgmp.3.3.0.dylib
>
>#### SNIP ####
>
>I then set the Dynamic Library Path to include the GMP path
>
>rhea 12 % set DYLD_LIBRARY_PATH="$HOME/gmp-4.1/.libs"
>
>Next, I compile a test program
>
>rhea 14 % gcc -g -I $HOME/gmp-4.1/ -o add_test add_test.c
>-L$HOME/gmp-4.1/.libs -lgmp
>
>The test program was compiled fine. However, when I tried to run the
>program I got this error.
>
>#### SNIP ####
>
>rhea 15 % ./add_test 100
>
>dyld: ./add_test can't open library: /usr/local/lib/libgmp.3.dylib (No such
>file or directory, errno = 2)
>
>#### SNIP ####
>
>It looks like that the path "/usr/local/lib/libgmp.3.dylib" was embedded in
>the shared library libgmp.3.3.0.dylib. But why the error message? After
>all, libgmp.3.dylib is just a symbolic link to libgmp.3.3.0.dylib right? So
>why bother to find this link when the shared library has been found. Anyone
>knows how to get around this?
>
>Thanks,
>
>Minh
>
>
>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
gmp-discuss mailing list
gmp-discuss@swox.com
https://gmplib.org/mailman/listinfo/gmp-discuss
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--0-2095770377-1039217734=:29416
Content-Type: text/html; charset=us-ascii
<P>I'm afraid that's not enough because even if I avoid generating the symlink, the absolute path of the symlink is still hard coded to the shared library and that will still give run-time error. What I'm really looking for is a way to avoid having the path embedded in the shared library.
<P> <B><I>delta trinity <deltatrinity@hotmail.com></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">It is possible that the compiler doesn't recognize symbolic links.<BR><BR>While building for native Windows platforms, using MinGW, I had similar <BR>problem.<BR><BR>To cure it, I had to modify the configure script to force 'hard' copy and <BR>not make symbolic link.<BR><BR>Toward the end of the 'configure' shell script, there's something like:<BR><BR>...<BR># Make a symlink if possible; otherwise try a hard link.<BR>ln -s $ac_rel_source $ac_dest 2>/dev/null ||<BR>ln $srcdir/$ac_source $ac_dest ||<BR>{ { echo "$as_me:22626: error: cannot link $ac_dest to <BR>$srcdir/$ac_source" >&5<BR>...<BR><BR>what I did is comment the second line, like this:<BR><BR>...<BR># Make a symlink if possible; otherwise try a hard link.<BR># ln -s $ac_rel_source $ac_dest 2>/dev/null ||<BR>ln $srcdir/$ac_source $ac_dest ||<BR>{ { echo "$as_me:22626: error: cannot link $ac_dest to <BR>$srcdir/$ac_sour
ce" >&5<BR>...<BR><BR>Note that this problem was related to the version of GCC that I were using <BR>(that was part of the version of MinGW I had). Well, it doesn't hurt to at <BR>least try it ;-)<BR><BR>>From: Minh Nguyen <MD6NGUYEN@YAHOO.COM><BR>>To: gmp-discuss@swox.com<BR>>Subject: GMP on MacOS<BR>>Date: Fri, 6 Dec 2002 11:00:05 -0800 (PST)<BR>><BR>><BR>>Hi all, I'm building GMP shared library on MacOS. Everything worked fine. <BR>>Here is the library listing<BR>><BR>>#### SNIP ####<BR>><BR>>rhea 11% ls -l $HOME/gmp-4.1/.libs<BR>><BR>>-rwxr-xr-x 1 mnguyen maple 1372168 Dec 5 14:54 libgmp.3.3.0.dylib*<BR>><BR>>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.3.dylib@ -> <BR>>libgmp.3.3.0.dylib<BR>><BR>>lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.dylib@ -> <BR>>libgmp.3.3.0.dylib<BR>><BR>>#### SNIP ####<BR>><BR>>I then set the Dynamic Library Path to include the GMP path<BR>><BR>&g
t;rhea 12 % set DYLD_LIBRARY_PATH="$HOME/gmp-4.1/.libs"<BR>><BR>>Next, I compile a test program<BR>><BR>>rhea 14 % gcc -g -I $HOME/gmp-4.1/ -o add_test add_test.c <BR>>-L$HOME/gmp-4.1/.libs -lgmp<BR>><BR>>The test program was compiled fine. However, when I tried to run the <BR>>program I got this error.<BR>><BR>>#### SNIP ####<BR>><BR>>rhea 15 % ./add_test 100<BR>><BR>>dyld: ./add_test can't open library: /usr/local/lib/libgmp.3.dylib (No such <BR>>file or directory, errno = 2)<BR>><BR>>#### SNIP ####<BR>><BR>>It looks like that the path "/usr/local/lib/libgmp.3.dylib" was embedded in <BR>>the shared library libgmp.3.3.0.dylib. But why the error message? After <BR>>all, libgmp.3.dylib is just a symbolic link to libgmp.3.3.0.dylib right? So <BR>>why bother to find this link when the shared library has been found. Anyone <BR>>knows how to get around this?<BR>><BR>>Thanks,<BR>><BR>>Minh<BR>><BR>
><BR>><BR>><BR>><BR>>---------------------------------<BR>>Do you Yahoo!?<BR>>Yahoo! Mail Plus - Powerful. Affordable. Sign up now<BR><BR><BR>_________________________________________________________________<BR>STOP MORE SPAM with the new MSN 8 and get 2 months FREE* <BR>http://join.msn.com/?page=features/junkmail<BR><BR>_______________________________________________<BR>gmp-discuss mailing list<BR>gmp-discuss@swox.com<BR>https://gmplib.org/mailman/listinfo/gmp-discuss</BLOCKQUOTE><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>
--0-2095770377-1039217734=:29416--