Question on gcc version

Hi,
I want to install SystemC on Linux OPENSUSE 11.3. The configuration process does not pass now. I suspect the gcc version is a problem. Now gcc is 4.5.0 on my computer. From YaST2 search results, I find many Package on gcc. Which version gcc do you think is a reliable old version? Different gcc can live in the same Linux? Their command names are different or not? How can I select install directory? I am new to Linux and GNU gcc.

freerjw wrote:

>
> Hi,
> I want to install SystemC on Linux OPENSUSE 11.3. The configuration
> process does not pass now. I suspect the gcc version is a problem. Now
> gcc is 4.5.0 on my computer. From YaST2 search results, I find many
> Package on gcc. Which version gcc do you think is a reliable old
> version? Different gcc can live in the same Linux? Their command names
> are different or not? How can I select install directory? I am new to
> Linux and GNU gcc.
>
First question is: What makes you think the problem is the gcc version you
use? Sounds like a wild guess.

If the configuration process fails it shows you error messages. What error
messages do you see? Can you post it?

Of course you can have different gcc versions on your machine and the
commands to use them differ (gcc44 gcc43 and so on). You cannot select an
installation directory, this is not windows. Linux follows certain standards
and rules where binaries are installed. Prebuilt binaries from the linux
distro usually go to /usr/bin /usr/lib /usr/lib64 and some other relevant
folders.
Self compiled softawre will usually go to /usr/local

Did you check the requirements for systemc, does it say that it needs
certain version of compilers to be built? Are all requirements met?


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram

martin_helm wrote:

> commands to use them differ (gcc44 gcc43 and so on)

Sorry a typo should be
gcc-4.4 gcc-4.3 and so on


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram

The SystemC installation once run through today, but there are several .o files with errors generated (I see them on screen). Unfortunately, I cannot repeat those now. The SystemC installation instruction mentions compiler version is a problem. On my Windows cygwin, in the end of installation, it does complain the gcc compiler 3.4 is too new. It requires gcc 3.2. From that message, I suspect Linux needs an older version too even though Linux does not complain gcc version directly.

One more question on linux, the SystemC installation says:


Next, we want to install SystemC 2.1 using our dedicated compiler. The compiler
should be in your environment search path. You can check the compiler version by
typing:
● gcc version
If your compiler was installed to another directory (let’s assume /usr/local/),
you may need to set the environment variables CXX and CC to the location of your
compiler.
According to your local shell, type
● export CXX=/usr/local/gccx.y.z/bin/g++
export CC=/usr/local/gccx.y.z/bin/gcc
or
● setenv CXX /usr/local/gccx.y.z/bin/g++
setenv CC /usr/local/gccx.y.z/bin/gcc

I just curious about the export lines. My understanding is that gcc is not on the path:

/usr/local/gccx.y.z/bin/

What’s use for the above export? Could you explain it to me? Thanks.

Do you have any specific requirement for SystemC 2.1. SystemC 2.2 has been now around for past 4-5 years and it is much better supported.

If you need help with installing SystemC 2.2, let me know and I will send you some patches to make the installation possible with gcc-4.5.

Thanks. I do have install SystemC 2.2 on my Linux. The above mentioned 2.1 is an original installation article said. For my case, in config.log it complaint:

configure:1304: checking build system type
configure:1313: error: cannot guess build type; you must specify one

Another question, the installation instruction in that article said:
export CXX=/usr/local/gccx.y.z/bin/g++
export CC=/usr/local/gccx.y.z/bin/gcc

but I do not see gcc4.5.0 on the /usr/local path. I am new to Linux. Is it a problem?
I need the patch you recommend. How do you send it to me, or how can I get it? Thanks again.

I do have installed SystemC 2.2 on my computer. SystemC 2.1 mentioned above is from an original document on the web. How do you send me the patch? I need it. Thanks again.

freerjw wrote:
>
> Another question, the installation instruction in that article said:
> export CXX=/usr/local/gccx.y.z/bin/g++
> export CC=/usr/local/gccx.y.z/bin/gcc
>
> but I do not see gcc4.5.0 on the /usr/local path. I am new to Linux. Is
> it a problem?
Usually the export commands should not be needed when gcc and gtt are in
/usr/bin but you can explicitly set it to

export CXX=/usr/bin/g++
export CC=/usr/bin/gcc

Please check before that g++ is really installed. The c++ compiler is not
automatically installed together with gcc, it is an extra package, you can
open a terminal and use

sudo zypper in gcc-c++

to install it.


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram

I had checked with g++ --version and gcc --version. Both compilers work. My SystemC installation on cygwin is success. I find the generated “config” file on objdir directory has the following message (excepted).


PATH: /cygdrive/c/Modeltech_xe_starter/win32xoem
PATH: %HOSTSDKLOC%/bin
PATH: /cygdrive/c/PROGRA~1/FICHIE~1/MUVEET~1/030625

-----------

Core tests.

-----------

configure:1304: checking build system type
configure:1322: result: i686-pc-cygwin
configure:1330: checking host system type
configure:1344: result: i686-pc-cygwin

It seems that on OPENSUSE 11.3, the first step breaks because it asks me to specify build type and the configure codes are 1304 and 1344.

Today, I install SystemC 2.2 on the /usr/local/systemc-2.2.0 directory. I find the configure stage passes. I check the config.lst file. It shows:

configure:1304: checking build system type
configure:1322: result: i686-pc-linux-gnu
configure:1330: checking host system type
configure:1344: result: i686-pc-linux-gnu

OK, this step, but make cannot pass. The system displays:

cd … && aclocal-1.6
/bin/sh: aclocal-1.6: command not found

What is the problem? I do not understand it. Thanks.

I find an automake on RPM, Yast2. After I install automake 1.11.1 on my computer, it still needs aclocal-1.6. What can I do then? Thanks.

Sorry, I find one more message popup after I enter “make”.



cd … && aclocal-1.6
/bin/sh: aclocal-1.6: command not found
make: *** …/aclocal.m4] Error 127

It helps? Thanks.

freerjw wrote:

>
> OK, this step, but make cannot pass. The system displays:
> …
> cd … && aclocal-1.6
> /bin/sh: aclocal-1.6: command not found
> …
> What is the problem? I do not understand it. Thanks.
>
Install the automake package it contains aclocal (but the default version is
meanwhile 1.11 not 1.6 which is very old, hope that is no problem, you
simply need to try it).

sudo zypper in automake

probably you will have more such errors and need to install the missing
dependencies step by step.


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram

freerjw wrote:

>
> Sorry, I find one more message popup after I enter “make”.
>
> …
> …
> cd … && aclocal-1.6
> /bin/sh: aclocal-1.6: command not found
> make: *** …/aclocal.m4] Error 127
> …
>
> It helps? Thanks.
>
>
You can try to manually replace the aclocal-1.6 in the Makefile by aclocal
and hope that 1.11 is compatible enough to the old version or as an
alternative in your home folder create a symlink

ln -s /usr/bin/aclocal ~/bin/aclocal-1.6

(not sure if that will help it is of course a crappy solution)


openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram

I find that the configure process generates two Makefile files under src/sync/kernel and src/sync/utils. After I modify the aclocal-1.6 to aclocal, the ‘make install’ runs. Unfortunately, it encounters two errors after several minutes during ‘make install’. The errors are:

…/…/…/…/src/sysc/utils/sc_utils_ids.cpp: In function ‘int sc_core::initialize()’:
…/…/…/…/src/sysc/utils/sc_utils_ids.cpp:110:36: error: ‘getenv’ is not a member of ‘std’
…/…/…/…/src/sysc/utils/sc_utils_ids.cpp:111:69: error: ‘strcmp’ was not declared in this scope

The g++ is version 4.5.0. on my computer. What can I do to solve this? Thanks.

I post the sc_utils_ids.cpp as following:

/*****************************************************************************

The following code is derived, directly or indirectly, from the SystemC
source code Copyright (c) 1996-2006 by all Contributors.
All Rights reserved.

The contents of this file are subject to the restrictions and limitations
set forth in the SystemC Open Source License Version 2.4 (the “License”);
You may not use this file except in compliance with such restrictions and
limitations. You may obtain instructions on how to receive a copy of the
License at Home - Open SystemC Initiative (OSCI). Software distributed by Contributors
under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.

*****************************************************************************/

/*****************************************************************************

sc_utils_ids.cpp – Report ids for the utils code.

Original Author: Martin Janssen, Synopsys, Inc., 2002-01-17

*****************************************************************************/

/*****************************************************************************

MODIFICATION LOG - modifiers, enter your name, affiliation, date and
changes you are making here.

  Name, Affiliation, Date:

Description of Modification:

Alex Riesen, Synopsys, Inc., 2003-02-02
ported to SystemC 2.1 exception reporting.

*****************************************************************************/

// $Log: sc_utils_ids.cpp,v $
// Revision 1.1.1.1 2006/12/15 20:31:39 acg
// SystemC 2.2
//
// Revision 1.6 2006/01/31 21:42:07 acg
// Andy Goodrich: Added checks for SC_DEPRECATED_WARNINGS being defined as
// DISABLED. If so, we turn off the /IEEE_Std_1666/deprecated message group.
//
// Revision 1.5 2006/01/24 21:59:59 acg
// Andy Goodrich: removed sc_trace_ids.h since its only message has been
// replaced by SC_ID_IEEE_1666_DEPRECATION_ message.
//
// Revision 1.4 2006/01/24 20:53:41 acg
// Andy Goodrich: added warnings indicating that use of integer ids in reports
// is deprecated. Added tracing/sc_trace_ids.h to message list.
//
// Revision 1.3 2006/01/13 18:53:11 acg
// Andy Goodrich: Added $Log command so that CVS comments are reproduced in
// the source.
//

#include “sysc/utils/sc_report.h”

namespace sc_core {
#define SC_DEFINE_MESSAGE(id,unused,text) extern const char id] = text;
#include “sysc/utils/sc_utils_ids.h”
#include “sysc/kernel/sc_kernel_ids.h”
#include “sysc/communication/sc_communication_ids.h”
#include “sysc/datatypes/bit/sc_bit_ids.h”
#include “sysc/datatypes/fx/sc_fx_ids.h”
#include “sysc/datatypes/int/sc_int_ids.h”
#undef SC_DEFINE_MESSAGE

static sc_msg_def texts] = {
#define SC_DEFINE_MESSAGE(id,n,unused)
{ (id), 0u, {0u}, 0u, {0u}, 0u, 0u, {0u}, 0, n },

#undef SC_UTILS_IDS_H
#include “sysc/utils/sc_utils_ids.h”

#undef SC_KERNEL_IDS_H
#include “sysc/kernel/sc_kernel_ids.h”

#undef SC_COMMUNICATION_IDS_H
#include “sysc/communication/sc_communication_ids.h”

#undef SC_BIT_IDS_H
#include “sysc/datatypes/bit/sc_bit_ids.h”

#undef SC_FX_IDS_H
#include “sysc/datatypes/fx/sc_fx_ids.h”

#undef SC_INT_IDS_H
#include “sysc/datatypes/int/sc_int_ids.h”

#undef SC_DEFINE_MESSAGE
};
static sc_report_handler::msg_def_items items = {
texts, sizeof(texts)/sizeof(*texts), false, 0
};

static
int initialize()
{
sc_report_handler::add_static_msg_types(&items);

// PROCESS ANY ENVIRONMENTAL OVERRIDES:

const char* deprecation_warn = std::getenv("SC_DEPRECATION_WARNINGS");
if ( (deprecation_warn!=0) && !strcmp(deprecation_warn,"DISABLE") )
{
    sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", 
        SC_DO_NOTHING);
}
return 42;

}

static int forty_two = initialize();

} // namespace sc_core

// Taf!

Hi
Those are common errors…


../../../../src/sysc/utils/sc_utils_ids.cpp:110:36: error: 'getenv' is
not a member of 'std'

You need to include cstdlib and string.h


../../../../src/sysc/utils/sc_utils_ids.cpp:111:69: error: 'strcmp' was
not declared in this scope

You need to include cstring

If you google the full error message from error… you will find what
to do.

Else use gcc4.3 and export the CC and CXX flags.

Look at this thread;
http://forums.fedoraforum.org/showthread.php?t=199153


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.24-0.2-default
up 1 day 2:44, 2 users, load average: 0.03, 0.04, 0.02
GPU GeForce 8600 GTS Silent - Driver Version: 260.19.21

Thanks. Your method really works. Although I have said that I can change the ‘aclocal-1.6’ to ‘aclocal’ in Makefile on the path objdir, the same problem (‘aclocal-1.6’) always popup in the installation process in many different subdirectories. Furthermore, there is another similar problem ‘automake-1.6’ also appears many times. So, what is your method to solve this? A patch to the installation software? Or, I guess there is an original file in the installation package saved as aclocal-1.6 and automake-1.6 although I do not find them now. The installation goes much further, but it still does not finish yet.

A more thought. I want to search string “aclocal-1.6” or “automake-1.6” on the SystemC directory and its subdirectories. On the web I find the following command, but it halt in the end with an invalid argument message.

find /path/to/dir -type f -exec grep -l yourstring {} ;

So, do you think it is possible to search for the two strings and correct it at the beginning to avoid change many new Makefile from recusive make process. And what command can find the file with those strings? Thanks.

Hi
Use fgrep to locate all the files;


fgrep -r "aclocal-1.6" *

Else check use configure --help to see if you can set the ACLOCAL
variable. The other one is is to try;


autoreconf -fi

Then run your configure command.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.24-0.2-default
up 1 day 11:17, 2 users, load average: 0.02, 0.04, 0.01
GPU GeForce 8600 GTS Silent - Driver Version: 260.19.21