I have followed HDJEMAI suggestion, but when I do
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
there is this error:
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries 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, MPFR and/or MPC 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.
but then if I do
sudo yum install libmpc-devel
Loaded plugins: fastestmirror, nvidia, refresh-packagekit
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: repos-tx.psychz.net
* elrepo: repos.dfw.lax-noc.com
* extras: mirrors.thaidns.co.th
* rpmforge: mirror.team-cymru.org
* updates: mirror.mojohost.com
No package libmpc-devel available.
Error: Nothing to do
If I look fo the libraries, I have
ls /usr/lib64/libmp
libmpcdec.so.5 libmpfr.so.1.2.0 libmpssconfig.so
libmpcdec.so.5.0.2 libmp.so libmpssconfig.so.0
libmpfr.so libmp.so.3 libmpssconfig.so.0.1
libmpfr.so.1 libmp.so.3.1.14
but notice that there is no libmpfr.a as in here. In that same dirrectory I have libgmp.so.
How do I install libmpc-devel? And then how do I install gcc?
You should use contrib/download_prerequisites in the GCC source directory to download the sources of the dependencies. GCC will automatically build and use them during the build process.
Matching system libraries on Red Hat Enterprise Linux 6 are either missing or just too old.
Related
I am trying a build gcc on my Mac it is an intel Mac. I do have these libraries, the libraries are here, so it is usr/local/lib for the libraries and the headers are here usr/local/include. I also successfully compiled and install gmp and mpfr accept the mpc for some reason it is not locating.
gcc error:
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
https://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC 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.
Mpc error:
configure: error: gmp.h cannot be found or is unusable.
This is the error I get:
checking for boostlib >= 1.58.0 (105800)... configure:
We could not detect the boost libraries (version 1.58.0 or higher).
If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.
If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: Boost is not available!
I am on the latest version of macOS big sur and I installed boost with homebrew. I believe boost should be installed in usr/local/include, but for me, it is installed in /opt/homebrew/opt/boost. Could this be the issue? I used a symlink to go from usr/local/include to /opt/homebrew/opt/boost but it didn't work when I cded into the bitcoin folder and then ran ./configure.
export BOOST_ROOT=/opt/homebrew/opt/boost
./configure --with-gui=no --without-bdb --with-boost=$BOOST_ROOT
Your options may differ
I am installing a package (called CLASS, widely used in cosmology) which cannot be compiled with Apple's gcc.
I tried installing gcc by homebrew (gcc-9) and anaconda separately. But both of them could not find the standard C-library files such as stdio.h, math.h etc. I saw this problem very common in mac. I found the standard C-library files at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/. Focusing on anaconda gcc (version 4.8.5), I then copied the files to /Users/satadru/anaconda2/include/. Now simple C-codes, such as a 'hello world' code runs fine. But when I tried to install the CLASS package, I get error arising from the problematic library files: stdio.h, math.h!! I get same error when I try to install the package using homebrew gcc-9 (after copying the library files to its concerned directory). I know that many people could run the package on catalina without any issue.
Now I have the following questions:
Are all standard C-library header files same? In other words, be it anaconda gcc 4.8.5, or gcc-9, the header files are same? Do the header files vary on different os, say linux or mac os?
Does anaconda gcc look for the header files at /Users/satadru/anaconda2/include/?
Before copying all the header files to /Users/satadru/anaconda2/include/, the directory had a few present there.
Why does not anaconda gcc installation place all of its own header files in this directory at the time of installation? Is it same when we do it on linux os?
How to solve my problem? I contacted the owner of the package and he says he himself runs the code on mac os catalina, but never faced this issue.
More information:
xcode-select --install
gives
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
which gcc gives /Users/satadru/anaconda2/bin/gcc
gcc -v gives
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/Users/satadru/anaconda2/bin/../libexec/gcc/x86_64-apple-darwin11.4.2/4.8.5/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ./configure --prefix=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-gxx-include-dir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/gcc/include/c++ --bindir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin --datarootdir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/share --libdir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib --with-gmp=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-mpfr=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-mpc=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-isl=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-cloog=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-boot-ldflags='-Wl,-headerpad_max_install_names -Wl,-L/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-L/usr/lib' --with-stage1-ldflags='-Wl,-headerpad_max_install_names -Wl,-L/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-L/usr/lib' --enable-checking=release --with-tune=generic --disable-multilib
Thread model: posix
gcc version 4.8.5 (GCC)
I am attempting to build GCC-5.3.0 on a PC running Windows 10 with MinGW software.
I got this error
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC
0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries 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, MPFR and/or MPC 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.
My input was
username#computername /d/gnu/gcc-5.3.0-build
$ ../gcc-5.3.0/configure --target arm-eabi --enable-win32-registry=My
ToolchainName --prefix /f/gnu/out/ --enable-languages=c,c++ --disable
-nls --disable-shared --with-newlib --with-headers=../newlib-2.4.0/ne
wlib/libc/include
Note: /d/ path as my D:/ drive
I have added the path in environment variables
D:\MinGW\bin
I already installed libgmp 5.1.2, libmpfr 3.1.2, and libmpc 1.0.2 from MinGW installation manager
I followed the guide from http://gnutoolchains.com/building/ to build my own GNU toolchains on Windows
Download more library package build and install them into a new folder for example /c/gnu/install
gmp-6.1.2.tar.bz2
mpfr-3.1.5.tar.bz2
mpc-1.0.2.tar.gz
1> Build gmp
cd gmp-6.1.2
configure --prefix=/c/gnu/install/
make -j4 install
2> Build mpfr
cd mpfr-3.1.5
configure --prefix=/c/gnu/install/ --with-gmp=/c/gnu/install/ --enable-static --disable-shared
make -j4 install
3> Build mpc
cd mpc-1.0.2
configure --prefix=/c/gnu/install/ --with-gmp=/c/gnu/install/ --with-mpfr=/c/gnu/install/ --enable-static --disable-shared
make -j4 install
Then you configure building gcc with options :
--with-gmp=/c/gnu/install/ --with-mpfr=/c/gnu/install/ --with-mpc=/c/gnu/install/
The error message is self-explanatory: you need to provide paths to required libraries via --with-* option, like --with-gmp=/d/path/to/gmp.
I am attempting to build GCC-4.7.0 on a MacBook Pro running OS X 10.7.4. However, I am continuing to experience the same error:
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
This error occurred after running the following line:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/
To get rid of this error I have tried the following actions:
Using homebrew I downloaded gmp-5.0.4, mpc-0.21, and mpfr-3.1.0. At this point I attempting to point to where gmp, mpc, and mpfr are located with the following command:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/ --with-mpfr=/usr/local/Cellar/ --with-mpc=/usr/local/Cellar/
However, this caused the same error. So, I tried pointing gcc to various locations around the Cellar directory:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/ --with-mpfr=/usr/local/Cellar/mpfr --with-mpc=/usr/local/Cellar/mpc/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/ --with-mpc=/usr/local/Cellar/mpc/0.21/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/Cellar/gmp/5.0.4/include/ --with-mpfr=/usr/local/Cellar/mpfr/3.1.0/include/ --with-mpc=/usr/local/Cellar/mpc/0.21/share/
In the end these all produced the same error. I then downloaded the versions of gmp, mpc, and mpfr linked from the gcc error message (found here: ftp://gcc.gnu.org/pub/gcc/infrastructure/). After building these from the source and running all the same configurations I am left with the same problem. The configurations I have tried with this installation are:
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/ --with-mpfr=/usr/local/ --with-mpc=/usr/local/
./configure --prefix=/Users/jreese/Documents/school/edinburgh/project/local/ --with-gmp=/usr/local/include/ --with-mpfr=/usr/local/include/ --with-mpc=/usr/local/include/
Then I read somewhere that there could be a problem if I didn't explicitly set the configuration to run in 64-bit mode. So, I tried all of these configurations again with the added setting of 'CC=gcc -m64'. But this didn't change anything. If anyone has any ideas I would be greatly appreciative.
If you don't know how to build and properly direct GCC's configure to the libraries you can put them in the source tree of GCC itself:
/some/dir/source/gcc/[libstdc++|libgomp|gcc|libiberty|....]
/some/dir/source/gcc/gmp/[configure|...]
/some/dir/source/gcc/mpfr/[configure|...]
/some/dir/source/gcc/mpc/[configure|...]
So without the version number appended. Then just run GCC configure without any arguments related to GMP/MPC/MPFR.
I've faced the same issue and it was easily solved by installing the corresponding development packages: gmp-devel, mpfr-devel and libmpc-devel
Yigal
EasyBuild (a tool to make building software easier) can be of help here. It comes with a small easyconfig file that specifies which GCC version to build, and which features to enable (see for example https://github.com/hpcugent/easybuild/blob/master/easybuild/easyconfigs/g/GCC/GCC-4.7.0.eb).
Once you've downloaded EasyBuild and configured it, you can just run
$EBHOME/easybuild.sh myGCC.eb
with EBHOME set to the location where you unpacked EasyBuild, and myGCC.eb a copy of the example GCC easyconfig, which you modified to your needs.
This command will download the GCC source tarball for you and build/install it, after doing the same to any dependencies, for example GMP, MPFR and MPC, saving you a lot of headaches.
For more information on EasyBuild, see https://github.com/hpcugent/easybuild/wiki .