You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a clean machine, opening the solution file and building in VS fails as the Tools folder doesn't exist. Just running init-tools.cmd doesn't fix it either as it now fails with malformed AssemblyInfo.cs files.
I'm still trying to get build working from the command line (where I get mostly actionable error messages, like Install CMake) this feels like the sort of thing that discourages contributors quickly. Ideally, you should be able to clone the repo, open the solution in VS, and building immediately.
Thoughts?
The error message you got told you to run build from the root of the repo first, right?
Ah yes. Here is the error:
The tools directory [P:\machinelearning\Tools/] does not exist. Please run build in the root of the repo to ensure the tools are installed before attempting to build an individual project.
I missed the "please run build in the root". So I take it back -- the error we provide is actually actionable, provided the person can read properly :-)
This is the same experience as dotnet/corefx
Yes, but in corefx it's mostly because for us there isn't necessarily a good way to build from the IDE. Other projects (like Roslyn and ASP.NET) allow for developing/building inside the IDE. I don't see why ML.NET has to be a CLI only build experience -- they sit on top of the platform.
Other projects (like Roslyn and ASP.NET) allow for developing/building inside the IDE.
These projects don't contain native code. And even harder, building native code cross platform.
I don't see why ML.NET has to be a CLI only build experience
It isn't a CLI only build experience. It is a "build from the CLI first" experience. After you build once from the command-line, you can then use the IDE until your heart is content.
These projects don't contain native code. And even harder, building native code cross platform.
That's fair.
It isn't a CLI only build experience. It is a "build from the CLI first" experience.
I see. I got the impression that you always have to run the build.cmd from the command line. For the initial prep, do I have to run build.cmd or should it be sufficient to just run init-tools.cmd? If not, maybe we should move init-tools.cmd out of the root.
@maryamariyan once build.cmd has run from the root, is the VS experience on csproj and .vcxproj satisfactory? If so, yes. If not, please update the issue with the problem.
When you just open the .sln in Visual Studio and try to build with a clean repo, you get the error:
Severity Code Description Project File Line Suppression State
Error The tools directory [F:\git\machinelearning\Tools/] does not exist. Please run build in the root of the repo to ensure the tools are installed before attempting to build an individual project. Microsoft.ML.Core F:\git\machinelearning\Directory.Build.targets 4
Once you run build.cmd in the root of the repo, you are able to build and test in VS as expected.
when I run "build.cmd" then doing some process and then getting below error at the end.
Error:
The system cannot find the path specified.
Commencing native build of dotnet/machinelearning
Calling "D:\Git\ML\src\Native\gen-buildsys-win.bat" "D:\Git\ML\src\Native" "15 2017" x64
CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from https://www.cmake.org/download/ and ensure it is on your path.
Failed to generate native component build project!
D:\Git\ML\src\Native\build.proj(65,5): error MSB3073: The command ""D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native" exited with code 1.
Build FAILED.
D:\Git\ML\src\Native\build.proj(65,5): error MSB3073: The command ""D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:09:22.47
Command execution failed with exit code 1.
Build started 2/13/2019 9:58:24 PM.
1>Project "D:\Git\ML\build.proj" on node 1 (default targets).
1>CreateOrUpdateCurrentVersionFile:
git describe --all HEAD 2>&1
git rev-parse HEAD 2>&1
GIT Branch Name as seen by git describe: 'heads/master'
GIT Branch Name: 'master'
git show -s --format=^%%cd --date=short HEAD
RestoreProjects:
Restoring all projects...
1>Project "D:\Git\ML\build.proj" (1) is building "D:\Git\ML\Microsoft.ML.sln" (2) on node 1 (Restore target(s)).
2>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Restore:
Restoring packages for D:\Git\ML\src\Microsoft.Data.DataView\Microsoft.Data.DataView.csproj...
Restoring packages for D:\Git\ML\src\Microsoft.ML.Console\Microsoft.ML.Console.csproj...
Restoring packages for
62>BuildNativeWindows:
D:\Git\ML\src\Native\build.cmd Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native
"D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
The system cannot find the path specified.
Commencing native build of dotnet/machinelearning
Calling "D:\Git\ML\src\Native\\gen-buildsys-win.bat" "D:\Git\ML\src\Native\" "15 2017" x64
CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from https://www.cmake.org/download/ and ensure it is on your path.
Failed to generate native component build project!
1>Done Building Project "D:\Git\ML\build.proj" (default targets) -- FAILED.
62>D:\Git\ML\src\Native\build.proj(65,5): error MSB3073: The command ""D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native" exited with code 1.
62>Done Building Project "D:\Git\ML\src\Native\build.proj" (Build target(s)) -- FAILED.
CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from https://www.cmake.org/download/ and ensure it is on your path.
Is cmake on your %PATH%? From that same command prompt can you tell me what cmake --version outputs?
The issue is finally resolved now. Many thanks to @eerhardt
Now, this is for reference for future readers who might come across this link.
We are using Windows-10. Though we have downloaded CMake, but we have not set into an "Environment variable => %PATH%". After setting it, we were able to build the whole app.
As a side note, during the build, if you get an error like -
could not find any instance of visual studio.
Then follow the below steps:
1). Open Visual Studio
2). Go to Tools -> Get Tools and Features
3). In the "Workloads" tab enable "Desktop development with C++"
4). Click Modify at the bottom right.
Hi,
I tried above steps but still unable to build the solution. CMake is added in %Path% variable. Below are the steps I followed.
-Closed all Visual Studio instance( using Visual Studio 2017 version 15.9.4)
-CMake version: cmake version 3.13.4
Ran git clean-xdf.
Ran .\build.cmd from root folder (C:\My Data.net sample code\MachineLearning).
Getting below error on build command
** Visual Studio 2017 Developer Command Prompt v15.9.4
** Copyright (c) 2017 Microsoft Corporation
** Visual Studio 2017 Developer Command Prompt v15.9.4
** Copyright (c) 2017 Microsoft Corporation
[vcvarsall.bat] Environment initialized for: 'x86_x64'
Commencing native build of dotnet/machinelearning
Calling "C:\My Data.net sample code\MachineLearning\src\Native\gen-buildsys-win.bat" "C:\My Data.net sample code\MachineLearning\src\Native" "15 2017" x64
-- The C compiler identification is MSVC 19.16.27025.1
-- The CXX compiler identification is MSVC 19.16.27025.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\My Data.net sample code\MachineLearning\src\Native\build.proj]
-- Configuring incomplete, errors occurred!
See also "C:/My Data/.net sample code/MachineLearning/bin/obj/x64.Debug/Native/CMakeFiles/CMakeOutput.log".
Failed to generate native component build project!
Please set them or make sure they are set and tested correctly in the CMake files:
MKL_LIBRARY
linked by target "SymSgdNative" in directory C:/My Data/.net sample code/MachineLearning/src/Native/SymSgdNative
linked by target "MklProxyNative" in directory C:/My Data/.net sample code/MachineLearning/src/Native/MklProxyNative
EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\My Data.net sample code\MachineLearning\src\Native\build.proj]
C:\My Data.net sample code\MachineLearning\src\Native\build.proj(67,5): error MSB3073: The command ""C:\My Data.net sample code\MachineLearning\src\Native\build.cmd" Debug x64 --mkllibpath C:\My Data.net sample code\MachineLearning\packages/mlnetmkldeps\0.0.0.9\runtimes\win-x64\native" exited with code 1.
0 Warning(s)
2 Error(s)
Time Elapsed 00:02:50.82
Command execution failed with exit code 1.
After checking the folder I can see code in src\Native folder didn't build.
Can anyone please help.
Activity
maryamariyan commentedon May 4, 2018
From @eerhardt on Mar 26
The error message you got told you to run
buildfrom the root of the repo first, right?This is the same experience as
dotnet/corefxmaryamariyan commentedon May 4, 2018
From @terrajobst on Mar 26
Ah yes. Here is the error:
I missed the "please run build in the root". So I take it back -- the error we provide is actually actionable, provided the person can read properly :-)
Yes, but in corefx it's mostly because for us there isn't necessarily a good way to build from the IDE. Other projects (like Roslyn and ASP.NET) allow for developing/building inside the IDE. I don't see why ML.NET has to be a CLI only build experience -- they sit on top of the platform.
maryamariyan commentedon May 4, 2018
From @eerhardt
These projects don't contain native code. And even harder, building native code cross platform.
It isn't a CLI only build experience. It is a "build from the CLI first" experience. After you build once from the command-line, you can then use the IDE until your heart is content.
maryamariyan commentedon May 4, 2018
From @terrajobst
That's fair.
I see. I got the impression that you always have to run the
build.cmdfrom the command line. For the initial prep, do I have to runbuild.cmdor should it be sufficient to just runinit-tools.cmd? If not, maybe we should moveinit-tools.cmdout of the root.maryamariyan commentedon May 5, 2018
@eerhardt can this issue be closed?
danmoseley commentedon May 7, 2018
@maryamariyan once build.cmd has run from the root, is the VS experience on csproj and .vcxproj satisfactory? If so, yes. If not, please update the issue with the problem.
eerhardt commentedon May 8, 2018
When you just open the .sln in Visual Studio and try to build with a clean repo, you get the error:
Once you run
build.cmdin the root of the repo, you are able to build and test in VS as expected.Closing.
jstallm commentedon May 24, 2018
In order to build in the Visual Studio IDE, need to call “build.cmd” from the command line first.
DevLob-zz commentedon Nov 22, 2018
i do that but still can't build the solution
eerhardt commentedon Nov 22, 2018
What error are you getting?
DevLob-zz commentedon Nov 23, 2018
DevLob-zz commentedon Nov 23, 2018
DevLob-zz commentedon Nov 23, 2018
eerhardt commentedon Nov 23, 2018
The last 2 errors about not supporting .NET Core 3.0 shouldn't block you from building. They can be ignored.
The first screen shot you posted with 1000 errors - are you still getting those?
What does the "Output" window say when you build?
4 remaining items
Hiren161 commentedon Feb 11, 2019
when I run "build.cmd" then doing some process and then getting below error at the end.
Error:
The system cannot find the path specified.
Commencing native build of dotnet/machinelearning
Calling "D:\Git\ML\src\Native\gen-buildsys-win.bat" "D:\Git\ML\src\Native" "15 2017" x64
CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from https://www.cmake.org/download/ and ensure it is on your path.
Failed to generate native component build project!
D:\Git\ML\src\Native\build.proj(65,5): error MSB3073: The command ""D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native" exited with code 1.
Build FAILED.
D:\Git\ML\src\Native\build.proj(65,5): error MSB3073: The command ""D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native" exited with code 1.
0 Warning(s)
1 Error(s)
Time Elapsed 00:09:22.47
Command execution failed with exit code 1.
Here is the msbuild.log file
msbuild.log
Try to build Solution but getting below 57 errors

eerhardt commentedon Feb 11, 2019
Did you do that?
Check out https://github.com/dotnet/machinelearning/blob/master/docs/building/windows-instructions.md for all the prerequisites for building the repo.
Hiren161 commentedon Feb 13, 2019
Yes we have tried it
but it will not be able to build the application
we are getting below error in Cmake:


eerhardt commentedon Feb 13, 2019
@Hiren161 - can you try the following?
D:/Git/ML:> git clean -xdf> .\build.cmdDoes that succeed? If it fails, what errors does it print?
Hiren161 commentedon Feb 13, 2019
Yes, I have tried this any getting below error:
Build started 2/13/2019 9:58:24 PM.
1>Project "D:\Git\ML\build.proj" on node 1 (default targets).
1>CreateOrUpdateCurrentVersionFile:
git describe --all HEAD 2>&1
git rev-parse HEAD 2>&1
GIT Branch Name as seen by git describe: 'heads/master'
GIT Branch Name: 'master'
git show -s --format=^%%cd --date=short HEAD
RestoreProjects:
Restoring all projects...
1>Project "D:\Git\ML\build.proj" (1) is building "D:\Git\ML\Microsoft.ML.sln" (2) on node 1 (Restore target(s)).
2>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Restore:
Restoring packages for D:\Git\ML\src\Microsoft.Data.DataView\Microsoft.Data.DataView.csproj...
Restoring packages for D:\Git\ML\src\Microsoft.ML.Console\Microsoft.ML.Console.csproj...
Restoring packages for
62>BuildNativeWindows:
D:\Git\ML\src\Native\build.cmd Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native
"D:\Git\ML\src\Native\build.cmd" Debug x64 --mkllibpath D:\Git\ML\packages/mlnetmkldeps\0.0.0.7\runtimes\win-x64\native
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
The system cannot find the path specified.
Commencing native build of dotnet/machinelearning
Build FAILED.
Time Elapsed 00:10:18.74
eerhardt commentedon Feb 13, 2019
Is
cmakeon your%PATH%? From that same command prompt can you tell me whatcmake --versionoutputs?Hiren161 commentedon Feb 14, 2019
The issue is finally resolved now. Many thanks to @eerhardt
Now, this is for reference for future readers who might come across this link.
We are using Windows-10. Though we have downloaded CMake, but we have not set into an "Environment variable => %PATH%". After setting it, we were able to build the whole app.
As a side note, during the build, if you get an error like -
Then follow the below steps:
1). Open Visual Studio
2). Go to Tools -> Get Tools and Features
3). In the "Workloads" tab enable "Desktop development with C++"
4). Click Modify at the bottom right.
KislayMohan commentedon Apr 8, 2019
Hi,
I tried above steps but still unable to build the solution. CMake is added in %Path% variable. Below are the steps I followed.
-Closed all Visual Studio instance( using Visual Studio 2017 version 15.9.4)
-CMake version: cmake version 3.13.4
Getting below error on build command
Building native components...
C:\My Data.net sample code\MachineLearning\src\Native\build.cmd Debug x64 --mkllibpath C:\My Data.net sample code\MachineLearning\packages/mlnetmkldeps\0.0.0.9\runtimes\win-x64\native
** Visual Studio 2017 Developer Command Prompt v15.9.4
** Copyright (c) 2017 Microsoft Corporation
** Visual Studio 2017 Developer Command Prompt v15.9.4
** Copyright (c) 2017 Microsoft Corporation
[vcvarsall.bat] Environment initialized for: 'x86_x64'
Commencing native build of dotnet/machinelearning
Calling "C:\My Data.net sample code\MachineLearning\src\Native\gen-buildsys-win.bat" "C:\My Data.net sample code\MachineLearning\src\Native" "15 2017" x64
-- The C compiler identification is MSVC 19.16.27025.1
-- The CXX compiler identification is MSVC 19.16.27025.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\My Data.net sample code\MachineLearning\src\Native\build.proj]
-- Configuring incomplete, errors occurred!
See also "C:/My Data/.net sample code/MachineLearning/bin/obj/x64.Debug/Native/CMakeFiles/CMakeOutput.log".
Failed to generate native component build project!
Please set them or make sure they are set and tested correctly in the CMake files:
MKL_LIBRARY
linked by target "SymSgdNative" in directory C:/My Data/.net sample code/MachineLearning/src/Native/SymSgdNative
linked by target "MklProxyNative" in directory C:/My Data/.net sample code/MachineLearning/src/Native/MklProxyNative
C:\My Data.net sample code\MachineLearning\src\Native\build.proj(67,5): error MSB3073: The command ""C:\My Data.net sample code\MachineLearning\src\Native\build.cmd" Debug x64 --mkllibpath C:\My Data.net sample code\MachineLearning\packages/mlnetmkldeps\0.0.0.9\runtimes\win-x64\native" exited with code 1.
Build FAILED.
EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\My Data.net sample code\MachineLearning\src\Native\build.proj]
C:\My Data.net sample code\MachineLearning\src\Native\build.proj(67,5): error MSB3073: The command ""C:\My Data.net sample code\MachineLearning\src\Native\build.cmd" Debug x64 --mkllibpath C:\My Data.net sample code\MachineLearning\packages/mlnetmkldeps\0.0.0.9\runtimes\win-x64\native" exited with code 1.
0 Warning(s)
2 Error(s)
Time Elapsed 00:02:50.82
Command execution failed with exit code 1.
After checking the folder I can see code in src\Native folder didn't build.
Can anyone please help.
Thanks,
Kislay
eerhardt commentedon Apr 8, 2019
Just a shot a in the dark - but can you try a folder without a space in it? We've had issues with having spaces in the repo path before:
C:\My Data.net sample code\MachineLearning\try
C:\MyDataSampleCode\MachineLearning\KislayMohan commentedon Apr 9, 2019
Thanks Eric, the shot in the dark was right on spot.
Is the space in repo path obstructing CMake?
eerhardt commentedon Apr 9, 2019
Yeah, we probably have some build logic that isn't quoting the path correctly. CMake does support spaces in the path name, if you do it right.
#2925 is an example of fixing such a build logic error.
add basic autofit regression test (dotnet#28)
code migration from machinelearning-automl to machinelearning repo fe…
add basic autofit regression test (dotnet#28)