Skip to content
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

MLPack solution build error in Visual Studio 2017 #1396

Closed
VarunPai opened this issue May 17, 2018 · 8 comments
Closed

MLPack solution build error in Visual Studio 2017 #1396

VarunPai opened this issue May 17, 2018 · 8 comments

Comments

@VarunPai
Copy link

I was trying to build MLPack using Visual Studio 2017. I could successfully generate the VS solution (mlpack.sln) from CMake but I am facing these errors while building the solution.

mlpack3 0 0_vsbuilderror

I followed the instructions from this link (https://keon.io/mlpack-on-windows/) with few customizations. I used these configurations

  1. mlpack 3.0.0
  2. Visual studio 2017
  3. CMake ver 3.11.1
  4. Armadillo 8.5.0
  5. boost libraries 1.64 (used nuget)
  6. OpenBLAS (0.2.14.1) (used nuget)
    Also I have Anaconda 5.1 with python 3.6.4 installed in my machine. (Added to System Path)

Is there any idea what could be the reason for this error ? It seems that the error is from python bindings. how this could be solved ?

@zoq
Copy link
Member

zoq commented May 17, 2018

If turning the python bindings off is an option, I think this is the easiest solution for now; I'll have to take a closer look into the windows build issue.

@rcurtin
Copy link
Member

rcurtin commented May 17, 2018

Right, when you configure with CMake, try setting BUILD_PYTHON_BINDINGS to OFF. That should at least get the core library and command-line programs building.

@VarunPai
Copy link
Author

VarunPai commented May 18, 2018

Thank you @zoq and @rcurtin. Turning off the Python bindings solved the issue for now.

@gmanlan
Copy link
Contributor

gmanlan commented Jul 26, 2018

I spent some time reviewing this issue by replicating the Windows build using BUILD_PYTHON_BINDINGS=ON. Unfortunately, I can't reproduce the issue using VS2017 15.7.3.

I also noticed that the "generate_pyx_" projects include a post-build event that may fail if the user doesn't have enough privileges (error MSB3073 means that either VS can't find the setlocal command or that the paths referred in the command - like C:\Program Files\CMake... - can't be accessed by the current user). Because of this failure, the "build_pyx_" projects fail in consequence.

I guess it's just something that might happen under some particular user environment circumstances, not necessarily meaning something is wrong with mlpack.

@zoq, @rcurtin hopefully this helps to either close the issue or continue the investigation.

@rcurtin
Copy link
Member

rcurtin commented Jul 31, 2018

Hmm, so the post-build event does depend on the user being able to call the CMake program. (if I remember right it's just ${CMAKE_COMMAND} -E <some stuff ...>)

Do you think it's a common situation that the user will encounter that the CMake program might not be available? If so we can maybe try and work around it (or simply detect earlier on if the CMake program is accessible and disable Python bindings if not), but I'm not 100% familiar with Windows development so I don't know what the best thing to do would be.

@gmanlan
Copy link
Contributor

gmanlan commented Aug 1, 2018

I'm not really sure if the post-build event is exactly where it fails, or if it goes deeper into the referenced 'python_copy' project (I tried executing the script in isolation, and I get setup.py errors related to paths)... E.g.
ValueError: path 'C:/mlpack/mlpack-3.0.2/build/src/mlpack/bindings/python/' cannot end with '/'

But I don't really understand the entire python workflow yet...

@rcurtin
Copy link
Member

rcurtin commented Aug 2, 2018

Huh, maybe it could be this?

htrc/HTRC-WorksetToolkit#19

If you're willing to experiment, you could try changing line 98 of src/mlpack/bindings/python/setup.py.in from

      package_dir={ '': '${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/' },

to

      package_dir={ '': '${CMAKE_BINARY_DIR}/src/mlpack/bindings/python' },

The trailing slash might also need to be removed on lines 39 and 58, not sure. I don't have a good way to reproduce either so I can't do the test myself. :(

@rcurtin
Copy link
Member

rcurtin commented Oct 9, 2018

Closing for inactivity---reopen if needed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants