libmir / mir-cpuid

BetterC CPU Identification Routines
http://mir-cpuid.libmir.org
26 stars 8 forks source link

Trouble building mir-cpuid on Windows 7 #31

Closed jmh530 closed 6 years ago

jmh530 commented 7 years ago

I tried following the instructions on the mir-glas page to build mir-cpuid on Windows 7.

I have ldc 1.2.0 installed and Microsoft Visual Studio 2017 Community installed. However, when I run the code (with or without the --arch statement), then I get the result below. At the "Warning: Unknown switch 'out' in command line, ignored." part I just hit enter to continue.

If I change --compiler=dmd, then it builds with no errors.

C:\ProgrammingFiles\DFiles\dubFolder\mir-cpuid-0.5.2>dub build --build=release-n obounds --compiler=ldmd2 --build-mode=singleFile --parallel --force --arch=x86_6 4 The determined compiler type "ldc" doesn't match the expected type "dmd". This w ill probably result in build errors. Performing "release-nobounds" build using ldmd2 for x86_64. mir-cpuid 0.5.2: building configuration "library"... Compiling source\cpuid\amd.d... Compiling source\cpuid\amd.d... Compiling source\cpuid\common.d... Compiling source\cpuid\intel.d... Compiling source\cpuid\unified.d... Compiling source\cpuid\x86_any.d... Linking... Using Visual C++: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC The specified configuration type is missing. The tools for the configuration might not be installed. Digital Mars Librarian Version 8.02n Copyright (C) Digital Mars 2000-2007 All Rights Reserved http://www.digitalmars.com/ctg/lib.html Warning: Unknown switch 'out' in command line, ignored. list file (.lst) output library file (.lib)

Warning: 'release.obj' not found, can't delete or extract it Warning: 'nobounds.obj' not found, can't delete or extract it Warning: 'windows.obj' not found, can't delete or extract it Warning: 'x86_64.obj' not found, can't delete or extract it Warning: 'ldc_2072.obj' not found, can't delete or extract it Warning: '627BF58E3EFA637A1F171B259BC1D9E6\mir.obj' not found, can't delete or e xtract it Warning: 'cpuid.lib' not found, can't delete or extract it

Error: .dub\build\library.obj : No such file or directory Error: C:\Windows\system32\cmd.exe /s /c "C:\D\ldc\ldc2-1.2.0-win64-msvc\bin\am d64.bat lib.exe" failed with status: 1 ldmd2 failed with exit code 1.

9il commented 7 years ago

@jmh530 What compiler version?

jmh530 commented 7 years ago

I was using ldc 1.2.0. I was originally having an issue because mine was too old to recognize Visual Studio 2017 Community. While the newer version recognized it, it still had issues.

I could check my dmd version later if that matters. I think it was the latest (2.074.1), but not entirely sure.

9il commented 7 years ago

I have not windows. Please report new issues too

jmh530 commented 7 years ago

It was D 2.74.0 and dub 1.3.0. I will report any other issues I find.

On Thu, Jun 22, 2017 at 8:58 PM, Ilya Yaroshenko notifications@github.com wrote:

I have not windows. Please report new issues too

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libmir/mir-cpuid/issues/31#issuecomment-310541567, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJWyvxYE57oQ7JyE9KpsPFagBnDPbIEks5sGw22gaJpZM4N__W_ .

9il commented 7 years ago

I was using ldc 1.2.0. I was originally having an issue because mine was too old to recognize Visual Studio 2017 Community. While the newer version recognized it, it still had issues.

Do you mean you have the same issue or you have another issue with the same compiler?

jmh530 commented 7 years ago

I was originally using an earlier version of ldc that had not revognized Visual Studio 2017. I upgraded to ldc 1.2.0 and I still had the issue.

On Sat, Jun 24, 2017 at 1:36 AM, Ilya Yaroshenko notifications@github.com wrote:

I was using ldc 1.2.0. I was originally having an issue because mine was too old to recognize Visual Studio 2017 Community. While the newer version recognized it, it still had issues.

Do you mean you have the same issue or you have another issue with the same compiler?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libmir/mir-cpuid/issues/31#issuecomment-310815984, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJWyqEuQ2DGp4XISx_whLCCRQDBwuvCks5sHKB0gaJpZM4N__W_ .

jmh530 commented 7 years ago

TLDR: You might consider adding to the readme that Windows users with Visual Studio 2017 will need ldc2-1.3.0 to run the mir-cpuid command. This may also need to get added to the mir-cpuid project readme.md.

I just playing around with it again and noticed that it says "Using Visual C++: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC". When I look at my Program Files (x86) folder, I see Visual Studio 2017, 9, 11, 12, and 14. So it seems to be taking 12, but the latest.

I did some googling and found it was related to the following issue: https://github.com/ldc-developers/ldc/issues/2134

I went into the file they mention and noticed that it was only referring to Visual Studio 12. So I downloaded ldc2-1.3.0-beta2-win64-msvc, changed the environment path, and ran the code again and it worked just fine.

9il commented 6 years ago

@jmh530 What is tha status if this issue, should it be still open?

9il commented 6 years ago

(may be it is already resolved?)

jmh530 commented 6 years ago

@9il I believe it is resolved and will close. I have compiled it successfully on Windows 7 using LDC 1.10.0 and mir-cpuid-0.5.3.