I use cmake to generate a NMake file, everything goes fine.
I use the x64 toolsets (without Visual Studio, only the SDK), so I type nmake, but it generate a x86 build and not a x64 build.
Do you know why ? and how to force nmake to target x64 ?
Thanks
Just to share, use the following to force the x64 platform. Use this command prompt command.
VsDevCmd.bat -host_arch=amd64 -arch=amd64
Both -host_arch and -arch are mandatory !
Related
I have multiple versions of MSVC C++ build tools for the same toolset(v142) installed using Visual studio build tools. How can I set the default or preferred version of the MSVC compiler. Is there a registry or environment variable for setting this in Windows or with Cmake?
Cmake picks up the latest version and I want it to use older version for some builds. CMake does seem to have a -T parameter for toolset but in my case both versions are for toolset v142.
Please note that I do not have or intend to use Visual Studio IDE for this since I am dealing with command line builds for CI purposes.
You can pass the required version via CLI:
$ cmake ... -T v142,version=14.24
See also CMAKE_GENERATOR_TOOLSET variable.
Environment
Windows 10 version 1903, 64bit
Eigen 3.3.7
freeglut 3.2.1
Visual Studio 2015 Update 3
When I run the following cmake command to build Eigen3:
cmake -DCMAKE_CONFIGURATION_TYPES=Release -DPKG_CONFIG_EXECUTABLE=D:\3rd-parties\pkg-config.exe -DGLUT_glut_LIBRARY=D:\3rd-parties\freeglut-3.2.1\install\lib\freeglut.lib -G"Visual Studio 14 2015 Win64" ..
, Eigen3 always complains:
-- Could NOT find GLUT (missing: GLUT_glut_LIBRARY)
even though I have correctly set the GLUT_glut_LIBRARY variable. I'm sure freeglut 3.2.1 was correctly built under Release mode in VS2015 and the path is specified without any problem. So, how to have Eigen3 work with freeglut, or Eigen3 does not work with freeglut at all, but only with the old legacy GLUT? Besides, does Eigen use or depend on GLUT? If not, I may just safely ignore this error. Thank you.
When I build my project in command line, everything works fine. But when I tried to generate a .sln file for the project by running msbuild /t:SlnGen /p:Platform=x64
at the command prompt, and then click build in VS (debug, x64), I got an error saying it can't copy a dependent binary folder because it is not found. Since my project is on CBT, I have x64, x86 and Any-CPU platform settings. My project used to be built on CoreXT. My suspicion is VS build doesn't handle the output path of the dependencies correctly.
Then how can I build the solution only on x64 through VS?
Any hint will be very helpful!
Is there a way to use the cmake gui to specify a x64 build, since by default cmake on windows creates a 32-bit Visual Studio solution.
From the command line, folks say to do this:
C:\projectx\build> cmake ..\make -G "Visual Studio 10 Win64"
but how do I get to the command line arguments from the cmake windows gui?
see:
http://www.saoe.net/blog/778/
How to build x86 and/or x64 on Windows from command line with CMAKE?
cmake -G Ninja on windows specify x64
The only way I have found to do this, is to wipe the output folder, and then it lets you select Visual Studio 10 Win64 when you first configure the cmake project. Make sure you choose the correct item in the dropdown.
You can specify it during the first configure process.
After that, if you want to change the machine type you need to delete the cache with the "Delete Cache" command in the "File" menu and start the configure process again.
This will happen if you run cmake in a x64 Native Tools Command Prompt for VS 2019 for the first time (otherwise delete build folder).
I am not sure if it is possible but I want to change dnx version when dnx . run from Visual Studio Code.
Even if my current dnx version is 1.0.0-beta5-11682 coreclr Visual Studio Code runs with 1.0.0-beta4 mono
Is it possible to change default dnx version of Visual Studio Code?
dnvm use VERSION -p
where -p is persistent, you can use without it to set version just for the current session.
example
dnvm use 1.0.0-beta4
or
dnvm use 1.0.0-beta4 -p
dnvm use <runtime_version> -r <runtime> -a <architecture> -p
examples:
<runtime_version>: 1.0.0-rc1-update2 etc.
<runtime>: mono, clr, coreclr (optional)
<architecture>: x64, x86 (optional)
-p: makes the results persistent (optional)
Selecting Active:
You have to provide the Runtime version as well, if there are multiple choices for the same name. For example type the following:
dnvm use 1.0.0-beta4 -r mono
If you would have to provide Architecture as well, the following command would apply:
dnvm use 1.0.0-beta4 -r mono -arch <architecture>
where can be "x64" for example, without the quotes.
Setting Default:
dnvm alias default 1.0.0-beta5-11682 -r coreclr -arch x64
Please note that, there were a bug (about May, 2015), in which referring to a CoreClr runtime by alias was not working. I don't know if it's fixed yet, but I guess so. Source: Issue 175 about the bug.
You can either set a version in the global.json file (like so https://github.com/OmniSharp/omnisharp-roslyn/blob/master/global.json#L4) or use the combination of dnvm alias and dnvm use. OmniSharp (the C# brain used by VSCode) will first check the global.json file and then go with the default-alias. All the details can be found here: https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp/AspNet5/AspNet5Paths.cs#L45