OpenCores
no use no use 1/1 no use no use
Run bld-all.sh fails on CentOS
by jylai1982 on Feb 24, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Hi,

I would like to install GNU toolchain for or1ksim on CentOS 4.6.
However, I have some problems about gmp and mpfr.

I downloaded the GNU toolchain for or1ksim from svn:
% svn co http://opencores.org/ocsvn/openrisc/openrisc/trunk/gnu-src
% cd gnu-src
% git clone git://git.openrisc.net/jonas/uClibc
% git clone git://git.openrisc.net/jonas/linux

The first step, I installed the or1ksim, and it's done without problems.

The second step, I installed the prerequisite libraries.
I cannot use "apt-get -y install" to install the libraries on CentOS.
So, I installed gmp, mpfr, and mpc manually.

After installing the libraries, I try to install the GNU toolchain.
I type the following command:
% ./bld-all.sh --force --prefix ${my_openrisc} --or1ksim-dir ${my_or1ksim} \\
--uclibc-dir uClibc --linux-dir linux
But I got the following error messages:
% checking for correct version of gmp.h... no
% checking for the correct version of mpc.h... no
% configure: error: Building GCC requires GMP 4.2+ and MPFR 2.3.2+.
% Try the --with-gmp and/or --with-mpfr options to specify their locations.
% Copies of these libraries' source code can be found at their respective
% hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
% See also http://gcc.gnu.org/install/prerequisites.html for additional info.
% If you obtained GMP and/or MPFR from a vendor distribution package, make
% sure that you have installed both the libraries and the header files.
% They may be located in separate packages.
% configure failed.

It seems that I should specify --with-gmp --with-mpfr, but I cannot add these parameters after ./bld-all.sh.

Is there any solution about this situation?

Thanks a lot.
RE: Run bld-all.sh fails on CentOS
by jeremybennett on Feb 24, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi jylai1982

I think you may need the development packages for GMP and MPFR. Doesn't Centos use yum rather than apt-get?

If so you might want to look for mpfr-devel and gmp-devel packages. I use Fedora, and they are on the standard Add/Remove Programs tool.

If not, you need to make sure that they are hand installed somewhere that configure will find the headers and libraries OK. Either in a standard place, or by setting the appropriate PATH environment variable.

HTH

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: Run bld-all.sh fails on CentOS
by daeny2 on Feb 25, 2011
daeny2
Posts: 3
Joined: Jan 5, 2011
Last seen: May 10, 2011
Hi~

I think you may need the development packages and others..

# yum install subversion
# yum install cvs
# yum install openssh-serve

# yum install gcc
# yum install g++
# yum install flex
# yum install bison
# yum install patch
# yum install texinfo
# yum install ncurses-devel
# yum install mpfr-devel
# yum install gmp-deve

# yum install gtkwave

# yum install iverilog
# yum install iverilog-devel
# yum install perl-Hardware-Verilog-Parser
# yum install perl-Verilog
# yum install perl-Verilog-CodeGen
# yum install perl-Verilog-Readmem
# yum install bzip2-devel
# yum install libzip-devel
# yum install zlib-deve



Notice !!!!

After ececuting "svn check out" command, "svn update" command must be executed many times.
When I execute "svn check out" command, all source codes are not downloaded. So I was download all source code using "svn update" command.

# svn co http://opencores.org/ocsvn/openrisc/openrisc/trunk/gnu-src
# cd gnu-src
# svn update
# svn update
# svn update


Thanks.
RE: Run bld-all.sh fails on CentOS
by jylai1982 on Feb 25, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Thanks a lot for your response.

I'm now trying to install gmp-devel and mpfr-devel.
I prefer to build and install these packages in my local directories,
because I'm not the root user.
However, I can only find RPM packages for gmp-devel and mpfr-devel.
Where can I find the source for gmp-devel and mpfr-devel?

In addition, I set LD_LIBRARY_PATH for the prerequisite libraries,
is there any other environment variables should be specified?

Thanks a lot.
RE: Run bld-all.sh fails on CentOS
by jeremybennett on Feb 25, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019
Thanks a lot for your response.

I'm now trying to install gmp-devel and mpfr-devel.
I prefer to build and install these packages in my local directories,
because I'm not the root user.
However, I can only find RPM packages for gmp-devel and mpfr-devel.
Where can I find the source for gmp-devel and mpfr-devel?

In addition, I set LD_LIBRARY_PATH for the prerequisite libraries,
is there any other environment variables should be specified?

Thanks a lot.

Hi jylai1982

You just need the source for GMP and MPFR. All the devel packages do is make sure headers (and possibly additional libraries and data) are installed. But it you build from source you have all that.

You will need to make sure that the compiler can find the headers. I believe with gcc you can achieve this by setting their path(s) in the environment variable CPATH (: separated like any other PATH variable).

HTH

Jeremy

RE: Run bld-all.sh fails on CentOS
by rdaddio on Feb 26, 2011
rdaddio
Posts: 18
Joined: Dec 24, 2005
Last seen: Jul 15, 2021
Hi --I went thru some of this with a older Debian recently with old host tools and it was no fun. Once I got past the gmp & etc problem other things went awry. I ended up upgrading to get newer host tools.
RE: Run bld-all.sh fails on CentOS
by jylai1982 on Feb 27, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Hi,

I successfully installed the or1ksim and its toolchain with manually installed libraries of gmp, mpfr, and mpc.

I will share my experience in the following paragraphs.


As I mentioned above, I'm not root users.

I cannot use apt-get, yum, or rpm to update the prerequisite libraries (gmp, mpfr, and mpc), so I installed them in my local directories.

Specifying "--with-gmp, --with-mpfr, and --mpc" are required for installing gcc-4.5.1, if the libraries are installed in directories different from their default path.

However, there is no parameters for specifying the path of these libraries when running "bld-all.sh".

At first, I tried to install gcc-4.5.1 individually, but there are too many issues when building it, so I gave up.

Then, I modified "bld-all.sh" with the following points, and I successfully installed the toolchain for or1ksim.
  1.Build and install gmp, mpfr, and mpc in advance, and
    set LD_LIBRARY_PATH for these libraries.
  2. Add the following three variables in function "set_defaults"
    (lind 165 of bld-all.sh):
    - gmp="--with-gmp=path/to/my/gmp"
    - mpfr="--with-mpfr=path/to/my/mpfr"
    - mpc="--with-mpc=path/to/my/mpc"
  3. Add "${gmp} ${mpfr} ${mpc}" to the sixth parameters of every
    gnu_config except the gnu_config for GDB (the last gnu_config).
  4. In "function install_linux_headers", modify
    "make INSTALL_HDR_PATH=${this_prefix}/or32-linux headers_install"
    to
    "make ARCH=openrisc INSTALL_HDR_PATH=${this_prefix}/or32-linux headers_install"
Then, use the instructions in http://opencores.org/openrisc,gnu_toolchain, the toolchain should be built and installed well.

RE: Run bld-all.sh fails on CentOS
by jylai1982 on Feb 27, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Hi,

After installing or1ksim and its toolchain, I typed "make check" in the directory "builddir_or1ksim", but there are the following error messages:

% libtool: compile: /users/student/phd/jylai/opencores/src/or1ksim/compile -DHAVE_CONFIG_H -I. -I../../../../or1ksim/testsuite/test-code-or1k/support -I.. -I../../../../or1ksim/testsuite/test-code-or1k/support -I../../../../or1ksim/testsuite/test-code-or1k/except -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT int.lo -MD -MP -MF .deps/int.Tpo -c ../../../../or1ksim/testsuite/test-code-or1k/support/int.c -fPIC -DPIC -o .libs/int.o
% /users/student/phd/jylai/opencores/src/or1ksim/compile: line 123: -DHAVE_CONFIG_H: command not found
% make[4]: *** [int.lo] Error 1
% make[4]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k/support'
% make[3]: *** [check-am] Error 2
% make[3]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k/support'
% make[2]: *** [check-recursive] Error 1
% make[2]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k'
% make[1]: *** [check-recursive] Error 1
% make[1]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite'
% make: *** [check-recursive] Error 1

Is there any solution for this problem?
Thanks a lot!
RE: Run bld-all.sh fails on CentOS
by jeremybennett on Feb 28, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi,

After installing or1ksim and its toolchain, I typed "make check" in the directory "builddir_or1ksim", but there are the following error messages:

% libtool: compile:  /users/student/phd/jylai/opencores/src/or1ksim/compile -DHAVE_CONFIG_H -I. -I../../../../or1ksim/testsuite/test-code-or1k/support -I.. -I../../../../or1ksim/testsuite/test-code-or1k/support -I../../../../or1ksim/testsuite/test-code-or1k/except -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT int.lo -MD -MP -MF .deps/int.Tpo -c ../../../../or1ksim/testsuite/test-code-or1k/support/int.c  -fPIC -DPIC -o .libs/int.o
% /users/student/phd/jylai/opencores/src/or1ksim/compile: line 123: -DHAVE_CONFIG_H: command not found

Hi jylai1982,

You failed to specify a target when configuring Or1ksim. So the "make check" operation does not know which tool chain to use to build the test programs. You should use (for example)

../or1ksim-0.5rc1/configure --target=or32-elf ...

HTH

Jeremy

RE: Run bld-all.sh fails on CentOS
by jylai1982 on Feb 28, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Hi, Jeremy,

I specified "--target=or32-elf" when I installed or1ksim.
Should I configure it again when I execute "make check"?
Thanks a lot.
RE: Run bld-all.sh fails on CentOS
by jeremybennett on Feb 28, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019
Hi, Jeremy,

I specified "--target=or32-elf" when I installed or1ksim.
Should I configure it again when I execute "make check"?
Thanks a lot.

Hi jylai1982

Just a thought. Did you have the GNU tool chain (or32-elf) installed and on your PATH when you configured Or1ksim?

If not you'll need to reconfigure Or1ksim after the tool chain is installed.

We don't have an ideal solution. You need Or1skim to build the tool chain (it is used as the simulator inside GDB), but you cannot test Or1ksim until the tool chain is built and installed. So from new, the sequence has to be:

  1. Configure and build Or1ksim
  2. Configure, build and install the GNU tool chain
  3. Reconfigure and test Or1ksim

Let us know if this fixes your problem.

HTH

Jeremy

RE: Run bld-all.sh fails on CentOS
by andesr on Mar 2, 2011
andesr
Posts: 1
Joined: Jan 17, 2011
Last seen: Oct 10, 2011
For alternative build instructions, have a look at http://openrisc.net/
RE: Run bld-all.sh fails on CentOS
by jylai1982 on Mar 4, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: Apr 22, 2015
Hi, Jeremy,

Thanks for your help!
"make check" indeed needs to reconfigure the or1ksim.
But I have new problems when performing "make check".
Please find the attached log file after I ran "make check".
Thanks a lot again.


Hi, Andesr,

Thanks for your valuable guideline.
check.log (50 kb)
RE: Run bld-all.sh fails on CentOS
by forrest.yu on Mar 23, 2014
forrest.yu
Posts: 2
Joined: Apr 23, 2013
Last seen: Mar 27, 2015
Hi,I am new to this stuff,and i meet the same issue as you, can you share your revised bld-all.sh for me reference ?
can you tell me how to step and step building this on CentOS 5.5 x64 with buildin gcc version 4.1.2 ?
below is my step to build the toolchain:
1)on Host - CentOS 5.5 X64 ,yum groupinstall "Development Tools"
2)update the gcc from version 4.1.2 to version 4.5.1
below is my sript file:
#download the source
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/{gmp-4.3.2.tar.bz2,mpc-0.8.2.tar.gz,mpfr-2.4.2.tar.bz2} && wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.1/gcc-4.5.1.tar.bz2
#install gmp
tar jxf gmp-4.3.2.tar.bz2 &&cd gmp-4.3.2/ ;./configure --prefix=/usr/local/gmp-4.3.2/ &&make && make check &&sudo make install

sleep 1
cd ../ ;tar jxf mpfr-2.4.2.tar.bz2 ;cd mpfr-2.4.2/ ;./configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2 &&make && make check &&sudo make install

cd ../ ;tar xzf mpc-0.8.2.tar.gz ;cd mpc-0.8.2 ;./configure --prefix=/usr/local/mpc-0.8.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2 &&make && make check &&sudo make install

cd ../ ;tar jxf gcc-4.5.1.tar.bz2 ;cd gcc-4.5.1 ;./configure --prefix=/usr/local/gcc-4.5.1 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.2


export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-0.8.2/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib/


#vi /etc/ld.so.conf

/usr/local/mpc-0.8.2/lib
/usr/local/gmp-4.3.2/lib
/usr/local/mpfr-2.4.2/lib

$sudo ldconfig

make && sudo make install

mkdir -p /data/backup/`date +%Y%m%d`
mv /usr/bin/{gcc,g++} /data/backup/`date +%Y%m%d`

cd /usr/bin

sudo ln -s /usr/local/gcc-4.5.1/bin/gcc /usr/bin/gcc
sudo ln -s /usr/local/gcc-4.5.1/bin/g++ /usr/bin/g++
#vi /etc/profile

LD_LIBRARY_PATH=:/usr/local/mpc-0.8.2/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/gcc-4.5.1/lib
export LD_LIBRARY_PATH

reboot

gcc -v

3)svn the toolchain source code .
4)cd gnu-stable and ./bld-all.sh ,that fails with massage fail message lack of libmpfr.so.4 .


is it correct ? need i update the gcc version to 4.5.1 ? or directly use bld-all.sh ?

I am lucky to know i revise the bld-all.sh successfully install it ,can you tell me your step step solve the issue ,and attach your bld-all.sh for CentOS x64

thanks in advance !


After installing or1ksim and its toolchain, I typed "make check" in the directory "builddir_or1ksim", but there are the following error messages:

% libtool: compile: /users/student/phd/jylai/opencores/src/or1ksim/compile -DHAVE_CONFIG_H -I. -I../../../../or1ksim/testsuite/test-code-or1k/support -I.. -I../../../../or1ksim/testsuite/test-code-or1k/support -I../../../../or1ksim/testsuite/test-code-or1k/except -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -MT int.lo -MD -MP -MF .deps/int.Tpo -c ../../../../or1ksim/testsuite/test-code-or1k/support/int.c -fPIC -DPIC -o .libs/int.o
% /users/student/phd/jylai/opencores/src/or1ksim/compile: line 123: -DHAVE_CONFIG_H: command not found
% make[4]: *** [int.lo] Error 1
% make[4]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k/support'
% make[3]: *** [check-am] Error 2
% make[3]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k/support'
% make[2]: *** [check-recursive] Error 1
% make[2]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite/test-code-or1k'
% make[1]: *** [check-recursive] Error 1
% make[1]: Leaving directory `/users/student/phd/jylai/opencores/src/builddir_or1ksim/testsuite'
% make: *** [check-recursive] Error 1

Is there any solution for this problem?
Thanks a lot!
no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.