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>&nbsp;<B><I>delta trinity &lt;deltatrinity@hotmail.com&gt;</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&gt;/dev/null ||<BR>ln $srcdir/$ac_source $ac_dest ||<BR>{ { echo "$as_me:22626: error: cannot link $ac_dest to <BR>$srcdir/$ac_source" &gt;&amp;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&gt;/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" &gt;&amp;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>&gt;From: Minh Nguyen <MD6NGUYEN@YAHOO.COM><BR>&gt;To: gmp-discuss@swox.com<BR>&gt;Subject: GMP on MacOS<BR>&gt;Date: Fri, 6 Dec 2002 11:00:05 -0800 (PST)<BR>&gt;<BR>&gt;<BR>&gt;Hi all, I'm building GMP shared library on MacOS. Everything worked fine. <BR>&gt;Here is the library listing<BR>&gt;<BR>&gt;#### SNIP ####<BR>&gt;<BR>&gt;rhea 11% ls -l $HOME/gmp-4.1/.libs<BR>&gt;<BR>&gt;-rwxr-xr-x 1 mnguyen maple 1372168 Dec 5 14:54 libgmp.3.3.0.dylib*<BR>&gt;<BR>&gt;lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.3.dylib@ -&gt; <BR>&gt;libgmp.3.3.0.dylib<BR>&gt;<BR>&gt;lrwxr-xr-x 1 mnguyen maple 18 Dec 5 14:54 libgmp.dylib@ -&gt; <BR>&gt;libgmp.3.3.0.dylib<BR>&gt;<BR>&gt;#### SNIP ####<BR>&gt;<BR>&gt;I then set the Dynamic Library Path to include the GMP path<BR>&gt;<BR>&g
 t;rhea 12 % set DYLD_LIBRARY_PATH="$HOME/gmp-4.1/.libs"<BR>&gt;<BR>&gt;Next, I compile a test program<BR>&gt;<BR>&gt;rhea 14 % gcc -g -I $HOME/gmp-4.1/ -o add_test add_test.c <BR>&gt;-L$HOME/gmp-4.1/.libs -lgmp<BR>&gt;<BR>&gt;The test program was compiled fine. However, when I tried to run the <BR>&gt;program I got this error.<BR>&gt;<BR>&gt;#### SNIP ####<BR>&gt;<BR>&gt;rhea 15 % ./add_test 100<BR>&gt;<BR>&gt;dyld: ./add_test can't open library: /usr/local/lib/libgmp.3.dylib (No such <BR>&gt;file or directory, errno = 2)<BR>&gt;<BR>&gt;#### SNIP ####<BR>&gt;<BR>&gt;It looks like that the path "/usr/local/lib/libgmp.3.dylib" was embedded in <BR>&gt;the shared library libgmp.3.3.0.dylib. But why the error message? After <BR>&gt;all, libgmp.3.dylib is just a symbolic link to libgmp.3.3.0.dylib right? So <BR>&gt;why bother to find this link when the shared library has been found. Anyone <BR>&gt;knows how to get around this?<BR>&gt;<BR>&gt;Thanks,<BR>&gt;<BR>&gt;Minh<BR>&gt;<BR>
 &gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;---------------------------------<BR>&gt;Do you Yahoo!?<BR>&gt;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--