hercules-390 / hyperion

Hercules 390
Other
251 stars 70 forks source link

CMake fail in Windows #269

Open bencz opened 5 years ago

bencz commented 5 years ago

When running cmake, it returns the error that it is not possible to download some repositories and is not finding some files

CMakeError.log CMakeOutput.log out.txt

bencz commented 5 years ago

one of the problems, is with the __uint128_t type .... MSVC compiler don't have support for this type

srorso commented 5 years ago

Hi Alexandre,

Thanks for posting the logs. They were helpful, particularly out.txt. I see that we are using the same version of Visual Studio 2017 Community Edition. I routinely build Hercules using VS2017.

The absence of the __uint128_t type will not prevent building Hercules. If the type is present, Hercules can be built to support up to 128 emulated mainframe CPUs. If absent, Hercules can be built to support up to 64 emulated processors. See the CMake build options documentation at http://hercules-390.github.io/html/CMake/buildopts.html; scroll down to MULTI-CPU for some additional information.

The logs reveal that the external packages download successfully and begin configuration. See lines 48, 68, 93, and 116 of out.txt. Configuration succeeds for SoftFloat-3a and fails for the remaining three packages.

The failure occurs because CMake cannot find sdkddkver.h. The header is not part of the downloaded packages, but rather a component of the Windows SDK being used for the build. Present code in herc_setWindowsTarget.cmake in each of the packages assumes that an SDK is installed and sdkddkver.h will be found. This did not happen on your system.

Which leads me to the following question:

Which Windows SDK is installed on your system?

On my system, there are several Windows SDKs installed, including the Windows 10 SDK normally used with Visual Studio 2017. The header sdkddkver.h can be found in my system in the following directories:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared

The last of these is the one normally used when I build Hercules using Visual Studio.

As a workaround for the moment, repeat the CMake configure step with this added CMake option:

-DWINTARGET=DIST

This option builds Hercules for a specific version of Windows (WinXP SP3 64-bit) and bypasses the search for sdkddkver.h. Hercules built for WinXP SP3 64-bit will run on newer versions of Windows. Hercules requires the Windows SDK, so if there are issues with the SDK on your system, you may get farther but the build will not likely succeed.

I may well look into updating the error handling in the CMake scripts to diagnose a missing/unreachable SDK, generate a better message, and terminate the build more gracefully.

Best Regards, Steve Orso

bencz commented 5 years ago

Hi Steve!! I found it strange, therefore, I have exactly the same SDKs as you, installed on my computer .... Anyway... using the option, "-DWINTARGET=DIST", it's worked perfectly!!!

Thanks!!

srorso commented 5 years ago

Hi Alexandre,

I would like to keep this issue open for the moment for the following reasons:

a) As a reminder to document the WINTARGET options (see more below)

b) As a placeholder to improve messaging and default selection when the default of HOST leads to a failure to find sdkddkver.h.

c) We have the same SDK installed, but CMake when run on my system can find sdkddkver.h and when run on yours does not, suggesting that my CMake scripts are depending on something that is not always true.

Could you confirm that the header sdkddkver.h is available on your system and provide the path name containing it? It could be that CMake's find_path() function needs some guidance about where to find the thing.

WINTARGET: possible option values are: DIST, WINXP364 WINVISTA WIN7 WIN8 WIN10, HOST.

Most are self-explanatory. DIST means WINXP364, HOST, the default, means whatever your host system has and everything else means build for that release. When building for a given Windows release, one may expect it to run on subsequent releases for the most part. HOST requires examination of the header sdkddkver.h on the host system. There does not seem to be much difference between the specific releases as far as Hercules is concerned, but I leave that question to smarter developers.

Obrigado!

Best Regards, Steve Orso

srorso commented 5 years ago

Hi Alexandre,

Documentation for -DWINTARGET has been added to the Hercules-390 web documentation at http://hercules-390.github.io/html/ by commit 60ae451 to repository Hercules-390/html.

See http://hercules-390.github.io/html/CMake/buildopts.html...

Best Regards, Steve Orso