I've mostly used languages with simple IDEs until now, so I don't have the best knowledge of compiling and running git and cmake and everything else through command line. I need to use Pytorch for a project though, so it's necessary to use those skills. I'm installing it according to the tutorial for windows found here:
https://caffe2.ai/docs/getting-started.html?platform=windows&configuration=compile
I've gotten to the point where I'm running build_windows.bat, but I'm getting this output with an error from the Developer Command Prompt.
The system cannot find the drive specified.
Requirement already satisfied: pyyaml in g:\programs\python27\lib\site-packages (3.13)
CAFFE2_ROOT=G:\Programs\Caffe2\pytorch\scripts\..
CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
CMAKE_BUILD_TYPE=Release
-- Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error at CMakeLists.txt:6 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 9/25/2018 4:20:32 PM.
Project "G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" on node 1 (default targets).
G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" (default target) (1) ->
G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.15
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "G:/Programs/Caffe2/pytorch/build/CMakeFiles/CMakeOutput.log".
"Caffe2 building failed"
The CMakeOutput.log file only contains this:
The system is: Windows - 10.0.17134 - AMD64
Which isn't very useful. I'm not sure what I'm doing wrong here.
If you just need to test or experiment with pytorch I suggest that you first try to install it through the pip package. It is much easier.
If you really need to install it from source, then I suggest that you read the build_windows.bat file to check that it really suits your configuration and modify it if needed. Make sure you are targeting the correct Visual Studio version for example.
The error you are getting doesn't seem to come from the pytorch project itself.
Related
I'm re-posting an issue from github (https://github.com/libffi/libffi/issues/538) I had since last week.
I'm currently having issue getting some JNA libraries built as jar deployables using Ant build script (FYI: https://github.com/thepaul/libjna-java). in order to use the APIs from this library for my other project. (The sole purpose of me going through the hassle building it is to be able to use its API. Due to lack of documentation and absence of existing build artifact provided, I had to do it myself. Importing the whole libjna repo as a project into my other project maybe another approach but I don't think it's appropriate. That said, if there're any better ways to use the libraries in libjna, do let me know!)
So here's what I did trying to build it into deployable jar file:
I already have the source project downloaded.
Tried to compile using Ant (which I downloaded the latest version) on cygwin. Failed because it requires libffi.
So I downloaded libffi source from here (https://github.com/libffi/libffi).
Tried to compile again using Ant. Failed because it couldn't find "/c/Program Files (x86)/Microsoft Visual Studio 9.0/vc/bin/cl" as mentioned in the config.log
So I inspected cc.sh and found that it refers to an older version of Microsoft Visual Studio. I have an existing installation of Visual Studio Express. So I changed the path to "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64" in cc.sh file.
Tried to complile again using Ant. Seemed the fix worked but failed with different error because it couldn't find "mspdbcore.dll". I found this file in "..\x86" so I copy the file across to ..\x64
Tried to compile again using Ant. Failed with similar error but different file because it couldn't find "mspdb140.dll". I found this file in "..\x86" so I copied over
Tried to compile again. Failed with different error because now it says
"LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'"
, although I could confirm this file is definitely in "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64"
To tackle this error I tried (in vain):
adding microsoft visual studio paths to PATH
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64
C:\Program Files (x86)\Microsoft Visual
Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\Common7\IDE
Downloaded MS Visual Studio 2019 both Community and Professional (couldn't find those dlls for some reason)
Downloaded both mspdb140.dll and mspdbcore.dll separately, config.log says it can't find these files
Note I also did some research online, however:
I don't use visual studio IDE as I"m only trying to build it with Ant, so this post didn't really help much (LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib')
I don't really understand the answer to this post either (https://social.msdn.microsoft.com/Forums/en-US/cbedc1ba-c50b-499e-aa2e-12b0ce6a40ba/lnk1104-cannot-open-file-libcmtlib?forum=vclanguage)
So this is where I'm stuck.
See latest config log attached.
config.log
Also Ant build log attached.
ant_compile_error.txt
Anyone can help would be much appreciated!
Cheers
Dale
Hi i am trying to use cmake with visual studio 2015 and following a tutorial https://developer.codeplay.com/products/computecpp/ce/guides/getting-started.
It works well my files are generated and transferred to build folder but after that [>make] commands gives an error that [make *** no targets specified and no makefile found. stop]
Although i am using right generator visual studio 2014. I have gcc and mingw64 installed and paths are also set but i still get this error. If someone can help i will be thankfull
I tried to just find a lua rocks library made for lua 5.3 first of all so I come across mathx, I have no idea what this library really does I just wanted to test luarocks installation is working correctly. Everything seems to be working fine but what I believe now in windows by default it is currently looking for cl.exe, in visual studio 2017 I have this file located at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe
However setting this directory in the path does not allow me to initiate the command in eithe command prompt of 'cl'
When installing from lua command prompt:
C:\Users\MYNAMEHERE>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c 'cl' is not recognised as an internal or external command, operable program or batch file.
Error: Build error: Failed compiling object lmathx.obj
When installing from visual studio 2017 command prompt:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>luarocks install lmathx Installing luarocks.org/lmathx-20150624-1.src.rock cl /nologo /MD /O2 -c -Folmathx.obj -IC:/lua/include lmathx.c lmathx.c link -dll -def:mathx.def -out:mathx.dll C:/lua/lua53.dll lmathx.obj Microsoft (R) Incremental Linker Version 14.10.25019.0 Copyright (C) Microsoft Corporation. All rights reserved.
C:\lua\lua53.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x430
Error: Build error: Failed compiling module mathx.dll
I think my macbook is doing similar but I will have to look at that another day so I am putting that aside for now.
The module I have tried to install above is: luarocks.org/modules/ignacio/lmathx
C:\Users\MYNAMEHERE>luarocks install luai Installing luarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11)
I have managed to get one module installed: luarocks.org/modules/cschen1205/luai
which gave the following output in normal windows command prompt after typing: luarocks install luai
C:\Users\MYNAMEHERE>luarocks install luai Installing zluarocks.org/luai-1.0-2.src.rock luai 1.0-2 is now installed in C:\lua\systree (license: MIT/X11)
However I was struggling to get any lua code to test this even on there github for it.
I am left stumped overall either I can't get windows to pick up the visual studio 2017 compiler to build luarocks files (Please note I do have C:\MinGW installed as a portable version as well with c and c++ compiler in there of gcc but this is already set in path, I can use this instead if vs studio 2017 is to new to work but how to default lua rocks to mingw gcc rather than cl.exe to build libraries????) or something installs then I am struggling to find out how its installed (not from source, presumed though???)or sample code to check such a luarock has installed.
I'm trying to compile some netmf firmware using MSBUILD with Yagarto. I'm doing it on a machine with VS2012 and all the right pre-requisites installed. From a command prompt as administrator, I go to the NetMF Porting Kit folder, where all the source code lives, I call setenv_gcc.cmd 4.6.0 c:\yagarto46
Doing so yields two warnings:
WARNING: Count not find vsvars32.bat
WARNING: VISUAL C++ DOES NOT APPEAR TO BE
INSTALLED ON THIS MACHINE.
When I try the above command from VS2012 Developer Command Prompt as Administrator I get the following ERROR
ERROR: Cannot determine the location of the VS Common Tools folder.
I've done the path modifications in Environment System Variables with no luck.
Thanks!
VS2010 command prompt gives error : Cannot determine the location of the VS Common Tools folder
I modified the vsvars32.bat file in the vs11 and vs10 folders accordingly and the error went away... Now onto eliminating my build errors....
Recently I am trying to compile the source code of FFTW in Visual studio 2010. I followed the instruction from the FFTW website. I downloaded the source code fftw-3.3.2.zip and corresponding vs 2010 package fftw-3.3-libs-visual-studio-2010.zip.
I got four projects from the solution, bench, benchf, libfftw-3.3, libfftwf-3.3
But on compiling I got following errors on each of the project:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform toolset (Windows7.1SDK) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
which points to the following content
I have tried the debug/release build for both x64 and win32, none of them worked.
Could anyone please help me on this?
It seems that it can be solved without installing the Windows 7.1 SDK
Right click on the 'libfftw-3.3' project and selected properties
Go to Configuration Properties -> General
Switch 'Platfrom Toolset' from 'Windows7.1SDK' to 'v100'
Recompile
Works for the projects 'libfftwf-3.3' and 'libfftw-3.3'
The project 'bench' and 'benchf' are failing to build:
fatal error C1083: Cannot open source file: '....\libbench2\aligned-main.c': No such file or directory
Can be solved by removing the aligned-main.c from both projects.
You can also use CMake - I created this CMake file for fftw-3.3.2 which I tested with Visual Studio 2010 x64:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/CMakeLists.txt?at=default
You also need this config.h file:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/config.h?at=default
It looks like you need to install the Windows 7.1 SDK, if you have already installed it, try reinstalling it incase it is corrupted.
You can download the 7.1 SDK from http://www.microsoft.com/en-us/download/details.aspx?id=8279