JIBI3731 Posted December 14, 2019 Report Share Posted December 14, 2019 Dear fellows, I just downloaded systemc2.3.3 and when i generate the test exe (using make check) i get an error at link : undefined symbol in libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): undefined reference to `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt i had no problem to build the libs (libsystemc.a , libsysc.a, libtlm_core.a and libtlm_utils.a) but apparetnly the libsystemc.a contains unresolved reference ? i use MSYS2 with mingw64 and before building, i set the CXXFLAGS variable : CXXFLAGS='-O3 -g -Wall -Wextra -Winvalid-pch -Wno-unused-parameter --std=gnu++11' Please help me , i'm stuck 😞 Thanks in advance Best regards JB Quote Link to comment Share on other sites More sharing options...
maehne Posted December 15, 2019 Report Share Posted December 15, 2019 Building SystemC using G++ from MSYS2/MinGW-64 should work as described in the INSTALL file. To diagnose your problem, it would help if you could provide all commands, which you used to configure and build SystemC 2.3.3 and then to run the tests. Please, also provide the log file generated by configure. Did you observe any errors/warnings during the compilation of the SystemC library? You should pass in the CXXFLAGS to your configure call as described in the INSTALL file, section "SystemC Library Configuration Switches": ../configure CXXFLAGS="-DSC_OVERRIDE_DEFAULT_STACK_SIZE=0x80000" You can also try to build SystemC with the latest fixes released in its official public Git repository. You can also try to build SystemC from that repository using CMake as described in cmake/INSTALL_USING_CMAKE. Quote Link to comment Share on other sites More sharing options...
JIBI3731 Posted December 15, 2019 Author Report Share Posted December 15, 2019 Hi, I made the following : ./configure --target=mingw64 CXXFLAGS="-DSC_OVERRIDE_DEFAULT_STACK_SIZE=0x80000" then : make : OK , no compilation error error and then : make check : i get the following : make[3] : on entre dans le répertoire « /d/BOULOT/tools/SYSTEMC/NEW2/systemc-2.3.3/examples/sysc » CXX fft/fft_flpt/fft_fft_flpt_test-fft.o CXX fft/fft_flpt/fft_fft_flpt_test-main.o CXX fft/fft_flpt/fft_fft_flpt_test-sink.o CXX fft/fft_flpt/fft_fft_flpt_test-source.o CXXLD fft/fft_flpt/test.exe ../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): undefined reference to `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt(sc_core::sc_simcontext*)' ../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt(sc_core::sc_simcontext*)' ../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6713): undefined reference to `sc_core::sc_cor_pkg_qt::get_main()' ../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6713): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_core::sc_cor_pkg_qt::get_main()' collect2: error: ld returned 1 exit status I also atatched the config.log Many thanks for the support JB config.log Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted December 16, 2019 Report Share Posted December 16, 2019 Actually, it is expected that you don't have the QuickThreads package built on MinGW. As you can see from your config.log, the threading package to use is Quote --------------------------------------------------------------------- Configuration summary of SystemC 2.3.3 for x86_64-pc-mingw64 --------------------------------------------------------------------- ... Build settings: Enable compiler optimizations : yes Include debugging symbols : no Coroutine package for processes: WinFiber Enable VCD scopes by default : yes Disable async_request_update : no Phase callbacks (experimental) : no -------------------------------------------------------------------- But it seems that the source code is missing an explicit check for _WIN64 to catch the MinGW-64 case. Can you try compiling with WIN64 defined (without leading underscore): ../configure CXXFLAGS="-DWIN64" Hope that helps, Philipp Quote Link to comment Share on other sites More sharing options...
JIBI3731 Posted December 17, 2019 Author Report Share Posted December 17, 2019 Thanks Philipp I tried : ../configure CXXFLAGS="-DWIN64" --target=mingw64 but i get an error , early at compile time : make[3] : on entre dans le répertoire « /d/BOULOT/tools/SYSTEMC/NEW2/systemc-2.3.3/objdir/src/sysc » CXX kernel/sc_attribute.lo CXX kernel/sc_cor_fiber.lo ../../../src/sysc/kernel/sc_cor_fiber.cpp: In destructor 'virtual sc_core::sc_cor_fiber::~sc_cor_fiber()': ../../../src/sysc/kernel/sc_cor_fiber.cpp:72:7: error: 'PVOID' was not declared in this scope PVOID cur_fiber = GetCurrentFiber(); ^~~~~ ../../../src/sysc/kernel/sc_cor_fiber.cpp:73:22: error: 'cur_fiber' was not declared in this scope if( m_fiber != cur_fiber && this != m_pkg->get_main() ) and then other errors in cascade ..... The missing PVOID is a declaration i think in <windows.h> ?????? I keep searching .... Regards JB config.log Quote Link to comment Share on other sites More sharing options...
JIBI3731 Posted December 20, 2019 Author Report Share Posted December 20, 2019 Hi all I finally decided to go with cygwin and it worked at once, without problem the main difference i could notice is the choice of the library for threading (qt vs fiber) Regards 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.