Could not build gem5 on a machine with anaconda: "lto1: fatal error: bytecode stream" - gcc

When I tried to build gem5 with command scons build/X86/gem5.opt -j12, I received an error message saying
lto1: fatal error: bytecode stream in file '/home/beihai/anaconda3/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a' generated with LTO version 6.0 instead of the expected 8.1
I think it might be the problem of wrong gcc version. But I do not know how to fix it.
My system is Kubuntu 20.04
By running gcc -v, I got the global gcc version gcc version 9.3.0
By running /home/beihai/anaconda/envs/gem5build/bin/x86_64-conda_cos6-linux-gnu-gcc -v, I got the anaconda gcc version gcc version 7.3.0 (crosstoll-NG 1.23.0.449-a04d0)
Please tell me how to fix this problem.

I came across almost the same issue, except that mine said "LTO version 6.0 instead of the expected 6.2".
I searched for general solution for LTO compatibility issue and got some inspiration from this link: https://github.com/rust-lang/rust/issues/57176
Quick take from the above link: "I've looked into how this is related to python and found that the error only happens with python installed through anaconda."
So I removed my entire anaconda software package, and removed the build directory inside Gem5, and rerun the scon commands with an additional "--force-lto" arguments, now the installation is successful. Hope it can solve your issue as well.
The command I used: "scons --force-lto build/X86/gem5.opt -j6"
My setups is:
Ubuntu 18 withe kernel 4.15.0-134-generic
g++ --version = g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

Related

Switching GCC version to use on macbook M1

I received this error when I tried to compile by gcc 11.x and run some code on my Macbook Pro M1
E ImportError: dlopen(/Users/giangpham/VSCode/rpxdock/rpxdock/bvh/bvh.cpython-37m-darwin.so, 0x0006): tried: ‘/Users/giangpham/VSCode/rpxdock/rpxdock/bvh/bvh.cpython-37m-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘arm64’, need ‘x86_64’))
I tried to install another homebrew for x86_64 architecture and install the old gcc ver 9 (which is the version recorded to have worked with the code before) following this article
I have done axbrew info gcc and it would still give out information of the 11.x gcc (axbrew info gcc#9 works and gives me info of the package. But I tried switch`` as the article suggested and it saids unknown command```). How do I switch gcc to use the older version I just installed?
Thank you!

Spin: gcc-6: unrecognized command line option

I want to use SPIN model checker on Windows 10 (64bit) and I have followed the instructions on the spin website:
I installed MinGW and gcc, updated path, and checked in the command prompt it shows version 6.3.0
I installed ActiveTCL updated path, updated path with iSpin too, I can get iSpin to open
when I try to compile pre-included example file leader.pml I get this error:
spin: preprocessing failed gcc -std=gnu99 -Wformat-overflow=0 -E -x c "leader.pml" > "pan.pre"
gcc: error: unrecognized command line option '-Wformat-overflow=0'; did you mean '-Wstrict-overflow='?
I don't understand the error, does someone know what is missing?
The error says exactly what the problem is: -Wformat-overflow=0 is not a recognized command line option.
Not that you are using MinGW GCC 6.3.0, which is very old.
Consider using MinGW-w64 which is much more recent. Currently GCC 11.2.0 is the latest version. You can find a standalone build at https://winlibs.com/
So please try with a newer GCC. If it still does't work run gcc --help -v to see all command line options.

how to remedy mno cygwin error?

I'm working on compiling a library in windows with GCC and Make.
When I run make, I get the following error:
unrecognized command line option '-mno-cygwin'
I saw this post on SO, but it doesn't necessarily seem like the same issue, and I don't understand how to downgrade my system to a version of GCC (or Make) that supports the flag I need to use in order to compile.
Could someone please try to point me in the right direction, or if you've run into this problem offer a solution?
I'm running Windows 8.1 pro, GCC 5.4.0, make 4.2.1.
I can post more info if it is necessary to help me.
The current cygwin gcc compiles only for cygwin itself.
-mno-cygwin is an obsolete flag from gcc 3.x time that allowed the cygwin compiler to compile mingw (not cygwin) programs.
The switch was removed long time ago and true cross compilers
mingw64-x86_64-gcc-core
mingw64-i686-gcc-core
cygwin-mingw
were made available
Latest update:
https://sourceware.org/ml/cygwin-announce/2016-11/msg00020.html

run using KLEE error

I am new to Klee, so I started to make the tutorials.
If for compilation I use:
llvm-gcc --emit-llvm -c -g get_sign.c and then I try to run using klee get_sign.o I get the error : KLEE: ERROR: error loading program 'get_sign.o': Invalid MODULE_CODE_GLOBALVAR record . The error is defined in the BitcodeReader.cpp file http://llvm.org/docs/doxygen/html/BitcodeReader_8cpp_source.html at line 01594.
clang (that I have used succesfully for my LLVM passes), it appears that is not possible to use it: KLEE: ERROR: error loading program 'get_sign.o': Invalid bitcode signature .
Do you know what I can do?
Also, it would be nice to give Klee inputs compiled with Clang that I already use for my passes, but as the error suggest, it is possible?
Thank you in advance !
The problem is that I installed Klee over LLVM 3.1. In the instructions from http://klee.llvm.org/GetStarted.html it is mentioned that Klee is fully compatible with LLVM 2.9. It is mentioned : "KLEE is currently tested only on Linux x86-32 and x86-64 targets, using LLVM 2.9. KLEE will not work with older LLVM versions (e.g., 2.5), and might not work with newer versions (e.g., 3.0).".
I installed Klee on LLVM 2.9 and it is working perfectly.

Ada compiler not installed on this system error after make in Fedora 16

I installed gcc 4.3.4 fine one fedora16 but my problem is to run ada program got error Ada compiler not installed on this system. I think it crashes because of installed old version of gcc on gcc 4.6.3. How to overcome this problem?
Thanks in advance
It is absolutely no problem to install multiple version of gcc. The problem is that the Ada compiler gnat depends on a specific gcc, e.g., gnat-4.x depends on gcc-4.x-
The file /usr/bin/gcc should be a symlink to the default gcc. Changing the symlink to
the proper gcc (/usr/bin/gcc-4.6) can fix your problem.
^^^^^^^
proper gcc for gnat-4.6
If changing the symling does not work, reinstall (remove+install) the Ada compiler (gnat) again.

Resources