Skip to content

CMake error during build if path contains spaces #4046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NeoXtreem opened this issue Jul 29, 2019 · 4 comments
Open

CMake error during build if path contains spaces #4046

NeoXtreem opened this issue Jul 29, 2019 · 4 comments
Labels
Build Build related issue P2 Priority of the issue for triage purpose: Needs to be fixed at some point.

Comments

@NeoXtreem
Copy link
Contributor

NeoXtreem commented Jul 29, 2019

System information

  • OS version/distro: Windows 10.0.18362
  • .NET Version (eg., dotnet --info): 3.0.100

Issue

  • What did you do?
    Ran build.cmd in root folder in a VS 2019 developer command prompt.

  • What happened?
    Build failed with error:

EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\Users\micro\OneDrive - X-treem Software\Development\Repos\General\Frameworks\ML.NET\src\Native\build.proj]
-- Configuring incomplete, errors occurred!
See also "C:/Users/micro/OneDrive - X-treem Software/Development/Repos/General/Frameworks/ML.NET/bin/obj/x64.Debug/Native/CMakeFiles/CMakeOutput.log".
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:/Users/micro/OneDrive - X-treem Software/Development/Repos/General/Frameworks/ML.NET/src/Native/SymSgdNative
linked by target "MklProxyNative" in directory C:/Users/micro/OneDrive - X-treem Software/Development/Repos/General/Frameworks/ML.NET/src/Native/MklProxyNative

If I move the code to a path without spaces such as C:\Users\micro\OneDrive\ML.NET, it builds successfully. This problem was also described by another user on issue #28 and @eerhardt described the solution in his reply.

  • What did you expect?
    Build to succeed regardless of spaces in path.

Source code / logs

build.log

@artidoro
Copy link
Contributor

Could you try running build.cmd from the visual studio developer command prompt?
That fixed it for me when I encountered that error recently.

@harishsk harishsk added the P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away. label Aug 19, 2019
@NeoXtreem NeoXtreem changed the title Path error on mkllibpath parameter running build.cmd CMake error during build if path contains spaces error (MKL_LIBRARY variable not found) Oct 26, 2019
@NeoXtreem NeoXtreem changed the title CMake error during build if path contains spaces error (MKL_LIBRARY variable not found) CMake error during build if path contains spaces Oct 26, 2019
@NeoXtreem
Copy link
Contributor Author

Could you try running build.cmd from the visual studio developer command prompt?
That fixed it for me when I encountered that error recently.

I had to install the 'Desktop development with C++' workload. That resolved the issue I was having. However, I encountered another issue with CMake due to spaces in the path. I've updated this issue accordingly.

@mstfbl
Copy link
Contributor

mstfbl commented Apr 7, 2020

Hi @NeoXtreem , I have changed the name of the directory that includes a build of ML.NET, and reproduced your issue. I get the following error (notice the space in machinelearning-release 3):

EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:\Users\mubal\Documents\GitHub\machinelearning-release 3\src\Native\build.proj]
-- Configuring incomplete, errors occurred!
See also "C:/Users/mubal/Documents/GitHub/machinelearning-release 3/bin/obj/x64.Debug/Native/CMakeFiles/CMakeOutput.log".
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:/Users/mubal/Documents/GitHub/machinelearning-release 3/src/Native/SymSgdNative
linked by target "MklProxyNative" in directory C:/Users/mubal/Documents/GitHub/machinelearning-release 3/src/Native/MklProxyNative

Failed to generate native component build project!

EXEC : CMake error : The following variables are used in this project, but they are set to NOTFOUND. [C:[MY_PATH]\machinelearning-release 3\src\Native\build.proj]
C:[MY_PATH]\machinelearning-release 3\src\Native\build.proj(67,5): error MSB3073: The command ""C:[MY_PATH]\machinelearning-release 3\src\Native\build.cmd" Debug x64 --mkllibpath C:[MY_PATH]\machinelearning-release 3\packages/mlnetmkldeps\0.0.0.9\runtimes\win-x64\native" exited with code 1.

@mstfbl
Copy link
Contributor

mstfbl commented Apr 7, 2020

The issue seems to stem from this line as the path for MKL_LIBRARY is getting distorted by not adding quotes around during the usage of this path (related problem and fix). Also I'm confused what's happening here:

if /i [%1] == [--mkllibpath] ( set MKL_LIB_PATH=%2&&shift&goto Arg_Loop)

The paths of
@antoniovs1029 @harishsk any ideas?

@mstfbl mstfbl self-assigned this Apr 16, 2020
@mstfbl mstfbl added the Build Build related issue label Apr 21, 2020
@harishsk harishsk added P1 Priority of the issue for triage purpose: Needs to be fixed soon. and removed P0 Priority of the issue for triage purpose: IMPORTANT, needs to be fixed right away. labels Apr 21, 2020
@mstfbl mstfbl added P2 Priority of the issue for triage purpose: Needs to be fixed at some point. and removed P1 Priority of the issue for triage purpose: Needs to be fixed soon. labels May 19, 2020
@mstfbl mstfbl removed their assignment Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Build related issue P2 Priority of the issue for triage purpose: Needs to be fixed at some point.
Projects
None yet
Development

No branches or pull requests

5 participants