Because default GCC in Cygwin is 4.5.3, I tried to install GCC 4.7.2. I have dowloaded tar.bz archive from here, put it to cygwin\usr\gcc-4.7.2 and proceed the following sequence:
tar xvf gcc-4.7.2.tar.bz2
cd gcc-4.7.2
./contrib/download_prerequisites
mkdir build
cd build
../configure --build=x86_64-linux-gnu --prefix=/usr/gcc-4.7.2 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-4.7
make
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
sudo make install
I stucked at make with the following error: (after more than one hour)
make[3]: Leaving directory `/usr/gcc-4.7.2/build/gcc'
mkdir -p -- x86_64-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-linux-gnu/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-linux-gnu-ar... ar
checking for x86_64-linux-gnu-lipo... lipo
checking for x86_64-linux-gnu-nm... /usr/gcc-4.7.2/build/./gcc/nm
checking for x86_64-linux-gnu-ranlib... ranlib
checking for x86_64-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for x86_64-linux-gnu-gcc... /usr/gcc-4.7.2/build/./gcc/xgcc -B/usr/gcc-4.7.2/build/./gcc/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/bin/ -B/usr/gcc-4.7.2/x86_64-linux-gnu/lib/ -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/include -isystem /usr/gcc-4.7.2/x86_64-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/usr/gcc-4.7.2/build/x86_64-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Makefile:15654: recipe for target `configure-stage1-target-libgcc' failed
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:19334: recipe for target `stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/usr/gcc-4.7.2/build'
Makefile:903: recipe for target `all' failed
make: *** [all] Error 2
Does this log contain enoung information, to say what went wrong?
The full log is much more bigger so I allowed myself to put only the part of him. The instruction that I used, I found on Pastebin: http://pastebin.com/1MBaAikB
Could anyone give me a tip how could I solve this problem?
EDIT 1:
I trieid to achieve it in annother way. I found an installation description on http://matpack.de/cygwin/index.html
tar -xf gcc-4.7.2.tar.bz2
mkdir gcc-build
cd gcc-build
../gcc-4.7.2/configure --enable-languages=c,c++
make -j 4
make install
make clean (OPTIONAL)
cd ..
The error that I got, is connected now with 'permission denided'. Error log: http://pastebin.com/0stdpFKf
How this is possible?
I had come across the same problem. Just I have exported the library path of mpc, mpfr and gmp libraries to the LD_LIBRARY_PATH environment variable, then it is working.
GCC 4.7.2 is now available as a test release. In setup.exe, toggle the version numbers for all the gcc4-* packages, as well as libgcc1, libstdc++6, etc., until a 4.7 version is shown. Just keep in mind that you will have to elect to Keep each of these again during subsequent runs of setup.exe, until such time that they are declared stable.
Related
I'm trying to build a makefile project in eclipse under windows but the build fails (Project > Build Project). However, if I navigate to the build directory in the msys2 terminal and call "make" everything runs just fine.
To figure out why building in eclipse does not work I am now trying to find the difference between using make in terminal and in eclipse.
Up to the point where the build fails the console output of eclipse is the same as the output in msys2 terminal:
This is the console output in eclipse:
make
Making all in i386-rtems5/c
make[1]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
Making all in .
make[2]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
Configuring RTEMS_BSP=pc686
checking for gmake... no
checking for make... make
checking build system type... x86_64-w64-mingw32
checking host system type... i386-pc-rtems5
checking rtems target cpu... i386
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-rtems5-strip... i386-rtems5-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for RTEMS_BSP... pc686
checking whether CPU supports libposix... yes
configure: setting up make/custom
configure: creating make/pc686.cache
make[3]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
make[3]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
checking for RTEMS_CPU_MODEL...
checking for RTEMS_BSP_FAMILY... pc386
checking for CPU_CFLAGS... (cached) -mtune=pentiumpro -march=pentium
checking for CFLAGS_OPTIMIZE_V... (cached) -O2 -g -ffunction-sections -fdata-sections
checking for style of include used by make... GNU
checking for i386-rtems5-gcc... i386-rtems5-gcc
checking for i386-rtems5-gcc... (cached) i386-rtems5-gcc
checking whether the C compiler works... no
configure: error: in `/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[2]: *** [Makefile:731: pc686] Error 1
make[2]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
make[1]: *** [Makefile:289: all-recursive] Error 1
make[1]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c'
make: *** [Makefile:410: all-recursive] Error 1
"make" terminated with exit code 2. Build might be incomplete.
This is the output in the msys2 terminal:
$ make
Making all in i386-rtems5/c
make[1]: Verzeichnis „/c/rt5/rtems/kernel/pc/i386-rtems5/c“ wird betreten
Making all in .
make[2]: Verzeichnis „/c/rt5/rtems/kernel/pc/i386-rtems5/c“ wird betreten
Configuring RTEMS_BSP=pc686
configure: loading site script /mingw64/etc/config.site
checking for gmake... no
checking for make... make
checking build system type... x86_64-w64-mingw32
checking host system type... i386-pc-rtems5
checking rtems target cpu... i386
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-rtems5-strip... i386-rtems5-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for RTEMS_BSP... pc686
checking whether CPU supports libposix... yes
configure: setting up make/custom
configure: creating make/pc686.cache
make[3]: Entering directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
make[3]: Leaving directory '/c/rt5/rtems/kernel/pc/i386-rtems5/c/pc686'
checking for RTEMS_CPU_MODEL...
checking for RTEMS_BSP_FAMILY... pc386
checking for CPU_CFLAGS... (cached) -mtune=pentiumpro -march=pentium
checking for CFLAGS_OPTIMIZE_V... (cached) -O2 -g -ffunction-sections -fdata-sections
checking for style of include used by make... GNU
checking for i386-rtems5-gcc... i386-rtems5-gcc
checking for i386-rtems5-gcc... (cached) i386-rtems5-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
[...]
As far as I can see in both cases make is called but with different results. The Makefile is also the same in both cases.
What could cause this?
The difference between invoking make in eclipse and in msys2 terminal is that it is run in different environments. To ensure that I get the same result with both methods I had to make sure that my windows PATH contained the right entries. To find out what entries I had to add to PATH i examined the config.log for the failing case as well as for the successful case.
Additionally I had to run eclipse as administrator as it had no privileges to create temporary files.
On a fresh install of Fedora 30 onto a VM (in the below yum gets gcc 9.1, and trying to use that to build gcc 9.2):
sudo yum install make cmake gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel zlib-devel libgo libgo-devel go g++
wget https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz
tar xf gcc-9.2.0.tar.xz
cd gcc-9.2.0
./configure --prefix=/usr --disable-multilib --with-system-zlib --enable-languages=c,c++,d,fortran,go,objc,obj-c++
make
gives:
make[4]: Leaving directory '/home/mmalak/gcc-9.2.0/x86_64-pc-linux-gnu/libgo'
make[3]: Leaving directory '/home/mmalak/gcc-9.2.0/x86_64-pc-linux-gnu/libgo'
make[2]: Leaving directory '/home/mmalak/gcc-9.2.0/x86_64-pc-linux-gnu/libgo'
make[2]: Entering directory '/home/mmalak/gcc-9.2.0/host-x86_64-pc-linux-gnu/gotools'
/home/mmalak/gcc-9.2.0/host-x86_64-pc-linux-gnu/gcc/gccgo -B/home/mmalak/gcc-9.2.0/host-x86_64-pc-linux-gnu/gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -g -O2 -I ../x86_64-pc-linux-gnu/libgo -static-libstdc++ -static-libgcc -L ../x86_64-pc-linux-gnu/libgo -L ../x86_64-pc-linux-gnu/libgo/.libs -o go ../.././gotools/../libgo/go/cmd/go/alldocs.go ../.././gotools/../libgo/go/cmd/go/go11.go ../.././gotools/../libgo/go/cmd/go/main.go ../x86_64-pc-linux-gnu/libgo/libgotool.a
gccgo: error: ../x86_64-pc-linux-gnu/libgo/libgotool.a: No such file or directory
make[2]: *** [Makefile:821: go] Error 1
make[2]: Leaving directory '/home/mmalak/gcc-9.2.0/host-x86_64-pc-linux-gnu/gotools'
make[1]: *** [Makefile:14649: all-gotools] Error 2
make[1]: Leaving directory '/home/mmalak/gcc-9.2.0'
make: *** [Makefile:997: all] Error 2
Yet libgotool.a exists in /home/mmalak/gcc-9.2.0/x86_64-pc-linux-gnu/libgo/libgotool.a
I don't know if this is the reason but it is not recommended to configure and build gcc in the same directory of source code. Try:
cd ../
mkdir stage1-build && cd stage1-build
../gcc-9.2.0/configure --prefix=/usr --disable-multilib --with-system-zlib --enable-languages=c,c++,d,fortran,go,objc,obj-c++
make
I have looked for hours and cannot seem to find an answer to my issue. I have installed zlib using the sources from zlib.net with mingw32-make -fwin32/Makefile.gcc && mingw32-make install -fwin32/Makefile.gcc like it says in the the Makefile.gcc file as well as trying to install via mingw-get install zlib and mingw-get install zlib-dev and the correct files get into the compile folders:
cp -fp zlib.h '/mingw/include'
cp -fp zconf.h '/mingw/include'
cp -fp libz.a '/mingw/lib'
But then I try to compile RSEM version 1.3.1 via mingw32-make and for some reason mingw cannot find the zlib.h file when it is literally in the C:\MinGW\include folder. Where can I can my MinGW build machine path?
Here are my results:
RSEM-1.3.1$ mingw32-make
g++ -o rsem-extract-reference-transcripts extractRef.o
g++ -o rsem-synthesis-reference-transcripts synthesisRef.o
g++ -o rsem-preref preRef.o
g++ -o rsem-build-read-index buildReadIndex.o
g++ -o rsem-simulate-reads simulation.o
cd samtools-1.3 && ./configure --without-curses && C:/Perl64/site/lib/auto/MinGW/bin/mingw32-make -f Makefile samtools
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking location of HTSlib source tree... htslib-1.3
checking for zlib.h... no
checking for inflate in -lz... no
configure: error: zlib development files not found
Samtools uses compression routines from the zlib library <http://zlib.net>.
Building samtools requires zlib development files to be installed on the build
machine; you may need to ensure a package such as zlib1g-dev (on Debian or
Ubuntu Linux) or zlib-devel (on RPM-based Linux distributions) is installed.
FAILED. This error must be resolved in order to build samtools successfully.
./configure: line 38: sort: No such file or directory
./configure: line 35: sed: No such file or directory
mingw32-make: *** [samtools-1.3/samtools] Error 1
Im having trouble to compile gcc 4.5.0 in red hat 7.
Im following the instructions from here ("The hard way", without libelf).
I use following versions:
# rpm -qa | grep -e libelf -e gmp -e mpfr -e mpc
mpfr-3.1.1-4.el7.x86_64
mpfr-devel-3.1.1-4.el7.x86_64
elfutils-libelf-0.170-4.el7.x86_64
elfutils-libelf-devel-0.170-4.el7.x86_64
gmp-6.0.0-15.el7.x86_64
libmpc-1.0.1-3.el7.x86_64
gmp-devel-6.0.0-15.el7.x86_64
While compiling, he doesnt find mpc.h:
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ 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.
So I compiled it.
Here is the working configure:
/opt/app/gcc/gcc-4.5.0_SOURCE/configure
--prefix=/opt/app/gcc-4.5.0
--enable-languages=c,c++,fortran
--enable-bootstrap
--enable-shared
--enable-threads=posix
--enable-checking=release
--with-system-zlib
--enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-gnu-unique-object
--with-mpc=/opt/app/gcc/tmp/
At the end of make I get this:
...
ar rc libgcc.a $objects
ranlib libgcc.a
make[5]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD/x86_64-unknown-linux-gnu/32/libgcc'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD/x86_64-unknown-linux-gnu/libgcc'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD/x86_64-unknown-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD'
make: *** [all] Error 2
After some research I found out, that texinfo was missing. Install texinfo got me to a new failure:
...
make[3]: *** [doc/gccint.info] Error 1
rm gcc.pod
make[3]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/app/gcc/gcc-4.5.0_BUILD'
make: *** [all] Error 2
After some research I found here that texinfo has a bug. Now Im trying to compile texinfo 4.13a but again, I get into trouble with no clear error message.
Did anyone achieve to compile gcc 4.5.0 in redhat 7?
UPDATE
I can compile gcc 4.5.4, but ONLY IF texinfo is NOT installed ...
kind regards
Your errors 1. GCC requires a build directory outside the gcc-source/ https://gcc.gnu.org/install/configure.html
gcc-4.5.x cannot use the EL7 texinfo. Please install a texinfo from "the gcc-4.5 days" :
yum remove texinfo
yum install Downloads/texinfo-4.13a-10.fc14.x86_64.rpm
http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/14/Everything/x86_64/os/Packages/texinfo-4.13a-10.fc14.x86_64.rpm
GCC-4.5 : The bugfix version is 4.5.4 .
Note: The default build directory is $HOME/tmp/ (Or other dir. in $HOME). ... My build example :
cd gcc-4.5.4/
tar xvf mpfr-3.0.1.tar.xz
mv mpfr-3.0.1/ mpfr
tar xvf gmp-5.0.5.tar.xz
mv gmp-5.0.5/ gmp
tar xvf mpc-0.8.2.tar.gz
mv mpc-0.8.2/ mpc
cd ../
mkdir build-gcc45
cd build-gcc45/
../gcc-4.5.4/configure --prefix=/usr/local/gcc45 --program-suffix=45 --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,fortran --disable-libstdcxx-pch --disable-multilib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
make
# make install
cd /usr/bin/
# ln -s /usr/local/gcc45/bin/gcc45
# ln -s /usr/local/gcc45/bin/g++45
# ln -s /usr/local/gcc45/bin/gfortran45
Using, examples : $ export CC=gcc45 CXX=g++45 FC=gfortran45 && ./configure .... .... $ CC=gcc45 CXX=g++45 FC=gfortran45 cmake ../
Result : "gcc45-c++-4.5.4-1.el7.x86_64.rpm" https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing
Example with the older gcc-4.5.0 :
$ cd build-gcc450/
$ ../gcc-4.5.0/configure --prefix=/opt/app/gcc-4.5.0 --program-suffix=450 --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++,fortran --disable-libstdcxx-pch --disable-multilib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
$ make -j4
# make install ( No errors at all )
https://www.dropbox.com/s/45kfetdjj9lif66/gcc450-configure-opt.txt?dl=0
... More examples → https://drive.google.com/drive/folders/1j7qE9YKTT313B5VBg3kevzCNiykGkonO?usp=sharing
As per the installation instruction given on the gcc wiki site- http://gcc.gnu.org/wiki/InstallingGCC,
tar xvzf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1
make
make install
I was trying to install gcc in my laptop. But, I am getting the below error while installing just after entering the configure command.
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/fedora-19/Downloads/objdir':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
And after entering the make command below error is being displayed.
make: *** No targets specified and no makefile found. Stop.
Please guide on this issue.
I think there is an easiest way to install gcc on Fedora 19.
Did you try with yum ? With something like sudo yum install gcc
Your error means that the makefile which must be generated during the configure command doesn't exist because you don't have any c compiler. You can see details on the config.log file.
You can execute following command to install GCC compiler in fedora:
yum install gcc
After executing this, it shows you a Total size and Total download size.
Or download gcc-4.4.7-3.el6.x86_64 package from web and execute:
rpm -ivh gcc-4.4.7-3.el6.x86_64*
It may work.
This solves the problem,
$PWD/../configure
make
make install