Closed myzinsky closed 6 months ago
One of my workaround would be to switch to pthreads/fibers. However this code in the CMAKE file prevents me of doing that:
if (WIN32 AND ENABLE_PTHREADS)
message (FATAL_ERROR "Pthreads is not supported on ${CMAKE_SYSTEM}.")
endif (WIN32 AND ENABLE_PTHREADS)
Commenting out the last 3 lines in the .s file helps:
//#if defined(__linux__) && defined(__ELF__)
//.section .note.GNU-stack,"",%progbits
//#endif
I assume that MinGW is still detected as linux
Thanks for reporting this issue and analysing the cause! We are going to look at the issue in the LWG. Could you please try to make the preprocessor condition more strict by adding !defined(__MINGW32__)
(see here and here) and report back whether this fixes the issue? If not, please provide more information on your platform (versions of Windows and MinGW, etc.).
User @moayman posted on 2020-07-15 on the SystemC forum about his effort to fix QuickThreads on Win64. He has created a branch containing the current state of his fixes, which is based on SystemC 2.3.2.
In my CMake build, I was able to fix the issue by overriding some properties before loading the SystemC library:
if (MINGW)
set(MSVC true) # SystemC tries to assemble quick threads if this isn't added
endif(MINGW)
Hello @myzinsky and @mattgately ,
What environment are you using for MinGW
setup?
I faced a similar issue recently and figured out that the issue was with my CMake setup.
I am using MSYS2
for managing my MinGW 64-bit
environment.
As it seems the environment is split between MSYS2, MinGW 64-bit, MinGW 32-bit
.
For MSYS2
and MinGW
it has separate binaries for CMake which handles the SystemC project quite differently.
For reference: cmake packages in MSYS2
In case you are using MSYS2 to manage the setup it is quite easy to fix the issue:
pacman -S mingw64/mingw-w64-x86_64-cmake
Which resolved most of the build issues in the MinGW
environment.
Note:
MinGW
cmake build one has to specify the CMake generator as "Unix Makefiles" by default it tries to configure for NMake
/MSBuild
project.CMake
Binary for MinGW/MSYS2
environment.Hope this helps.
I can confirm that it works with MSYS2, using a MINGW64 shell and the correct cmake
pacman -S mingw-w64-x86_64-cmake
as already pointed out by @AmeyaVS.
(Tested current SystemC 3.0.0)
The issue can be closed and could be re-opened if further details about the used cmake and migw system are given.
closed; could be re-opened if needed
SystemC was build with CMAKE in the context of a CMAKE project. Under Linux and macOS its works, but on windows I get this assembler error shown above. It can be fixed by using pthreads but I think qt are much better.
Any ideas to fix it?