ayoub Posted August 15, 2014 Report Share Posted August 15, 2014 I installed systemc-2.3.1 on Ubuntu 14.04.1. The installation appears to have gone well, "make check" passes all tests. When I try running the pipe example stand-alone I get the error listed below: ayoub@VBox:~/systemc-2.3.1/examples/sysc/pipe$ makegcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c display.cpp -o display.ogcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c main.cpp -o main.ogcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c numgen.cpp -o numgen.ogcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c stage1.cpp -o stage1.ogcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c stage2.cpp -o stage2.ogcc -g -Wall -pedantic -Wno-long-long -Werror -I. -I.. -I/usr/local/systemc-2.3.1/include -c stage3.cpp -o stage3.ogcc -g -Wall -pedantic -Wno-long-long -Werror -L. -L.. -L /usr/local/systemc-2.3.1/lib-linux -Wl,-rpath=/usr/local/systemc-2.3.1/lib-linux -o pipe.x display.o main.o numgen.o stage1.o stage2.o stage3.o -lsystemc -lm 2>&1 | c++filt/usr/bin/ld: main.o: undefined reference to symbol 'operator new(unsigned int)@@GLIBCXX_3.4'//usr/lib/i386-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusmake: *** [pipe.x] Error 1 ayoub@VBox:~/systemc-2.3.1/examples/sysc/pipe$ uname -aLinux VBox 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:49:09 UTC 2014 i686 i686 i686 GNU/Linux ayoub@VBox:~/systemc-2.3.1/examples/sysc/pipe$ g++ --versiong++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2Copyright © 2013 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Is this a real problem? Is there a fix out some where? I have seen similar c++ issues posted elswhere but no solutions. Thanks, Ayoub Quote Link to comment Share on other sites More sharing options...
apfitch Posted August 16, 2014 Report Share Posted August 16, 2014 It works OK for me. What do you have SYSTEMC_HOME and TARGET_ARCH set to? Do they match your system and SystemC install? regards Alan Quote Link to comment Share on other sites More sharing options...
ayoub Posted August 17, 2014 Author Report Share Posted August 17, 2014 I added an echo line to the make rule that does the linking to be as: 147 $(EXE): $(OBJS) $(SYSTEMC_LIB_DIR)/libsystemc.a 148 echo $(SYSTEMC_HOME) and $(TARGET_ARCH) 149 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 2>&1 | c++filt 150 @test -x $@ 151The output became (the second and third lines show the result of the echo): ayoub@VBox:~/systemc-2.3.1/examples/sysc/pipe$ makeecho /usr/local/systemc-2.3.1 and linux/usr/local/systemc-2.3.1 and linuxgcc -g -Wall -pedantic -Wno-long-long -Werror -L. -L.. -L /usr/local/systemc-2.3.1/lib-linux -Wl,-rpath=/usr/local/systemc-2.3.1/lib-linux -o pipe.x display.o main.o numgen.o stage1.o stage2.o stage3.o -lsystemc -lm 2>&1 | c++filt/usr/bin/ld: main.o: undefined reference to symbol 'operator new(unsigned int)@@GLIBCXX_3.4'//usr/lib/i386-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusmake: *** [pipe.x] Error 1 The variable do look match the systemC install as far as I can tell. The Install generated a number of files. Which one should I inspect or upload? Thanks, Ayoub Quote Link to comment Share on other sites More sharing options...
maehne Posted August 17, 2014 Report Share Posted August 17, 2014 You're using the C compiler driver gcc to compile C++ code. Therefore, the C++ standard library is not linked to your program leading to the linker error. You have to compile with g++. The default make rules use CC and CXX environment variables to respectively select the C and C++ compiler. As far as I remember, the SystemC configure script sets both environment variables for compiler selection (CC and CXX) to g++. Quote Link to comment Share on other sites More sharing options...
ayoub Posted August 18, 2014 Author Report Share Posted August 18, 2014 That change allowed it to complete the linking. However, shouldn't the install scripts normally detect which compiler to use? The install scripts did not ask me for that information. Thanks, Ayoub Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted August 19, 2014 Report Share Posted August 19, 2014 That change allowed it to complete the linking. However, shouldn't the install scripts normally detect which compiler to use? The install scripts did not ask me for that information. There is indeed an issue in the Makefile.rules file, used when compiling the examples manually. Due to some incomplete try to stay backwards-compatible with the old TLM Makefiles (which used CC instead of CXX), the Makefiles prefer CC over CXX (even for the linking) if explicitly set by the user. You should be able to fix the problem by changing all occurrences of $(CC) to $(CXX) in both examples/sysc/Makefile.rules and examples/tlm/build-unix/Makefile.rules. I'll queue up this change for a future release of the proof-of-concept simulator. Thanks for reporting, Philipp karandeep963 1 Quote Link to comment Share on other sites More sharing options...
ayoub Posted August 19, 2014 Author Report Share Posted August 19, 2014 Thank you Alan, Torsten, Philipp and all the community. Ayoub Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.