public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* microblaze: error while loading shared libraries: libmpc.so.2
@ 2011-12-21 17:11 naga raj
  2011-12-21 17:50 ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: naga raj @ 2011-12-21 17:11 UTC (permalink / raw)
  To: gcc-help

Hi,

 I have build a microblaze toolchain with Gcc version 4.6.2.
 I was successful in building the toolchain but when i try to compile
a program it is generating following message.

 [nagaraju]$ /home/gnu/microblaze/lin/bin/mb-gcc swap.c
/home/gnu/microblaze/lin/libexec/gcc/microblaze-xilinx-elf/4.6.2/cc1:
error while loading shared libraries: libmpc.so.2: cannot open shared
object file: No such file or directory

 If I add libmpc.so.2 path to my LD_LIBRARY_PATH it is working fine.
My question is, what should I add to build scripts so that I need not
explicitly add this library path to LD_LIBRARY_PATH.

 My configure options are:

. /configure                       \
    --with-gmp=/home/nagaraju/tools/abc/     \
    --with-mpfr=/home/nagaraju/tools/abc/    \
    --with-mpc=/home/nagaraju/tools/abc/     \
    --with-ppl=no               \
    --with-cloog=no     \
    --target=microblaze-xilinx-elf                   \
    --prefix=/home/gnu/microblaze/lin                    \
    --program-prefix=mb-       \
    --with-newlib                       \
    --enable-languages=c,c++           \
    --enable-multilib                   \
    --disable-libquadmath               \
    --enable-static                     \
    --with-sysroot=/home/gnu/microblaze/lin/microblaze-xilinx-elf


Thanks in Advance,
Nagaraju

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-21 17:11 microblaze: error while loading shared libraries: libmpc.so.2 naga raj
@ 2011-12-21 17:50 ` Jonathan Wakely
  2011-12-21 17:56   ` Maciej (Matchek) Bliziński
  2011-12-21 20:11   ` Michael Eager
  0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Wakely @ 2011-12-21 17:50 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

On 21 December 2011 16:56, naga raj wrote:
> Hi,
>
>  I have build a microblaze toolchain with Gcc version 4.6.2.
>  I was successful in building the toolchain but when i try to compile
> a program it is generating following message.
>
>  [nagaraju]$ /home/gnu/microblaze/lin/bin/mb-gcc swap.c
> /home/gnu/microblaze/lin/libexec/gcc/microblaze-xilinx-elf/4.6.2/cc1:
> error while loading shared libraries: libmpc.so.2: cannot open shared
> object file: No such file or directory
>
>  If I add libmpc.so.2 path to my LD_LIBRARY_PATH it is working fine.
> My question is, what should I add to build scripts so that I need not
> explicitly add this library path to LD_LIBRARY_PATH.
>
>  My configure options are:
>
> . /configure                       \

Don't do this, the installation docs strongly recommend not running
configure in the source directory.

>    --with-gmp=/home/nagaraju/tools/abc/     \
>    --with-mpfr=/home/nagaraju/tools/abc/    \
>    --with-mpc=/home/nagaraju/tools/abc/     \

Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
directory, in directories named "gmp", "mpfr" and "mpc" respectively.

This is done automatically for you if you run the
contrib/download_prerequisites script

See http://advogato.org/person/redi/diary/253.html for more details.

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-21 17:50 ` Jonathan Wakely
@ 2011-12-21 17:56   ` Maciej (Matchek) Bliziński
  2011-12-21 18:07     ` Jonathan Wakely
  2011-12-21 20:11   ` Michael Eager
  1 sibling, 1 reply; 7+ messages in thread
From: Maciej (Matchek) Bliziński @ 2011-12-21 17:56 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: naga raj, gcc-help

2011/12/21 Jonathan Wakely <jwakely.gcc@gmail.com>:
> Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
> directory, in directories named "gmp", "mpfr" and "mpc" respectively.

This is interesting. When you build it this way, what happens? Are the
three libraries linked in statically, or do they become shared
libraries? If the latter, how does cc1 find them after installation?

Maciej

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-21 17:56   ` Maciej (Matchek) Bliziński
@ 2011-12-21 18:07     ` Jonathan Wakely
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2011-12-21 18:07 UTC (permalink / raw)
  To: Maciej (Matchek) Bliziński; +Cc: naga raj, gcc-help

2011/12/21 Maciej (Matchek) Bliziński:
> 2011/12/21 Jonathan Wakely <jwakely.gcc@gmail.com>:
>> Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
>> directory, in directories named "gmp", "mpfr" and "mpc" respectively.
>
> This is interesting. When you build it this way, what happens? Are the
> three libraries linked in statically, or do they become shared
> libraries? If the latter, how does cc1 find them after installation?

As I said in the blog post I linked to:
"The trick to this recipe is that the GMP, MPFR and MPC prerequisites
are not installed separately, they are built as part of gcc and linked
to statically."

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-21 17:50 ` Jonathan Wakely
  2011-12-21 17:56   ` Maciej (Matchek) Bliziński
@ 2011-12-21 20:11   ` Michael Eager
  2011-12-22 17:42     ` naga raj
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Eager @ 2011-12-21 20:11 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: naga raj, gcc-help

On 12/21/2011 09:11 AM, Jonathan Wakely wrote:
> On 21 December 2011 16:56, naga raj wrote:
>> Hi,
>>
>>   I have build a microblaze toolchain with Gcc version 4.6.2.
>>   I was successful in building the toolchain but when i try to compile
>> a program it is generating following message.
>>
>>   [nagaraju]$ /home/gnu/microblaze/lin/bin/mb-gcc swap.c
>> /home/gnu/microblaze/lin/libexec/gcc/microblaze-xilinx-elf/4.6.2/cc1:
>> error while loading shared libraries: libmpc.so.2: cannot open shared
>> object file: No such file or directory
>>
>>   If I add libmpc.so.2 path to my LD_LIBRARY_PATH it is working fine.
>> My question is, what should I add to build scripts so that I need not
>> explicitly add this library path to LD_LIBRARY_PATH.
>>
>>   My configure options are:
>>
>> . /configure                       \
>
> Don't do this, the installation docs strongly recommend not running
> configure in the source directory.

See: http://gcc.gnu.org/install/configure.html

>
>>     --with-gmp=/home/nagaraju/tools/abc/     \
>>     --with-mpfr=/home/nagaraju/tools/abc/    \
>>     --with-mpc=/home/nagaraju/tools/abc/     \
>
> Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
> directory, in directories named "gmp", "mpfr" and "mpc" respectively.
>
> This is done automatically for you if you run the
> contrib/download_prerequisites script
>
> See http://advogato.org/person/redi/diary/253.html for more details.

An alternate is to build and install the pre-req libraries in
/usr/local and then update /etc/ld.config to search /usr/local/lib.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-21 20:11   ` Michael Eager
@ 2011-12-22 17:42     ` naga raj
  2011-12-22 20:01       ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: naga raj @ 2011-12-22 17:42 UTC (permalink / raw)
  To: Jonathan Wakely, Michael Eager; +Cc: gcc-help

Hi Mike,

  Thanks for your suggestions. It was working fine.


Hi Jonathan,

   I tried including gmp/mpc/mpfr sources in gcc source folder as you
suggested and added --with-gmp-dir option to configure but it was
throwing an error saying  that it is deprecated. Same with the case
with mpc and mpfr.

  What changes should we do so that gmp, mpc and mpfr libraries are
built along with gcc

Thanks,
Nagaraju



On Thu, Dec 22, 2011 at 1:03 AM, Michael Eager <eager@eagerm.com> wrote:
> On 12/21/2011 09:11 AM, Jonathan Wakely wrote:
>>
>> On 21 December 2011 16:56, naga raj wrote:
>>>
>>> Hi,
>>>
>>>  I have build a microblaze toolchain with Gcc version 4.6.2.
>>>  I was successful in building the toolchain but when i try to compile
>>> a program it is generating following message.
>>>
>>>  [nagaraju]$ /home/gnu/microblaze/lin/bin/mb-gcc swap.c
>>> /home/gnu/microblaze/lin/libexec/gcc/microblaze-xilinx-elf/4.6.2/cc1:
>>> error while loading shared libraries: libmpc.so.2: cannot open shared
>>> object file: No such file or directory
>>>
>>>  If I add libmpc.so.2 path to my LD_LIBRARY_PATH it is working fine.
>>> My question is, what should I add to build scripts so that I need not
>>> explicitly add this library path to LD_LIBRARY_PATH.
>>>
>>>  My configure options are:
>>>
>>> . /configure                       \
>>
>>
>> Don't do this, the installation docs strongly recommend not running
>> configure in the source directory.
>
>
> See: http://gcc.gnu.org/install/configure.html
>
>
>>
>>>    --with-gmp=/home/nagaraju/tools/abc/     \
>>>    --with-mpfr=/home/nagaraju/tools/abc/    \
>>>    --with-mpc=/home/nagaraju/tools/abc/     \
>>
>>
>> Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
>> directory, in directories named "gmp", "mpfr" and "mpc" respectively.
>>
>> This is done automatically for you if you run the
>> contrib/download_prerequisites script
>>
>> See http://advogato.org/person/redi/diary/253.html for more details.
>
>
> An alternate is to build and install the pre-req libraries in
> /usr/local and then update /etc/ld.config to search /usr/local/lib.
>
> --
> Michael Eager    eager@eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

* Re: microblaze: error while loading shared libraries: libmpc.so.2
  2011-12-22 17:42     ` naga raj
@ 2011-12-22 20:01       ` Jonathan Wakely
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2011-12-22 20:01 UTC (permalink / raw)
  To: naga raj; +Cc: Michael Eager, gcc-help

On 22 December 2011 17:36, naga raj wrote:
> Hi Mike,
>
>  Thanks for your suggestions. It was working fine.
>
>
> Hi Jonathan,
>
>   I tried including gmp/mpc/mpfr sources in gcc source folder as you
> suggested and added --with-gmp-dir option to configure but it was
> throwing an error saying  that it is deprecated. Same with the case
> with mpc and mpfr.

So don't use --with-gmp-dir

If I meant you should use option that I would have said so.

I provided a link to my blog post
http://advogato.org/person/redi/diary/253.html which shows exactly how
to do it, and that doesn't use --with-gmp-dir.  Sometimes I feel like
I explain this exact same thing over and over again and noone ever
actually reads what I've written, but because I'm too stupid to give
up I've written this wiki page to try and stop people from using
unnecessary options that cause problems:
http://gcc.gnu.org/wiki/InstallingGCC

Feel free to not read it.

>  What changes should we do so that gmp, mpc and mpfr libraries are
> built along with gcc

Just put the sources in the gcc dir. That's all.


> Thanks,
> Nagaraju
>
>
>
> On Thu, Dec 22, 2011 at 1:03 AM, Michael Eager <eager@eagerm.com> wrote:
>> On 12/21/2011 09:11 AM, Jonathan Wakely wrote:
>>>
>>> On 21 December 2011 16:56, naga raj wrote:
>>>>
>>>> Hi,
>>>>
>>>>  I have build a microblaze toolchain with Gcc version 4.6.2.
>>>>  I was successful in building the toolchain but when i try to compile
>>>> a program it is generating following message.
>>>>
>>>>  [nagaraju]$ /home/gnu/microblaze/lin/bin/mb-gcc swap.c
>>>> /home/gnu/microblaze/lin/libexec/gcc/microblaze-xilinx-elf/4.6.2/cc1:
>>>> error while loading shared libraries: libmpc.so.2: cannot open shared
>>>> object file: No such file or directory
>>>>
>>>>  If I add libmpc.so.2 path to my LD_LIBRARY_PATH it is working fine.
>>>> My question is, what should I add to build scripts so that I need not
>>>> explicitly add this library path to LD_LIBRARY_PATH.
>>>>
>>>>  My configure options are:
>>>>
>>>> . /configure                       \
>>>
>>>
>>> Don't do this, the installation docs strongly recommend not running
>>> configure in the source directory.
>>
>>
>> See: http://gcc.gnu.org/install/configure.html
>>
>>
>>>
>>>>    --with-gmp=/home/nagaraju/tools/abc/     \
>>>>    --with-mpfr=/home/nagaraju/tools/abc/    \
>>>>    --with-mpc=/home/nagaraju/tools/abc/     \
>>>
>>>
>>> Don't do this, put the GMP, MPFR amd MPC sources in the GCC source
>>> directory, in directories named "gmp", "mpfr" and "mpc" respectively.
>>>
>>> This is done automatically for you if you run the
>>> contrib/download_prerequisites script
>>>
>>> See http://advogato.org/person/redi/diary/253.html for more details.
>>
>>
>> An alternate is to build and install the pre-req libraries in
>> /usr/local and then update /etc/ld.config to search /usr/local/lib.
>>
>> --
>> Michael Eager    eager@eagercon.com
>> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

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

end of thread, other threads:[~2011-12-22 17:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 17:11 microblaze: error while loading shared libraries: libmpc.so.2 naga raj
2011-12-21 17:50 ` Jonathan Wakely
2011-12-21 17:56   ` Maciej (Matchek) Bliziński
2011-12-21 18:07     ` Jonathan Wakely
2011-12-21 20:11   ` Michael Eager
2011-12-22 17:42     ` naga raj
2011-12-22 20:01       ` Jonathan Wakely

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 read-only IMAP folder(s) and NNTP newsgroup(s).