gcc cannot find bits/predefs.h on i686 - gcc

Okay, so, I switched from ubuntu 12.04 64-bit to 32-bit and installed build-essential.
I then compiled and installed GMP-5.0.5, MPFR-3.1.1, MPC-1.0, ISL-0.10 and CLOOG-0.17.0. I checked out a copy of the main gcc trunk and attempted to build it with the following configure line (from a separate directory):
../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq/svn --with-mpfr=/usr/GCC/prereq/svn --with-mpc=/usr/GCC/prereq/svn --with-isl=/usr/GCC/prereq/svn --with-cloog=/usr/GCC/prereq/svn --enable-languages=c,c++
Configure ran fine and so I ran make && make check. This ran fine for a while, but then it failed with the following error:
/home/matt/GCC/svnbuild/./gcc/xgcc -B/home/matt/GCC/svnbuild/./gcc/ -B/usr/GCC/svn/i686-pc-linux-gnu/bin/ -B/usr/GCC/svn/i686-pc-linux-gnu/lib/ -isystem /usr/GCC/svn/i686-pc-linux-gnu/include -isystem /usr/GCC/svn/i686-pc-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../svnsrc/libgcc -I../../../svnsrc/libgcc/. -I../../../svnsrc/libgcc/../gcc -I../../../svnsrc/libgcc/../include -I../../../svnsrc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../svnsrc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../../../svnsrc/libgcc/../gcc/tsystem.h:88,
from ../../../svnsrc/libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/matt/GCC/svnbuild/i686-pc-linux-gnu/libgcc
I looked around, but everything I seemed to find was that this error was caused on x86_64, by not installing gcc-multilib, because Ubuntu and Debian use the mutiarch system, separating the libraries. Okay, fine...but I'm using i686, so why would I need the 64-bit libraries? Any help would be appreciated. Thanks.

Try doing a
sudo apt-get install gcc-multilib
I don't think that installing a 32-bit system changes the architecture of your computer, because your computer will always be a 64-bit machine. Installing the 64-bit version of Ubuntu should only give better multi-core performance. Since your computer is still a 64-bit computer, you probably need a C compiler that will compile on 64-bit machines. Hence the gcc-multilib. I think.

the gcc-multilib trick didn't work out for me. Instead, setting this in the build environment did the trick:
C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

Related

facing an error during installing mumps on cygwin?

trying to install mumps on my windows laptop, followed instructions to setup cygwin first and install mumps through it....now facing this error updon running ./BuildMumpsWithNativeClientServer.script in cygwin terminal
config.status: creating include/mumpsc/config.h
Now run "make" followed by "make install"
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o mumps.o mumps.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o parse.o parse.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o sys1.o sys1.c
g++ -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o arith.o arith.cpp
sys1.c:804:1: error: conflicting types for ‘itoa’
itoa (val, str, rad)
^~~~
In file included from sys1.c:51:0:
/usr/include/stdlib.h:224:8: note: previous declaration of ‘itoa’ was here
char * itoa (int, char *, int);
^~~~
make: *** [<builtin>: sys1.o] Error 1
make: *** Waiting for unfinished jobs....
arith.cpp: In function ‘void mps_exp10(char*, char*)’:
arith.cpp:855:15: error: ‘exp10’ was not declared in this scope
double aa=exp10(strtod(a,NULL));
^~~~~
arith.cpp:855:15: note: suggested alternative: ‘expx’
double aa=exp10(strtod(a,NULL));
^~~~~
expx
make: *** [<builtin>: arith.o] Error 1
I'm going to give a non-answer that (I hope) will help you achieve your ultimate goal of installing a MUMPS build on your Windows laptop. Because you're running "BuildMumpsWithNativeClientServer.script", I'm guessing you're trying to install Kevin O'Kane's version of MUMPS. You might want to switch to a production-ready MUMPS build like Intersystems Cache, GT.M, or YottaDB.
If you use Intersystems Cache, it will install natively on Windows. If you use GT.M or it's fork, YottaDB, they install cleanly on most Linux distros, but not as native Windows apps. The painless option is to install Windows Subsystem for Linux (WSL) and a linux distro on your laptop. I recommend Ubuntu 18.04 as a Linux distro, since it's the most recent long-term support linux distro that's available in the Windows store.
Once you have linux installed via WSL on your Windows box, installing GT.M only takes a single command: sudo apt install fis-gtm
I know this isn't exactly answering the question you asked, but I'm hoping it gets you the result you really want. Good luck!

MySqlDB: llvm-gcc-4.2: error. Even after installing XCode 4.6.3 and storing MySQL include folder in XAMPP

I took the following steps after reading suggestions from http://andhikalegawa.wordpress.com/2012/01/05/installing-mysql-python-on-snow-leopard-using-xampp-mysql/
Downloaded MySQL-python-1.2.4b4 and unzipped
Changed the mysql_config = /Applications/XAMPP/xamppfiles/bin/mysql_config (as I am using XAMPP 1.7.3)
Downloaded mysql-5.1.70-osx10.6-x86 (I could not find 5.1.55 which is the version used in XAMPP) kept the include folder at /Applications/XAMPP/xamppfiles/
I am new to development so, downloaded XCode 4.6.3 with command line tools.
Logically it should have worked I am getting the following error
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.7-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.7-intel-2.7
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'beta',4) -D_version_=1.2.4b4 -I/Applications/XAMPP/xamppfiles/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.7-intel-2.7/_mysql.o -mmacosx-version-min=10.4 -arch i386 -arch ppc -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
In file included from _mysql.c:44:
/Applications/XAMPP/xamppfiles/include/my_config.h:1088:1: warning: "HAVE_WCSCOLL" redefined
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:8,
from _mysql.c:29:
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:891:1: warning: this is the location of the previous definition
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/6p/8bxdl12d2nq05dmwbmdzttt40000gn/T//cc0v0ehE.out
error: command 'llvm-gcc-4.2' failed with exit status 255
Looks like it's trying to compile universal for PowerPC, which you probably don't have?
error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2'
I would suggest setting the ARCHFLAGS:
shell> rm -Rf build/
shell> ARCHFLAGS="-arch i386" /usr/bin/python setup.py build
Or instead of i386, on 64-bit x86_64. But since you are downloading 32-bit MySQL, might be good to use i386.
Good luck! (Shameless advert: you can always try MySQL Connector/Python)

ld cannot find -l<library>

I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error:
/usr/bin/ld: cannot find -lcoinhsl
Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/
does anyone have a solution for this?
below is the complete return of running setup.py build:
root#ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build
running build
running build_ext
building 'pyipopt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o
src/pyipopt.c: In function ‘set_intermediate_callback’:
src/pyipopt.c:452:15: warning: variable ‘myowndata’ set but not used [-Wunused-but-set-variable]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux-x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7/pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/
/usr/bin/ld: cannot find -lcoinhsl
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
-Ldir
Add directory dir to the list of directories to be searched for -l.
You may install your coinhsl library in one of your standard libraries directories and run 'ldconfig` before doing your ppyipopt install
I had a similar problem with another library and the reason why it didn't found it, was that I didn't run the make install (after running ./configure and make) for that library. The make install may require root privileges (in this case use: sudo make install). After running the make install you should have the so files in the correct folder, i.e. here /usr/local/lib and not in the folder mentioned by you.
you can add the Path to coinhsl lib to LD_LIBRARY_PATH variable. May be that will help.
export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH
where /xx/yy/zz represent the path to coinhsl lib.

Error trying to exec cc1, gcc only wants to compile for avr?

I've installed gcc on my Mac (Snow Leopard) so I can compile for AVR microcontrollers. However, it seems to be preventing me from compiling for anything else. I'd like to build the packages from astrometry.net, and when I run ./configure then make i get the following:
make -C ./qfits-an stage CFLAGS=" -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" LDFLAGS=" -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline" CC="gcc"
make -C src stage
gcc -g -Wall -ffinite-math-only -fno-signaling-nans -march=native -O3 -fomit-frame-pointer -DNDEBUG -fPIC -Winline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -c -o anqfits.o anqfits.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
gcc -v gives:
Using built-in specs.
Target: avr
Configured with: ./configure --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --prefix=/usr/local/staging.avr-gcc
Thread model: single
gcc version 4.1.1
I'm not sure how to proceed! It seems that currently everything is set up to only build for the AVR platform, but I have Xcode installed so somewhere there are more versions of gcc lurking. This install was via http://www.micahcarrick.com/installing-gnu-tools-avr-gcc.html if that helps to see how it was set up (I had Xcode installed prior to this).
The solution, I expect, is simple. I just want to avoid messing up my settings and then not being able to compile for either platform.
Many thanks!
You probably want to remove the non-cross-compiler named versions of the AVR tools you have installed (i.e. gcc, ld, etc.), so the cross-compiler, and related tools, are only available using target-specific names.
To do this, find the directory where they are installed (/usr/local/bin ?) and find all the tools installed at the same time. As an example, this is what happens on my Linux machine (to give you an idea):
$ which gcc
/usr/bin/gcc
$ cd /usr/bin
$ ls -li *gcc*
189389 -rwxr-xr-x 2 root root 268088 Dec 6 2011 gcc
195145 -rwxr-xr-x 1 root root 2018 Aug 16 2010 gccmakedep
189389 -rwxr-xr-x 2 root root 268088 Dec 6 2011 x86_64-redhat-linux-gcc
I would then remove gcc, leaving x86_64-redhat-linux-gcc as the only way of starting that compiler (they are hard linked as they share the same inode). There will be other tools as well, which you can identify by date in the same directory.
An alternative approach is to install the cross-compiler into a directory that isn't in your $PATH.

Angr installation failed in RPI3

I am trying to install Angr tool on Raspberry pi 3, OS Ubuntu mate 16.04. Git link Angr tool
I isolated problem while installing pyvex getting this error, git link Pyvex
running install
running bdist_egg
running build
Building libVEX
cc -Ipub -Ipriv -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-declarations -Wwrite-strings -Wformat -Wformat-security -std=gnu99 -fstrict-aliasing -fPIC -g -malign-double -o auxprogs/genoffsets auxprogs/genoffsets.c
cc: error: unrecognized command line option ‘-malign-double’
Makefile-gcc:72: recipe for target 'pub/libvex_guest_offsets.h' failed
make: *** [pub/libvex_guest_offsets.h] Error 1
error: Unable to build libVEX.
-malign-double is for X86 architecture as per GCC documentation but i have arm architecture. How do I fix this issue.
During build PyVEX downloads VEX. I think you have to download it yourself, fix Makefile and build. Then return to building PyVEX.
Report the problem to the angr team.

Resources