Newbie question systemc

A

Aarul Jain

Guest
Hello

I am trying to learn systemc. Systemc was already installed in one of
the servers and I am using Solaris 2.8 with gcc 3.3

I am trying to run example programs from the installation directory.
However when I run make i get error message

-------compiles the code and generates .o --------
----
g++ -I. -I.. -I/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/include
-L. -L.. -L/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2
-o run.x source.o sink.o fft.o main.o -lsystemc -lm 2>&1 | c++filt
Undefined first referenced
symbol in file
CoolLog::CoolLog[in-charge](char const*, char*,
bool)/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2/libsystemc.a(sc_main.o)
ld: fatal: Symbol referencing errors. No output written to run.x
collect2: ld returned 1 exit status

I tried to do everything I could but it seems there is some problem in
makefiles.

Following are the makefiles I used.

Makefile

TARGET_ARCH = gccsparcOS5

CC = g++
OPT = -O3
DEBUG = -g
OTHER = -Wall
EXTRA_CFLAGS = $(OPT) $(OTHER)
# EXTRA_CFLAGS = $(DEBUG) $(OTHER)

MODULE = run
SRCS = source.cpp sink.cpp fft.cpp main.cpp
OBJS = $(SRCS:.cpp=.o)

include ../Makefile.defs


Makefile.defs

## Variable that points to SystemC installation path
SYSTEMC = /_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8


INCDIR = -I. -I.. -I$(SYSTEMC)/include
LIBDIR = -L. -L.. -L$(SYSTEMC)/libS/gcc-3.2.2

LIBS = -lsystemc -lm $(EXTRA_LIBS)


EXE = $(MODULE).x

..SUFFIXES: .cc .cpp .o .x

$(EXE): $(OBJS) $(SYSTEMC)/libS/gcc-3.2.2/libsystemc.a
$(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(LIBS) 2>&1 |
c++filt

..cpp.o:
$(CC) $(CFLAGS) $(INCDIR) -c $<

..cc.o:
$(CC) $(CFLAGS) $(INCDIR) -c $<

clean::
rm -f $(OBJS) *~ $(EXE) core

ultraclean: clean
rm -f Makefile.deps

Makefile.deps:
# $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.deps

#include Makefile.deps


Please help somebody, bu mailing me a running code or suggesting any
modifications to this code.
 
aaruljain@gmail.com (Aarul Jain) wrote in
news:15891236.0409130014.5e7a0662@posting.google.com:

Hello

I am trying to learn systemc. Systemc was already installed in one of
the servers and I am using Solaris 2.8 with gcc 3.3

I am trying to run example programs from the installation directory.
However when I run make i get error message

-------compiles the code and generates .o --------
----
g++ -I. -I..
-I/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/include -L. -L..
-L/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2 -o
run.x source.o sink.o fft.o main.o -lsystemc -lm 2>&1 | c++filt
Undefined first referenced
symbol in file
CoolLog::CoolLog[in-charge](char const*, char*,
bool)/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2/li
bsystemc.a(sc_main.o) ld: fatal: Symbol referencing errors. No output
written to run.x collect2: ld returned 1 exit status

I tried to do everything I could but it seems there is some problem in
makefiles.

Following are the makefiles I used.

Makefile

TARGET_ARCH = gccsparcOS5

CC = g++
OPT = -O3
DEBUG = -g
OTHER = -Wall
EXTRA_CFLAGS = $(OPT) $(OTHER)
# EXTRA_CFLAGS = $(DEBUG) $(OTHER)

MODULE = run
SRCS = source.cpp sink.cpp fft.cpp main.cpp
OBJS = $(SRCS:.cpp=.o)

include ../Makefile.defs


Makefile.defs

## Variable that points to SystemC installation path
SYSTEMC = /_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8


INCDIR = -I. -I.. -I$(SYSTEMC)/include
LIBDIR = -L. -L.. -L$(SYSTEMC)/libS/gcc-3.2.2
Hello:

Try to use gcc 3.2 instead 3.3

Regards

Javier Castillo
jcastillo@opensocdesign.com
www.opensocdesign.com


LIBS = -lsystemc -lm $(EXTRA_LIBS)


EXE = $(MODULE).x

.SUFFIXES: .cc .cpp .o .x

$(EXE): $(OBJS) $(SYSTEMC)/libS/gcc-3.2.2/libsystemc.a
$(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(LIBS) 2>&1 |
c++filt

.cpp.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

.cc.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

clean::
rm -f $(OBJS) *~ $(EXE) core

ultraclean: clean
rm -f Makefile.deps

Makefile.deps:
# $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.deps

#include Makefile.deps


Please help somebody, bu mailing me a running code or suggesting any
modifications to this code.
 
I was finally able to compile the code. But when i tried to run the
code I got the following message,

--> run.x
ld.so.1: run.x: fatal: relocation error: file run.x: symbol cerr:
referenced symbol not found
Killed
Exit 137


Does anyone have a clue to what must have gone wrong.

The code compiled successfully as
--> gmake -f Makefile.gcc
g++ -O3 -Wall -I. -I.. -I../../../include -c display.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c numgen.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c main.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage1.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage2.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage3.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -L. -L..
-L../../../lib-gccsparcOS5 -o run.x display.o numgen.o main.o stage1.o
stage2.o stage3.o -lsystemc -lm 2>&1 | c++filt

Regards
AARUL JAIN


Javier Castillo <jcastillo@opensocdesign.com> wrote in message news:<Xns95645803872B9jcastilloopensocdesi@193.147.184.15>...
aaruljain@gmail.com (Aarul Jain) wrote in
news:15891236.0409130014.5e7a0662@posting.google.com:

Hello

I am trying to learn systemc. Systemc was already installed in one of
the servers and I am using Solaris 2.8 with gcc 3.3

I am trying to run example programs from the installation directory.
However when I run make i get error message

-------compiles the code and generates .o --------
----
g++ -I. -I..
-I/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/include -L. -L..
-L/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2 -o
run.x source.o sink.o fft.o main.o -lsystemc -lm 2>&1 | c++filt
Undefined first referenced
symbol in file
CoolLog::CoolLog[in-charge](char const*, char*,
bool)/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2/li
bsystemc.a(sc_main.o) ld: fatal: Symbol referencing errors. No output
written to run.x collect2: ld returned 1 exit status

I tried to do everything I could but it seems there is some problem in
makefiles.

Following are the makefiles I used.

Makefile

TARGET_ARCH = gccsparcOS5

CC = g++
OPT = -O3
DEBUG = -g
OTHER = -Wall
EXTRA_CFLAGS = $(OPT) $(OTHER)
# EXTRA_CFLAGS = $(DEBUG) $(OTHER)

MODULE = run
SRCS = source.cpp sink.cpp fft.cpp main.cpp
OBJS = $(SRCS:.cpp=.o)

include ../Makefile.defs


Makefile.defs

## Variable that points to SystemC installation path
SYSTEMC = /_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8


INCDIR = -I. -I.. -I$(SYSTEMC)/include
LIBDIR = -L. -L.. -L$(SYSTEMC)/libS/gcc-3.2.2
Hello:

Try to use gcc 3.2 instead 3.3

Regards

Javier Castillo
jcastillo@opensocdesign.com
www.opensocdesign.com



LIBS = -lsystemc -lm $(EXTRA_LIBS)


EXE = $(MODULE).x

.SUFFIXES: .cc .cpp .o .x

$(EXE): $(OBJS) $(SYSTEMC)/libS/gcc-3.2.2/libsystemc.a
$(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(LIBS) 2>&1 |
c++filt

.cpp.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

.cc.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

clean::
rm -f $(OBJS) *~ $(EXE) core

ultraclean: clean
rm -f Makefile.deps

Makefile.deps:
# $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.deps

#include Makefile.deps


Please help somebody, bu mailing me a running code or suggesting any
modifications to this code.
 
Got it. Got help from systemc.org

Needed to include the path of libstdc++ to LD_LIBRARY_PATH


aaruljain@gmail.com (Aarul Jain) wrote in message news:<15891236.0409200122.52291b5b@posting.google.com>...
I was finally able to compile the code. But when i tried to run the
code I got the following message,

--> run.x
ld.so.1: run.x: fatal: relocation error: file run.x: symbol cerr:
referenced symbol not found
Killed
Exit 137


Does anyone have a clue to what must have gone wrong.

The code compiled successfully as
--> gmake -f Makefile.gcc
g++ -O3 -Wall -I. -I.. -I../../../include -c display.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c numgen.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c main.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage1.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage2.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -c stage3.cpp
g++ -O3 -Wall -I. -I.. -I../../../include -L. -L..
-L../../../lib-gccsparcOS5 -o run.x display.o numgen.o main.o stage1.o
stage2.o stage3.o -lsystemc -lm 2>&1 | c++filt

Regards
AARUL JAIN


Javier Castillo <jcastillo@opensocdesign.com> wrote in message news:<Xns95645803872B9jcastilloopensocdesi@193.147.184.15>...
aaruljain@gmail.com (Aarul Jain) wrote in
news:15891236.0409130014.5e7a0662@posting.google.com:

Hello

I am trying to learn systemc. Systemc was already installed in one of
the servers and I am using Solaris 2.8 with gcc 3.3

I am trying to run example programs from the installation directory.
However when I run make i get error message

-------compiles the code and generates .o --------
----
g++ -I. -I..
-I/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/include -L. -L..
-L/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2 -o
run.x source.o sink.o fft.o main.o -lsystemc -lm 2>&1 | c++filt
Undefined first referenced
symbol in file
CoolLog::CoolLog[in-charge](char const*, char*,
bool)/_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8/libS/gcc-3.2.2/li
bsystemc.a(sc_main.o) ld: fatal: Symbol referencing errors. No output
written to run.x collect2: ld returned 1 exit status

I tried to do everything I could but it seems there is some problem in
makefiles.

Following are the makefiles I used.

Makefile

TARGET_ARCH = gccsparcOS5

CC = g++
OPT = -O3
DEBUG = -g
OTHER = -Wall
EXTRA_CFLAGS = $(OPT) $(OTHER)
# EXTRA_CFLAGS = $(DEBUG) $(OTHER)

MODULE = run
SRCS = source.cpp sink.cpp fft.cpp main.cpp
OBJS = $(SRCS:.cpp=.o)

include ../Makefile.defs


Makefile.defs

## Variable that points to SystemC installation path
SYSTEMC = /_TOOLS_/dist/systemc-2.0.1/sparc-sun-solaris2.8


INCDIR = -I. -I.. -I$(SYSTEMC)/include
LIBDIR = -L. -L.. -L$(SYSTEMC)/libS/gcc-3.2.2
Hello:

Try to use gcc 3.2 instead 3.3

Regards

Javier Castillo
jcastillo@opensocdesign.com
www.opensocdesign.com



LIBS = -lsystemc -lm $(EXTRA_LIBS)


EXE = $(MODULE).x

.SUFFIXES: .cc .cpp .o .x

$(EXE): $(OBJS) $(SYSTEMC)/libS/gcc-3.2.2/libsystemc.a
$(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(LIBS) 2>&1 |
c++filt

.cpp.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

.cc.o:
$(CC) $(CFLAGS) $(INCDIR) -c $

clean::
rm -f $(OBJS) *~ $(EXE) core

ultraclean: clean
rm -f Makefile.deps

Makefile.deps:
# $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.deps

#include Makefile.deps


Please help somebody, bu mailing me a running code or suggesting any
modifications to this code.
 

Welcome to EDABoard.com

Sponsor

Back
Top