MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
558 stars 122 forks source link

Fixed windows build with latest sources. #880

Closed Romain-Piquois closed 4 months ago

Romain-Piquois commented 4 months ago

Hi !

Please, ignore this message if there is no need for it. I managed to build the sources on Windows but I had to fix two issues.

1/ Inside SVIntHelpers.h, if the target is x64, #include is not properly included. I think it is due to #if defined(_MSC_VER) && defined(_M_IX86) at line 43

2/ Inside Debug.h , MSVC did not like the ( , ) for VA arguments to DebugMessage and InfoMessage call in the macro. I removed the bracket and simply used ',' (comma) character instead.

Everything builds successfully after that.

Best Regards, Romain

MikePopoloski commented 4 months ago

I'm a little confused; I build on Windows locally and there's a CI job that builds for Windows as well. What are you doing differently?

Romain-Piquois commented 4 months ago

Sorry. I hope I don't waste your time :-)

I followed the instruction given by your page : https://sv-lang.com/building.html

Those command were run using the windows shell (so not using WSL or the like ) .Python3 was already installed:

Resulted in an error on my machine because I had no conan profile, so :

After that, went to /slang/build/ and opened slang.sln (visual studio solution file). And ran "Build Solution" in the IDE...

Then I had those two errors popping up. The first error resulted in not finding _addcarry_u64 and the like. I noticed that #include was indeed there, but disabled due to the false preprocessor condition in my IDE (at least that is what Intellisense is saying. I am building as x64 by default) `

if defined(_MSC_VER) && defined(_M_IX86)

`

I just shamelessly fixed the issue by adding directly #include at the top without any further consideration on my machine. (Obviously it is a hack)

Then again fixed the other error. as described earlier was also given by the compiler...

My software : Microsoft Visual Studio Community 2022, V.17.4.4

Romain-Piquois commented 4 months ago

Just adding here the result of conan profile detect, I have many different version of Visual Studio on my dev machine. (so it may have picked up another version ?) ` detect_api: Found msvc 17

Detected profile: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.version=193 os=Windows

WARN: This profile is a guess of your environment, please check it. WARN: The output of this command is not guaranteed to be stable and can change in future Conan versions. WARN: Use your own profile files for stability. `

MikePopoloski commented 4 months ago

If you don't use --preset with the cmake command then you aren't using the conan environment and it's doubtful things will work correctly, so I assume that's the problem. The conan install step tells you what prefix to use, or you can run cmake --list-presets to find it.

MikePopoloski commented 4 months ago

Closing since there has been no followup.