Compilation error

87 views
Skip to first unread message

Kapil Khanna

unread,
Feb 16, 2011, 1:23:09 PM2/16/11
to MV5sim
Hi,
I am trying to compile the mv5 simulator(make compile) and it is
giving the following error:

scons: Reading SConscript files ...
Error: Don't know what compiler options to use for your compiler.
Please fix SConstruct and src/SConscript and try again.

I've tried the following things:
installed gcc-4.3 and g++-4.3
set environment variables :
export CC=gcc-4.3
export CXX=g++-4.3

I've gcc version 4.4.3 installed on my ubuntu 10.04 system.
I've also tried :
export CC=gcc-4.4.3
export CXX=g++-4.4.3

I have m5 2.0b6 working fine on my system.

Jiayuan Meng

unread,
Feb 17, 2011, 12:42:59 AM2/17/11
to mv5...@googlegroups.com
Hi Kapil,

That seems to be a problem with scon. Can you try to locate where the error message is printed and assign the scons variable to the gcc compiler you installed? I'm sure there is such a variable in scons. 

Jiayuan

Max

unread,
Feb 22, 2011, 4:16:31 AM2/22/11
to MV5sim
Hi, I had the same issues.
I fixed it by hard coding env['GCC']=True and commenting some lines
out:
#env['GCC'] = False
env['GCC']=True
env['SUNCC'] = False
env['ICC'] = False
#env['GCC'] = subprocess.Popen(env['CXX'] + ' --version', shell=True,
# stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
# close_fds=True).communicate()[0].find('GCC') >= 0
#env['SUNCC'] = subprocess.Popen(env['CXX'] + ' -V', shell=True,
# stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
# close_fds=True).communicate()[0].find('Sun C++') >= 0
#env['ICC'] = subprocess.Popen(env['CXX'] + ' -V', shell=True,
# stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
# close_fds=True).communicate()[0].find('Intel') >= 0
if env['GCC'] + env['SUNCC'] + env['ICC'] > 1:
print 'Error: How can we have two at the same time?'
Exit(1)


However, I still have issues while compiling:
Checking for C header file Python.h... no
Error: can't find Python.h header in /usr/include/python2.6

Weird enough the file Python.h is located in /usr/include/python2.6,
so this shouldn't be a problem.
Skipping this error, leads me into a third error:
Checking for C library python2.6... no
Error: can't find Python library python2.6

Any ideas?

Thanks!
On Feb 17, 6:42 am, Jiayuan Meng <meng.jiay...@gmail.com> wrote:
> Hi Kapil,
>
> That seems to be a problem with scon. Can you try to locate where the error
> message is printed and assign the scons variable to the gcc compiler you
> installed? I'm sure there is such a variable in scons.
>
> Jiayuan
>

Jiayuan Meng

unread,
Feb 22, 2011, 10:04:54 AM2/22/11
to mv5...@googlegroups.com
Hey Max,

Thanks for posting the fix!

I'm not exactly sure what's causing the python error. Can you check whether your "PYTHONPATH" environment variable points to the right place? A quick google search also points to the installation of "sudo apt-get install python2.6-dev". Another place to check is to print "sys.path" while running the python script. 

Jiayuan

Max

unread,
Feb 23, 2011, 8:03:11 AM2/23/11
to MV5sim
Hi,

MV5 is up and running now after installing an older python version and
an older version of gcc/g++.

1) I installed python2.4. You can find instructions to do this for
ubuntu 10.04 here: http://davidjb.com/blog/2010/05/installing-python-2-4-on-ubuntu-10-04-lucid-lynx.
Make sure you replace "i386" with your architecture.
You should change the symbolic link in /usr/bin:
cd /usr/bin
sudo rm python
ln -s python2.4 python

2) Make sure you that you have ALL required software needed for M5
(http://www.m5sim.org/wiki/index.php/Compiling_M5). Like Jiayuan
mentioned, you'll need python2.X-dev.

3) Last but not least: To fix the error "Don't know what compiler
options to use for your compiler", I installed gcc-4.1 and g++-4.1.
Simply typing "export GCC=gcc-4.1" didn't work, so I changed the
symbolic links gcc and g++ in /usr/bin to these older versions of gcc
and g++:
cd /usr/bin
sudo rm gcc
sudo rm g++
ln -s g++-4.1 g++
ln -s gcc-4.1 gcc

This should work without any modification of the SConstruct file.
However, the compilation process will give you warnings and will halt
on these, even though they aren't errors. Turning off the "-Werror"
flag in the Sconstruct file will overcome this.

Regards,

Max

On Feb 22, 4:04 pm, Jiayuan Meng <meng.jiay...@gmail.com> wrote:
> Hey Max,
>
> Thanks for posting the fix!
>
> I'm not exactly sure what's causing the python error. Can you check whether
> your "PYTHONPATH" environment variable points to the right place? A quick
> google search also points to the installation of "sudo apt-get install
> python2.6-dev". Another place to check is to print "sys.path" while running
> the python script.
>
> Jiayuan
>

Kapil Khanna

unread,
Mar 6, 2011, 2:00:34 PM3/6/11
to mv5...@googlegroups.com
Hi,
Thanks Max for posting the fix.
It more or less worked for me except for the symbolic link part.

Instead of creating the symbolic links for gcc-4.1 and g++-4.1 , just modify the call as:
scons CC=gcc-4.1 CXX=g++-4.1 build/<ISA_MODE>/m5.<binary> ..
in the makefile.

for instance:
scons CC=gcc-4.1 CXX=g++-4.1 build/ALPHA_SE/m5.opt ...

It runs just fine.

Regards,
Kapil
Reply all
Reply to author
Forward
0 new messages