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

Building mlpack-2.0.3 on Windows 10 with MSVC 19 #794

Closed
asadoll opened this issue Sep 28, 2016 · 5 comments
Closed

Building mlpack-2.0.3 on Windows 10 with MSVC 19 #794

asadoll opened this issue Sep 28, 2016 · 5 comments

Comments

@asadoll
Copy link

asadoll commented Sep 28, 2016

I tried to follow these steps, everything went fine except generating MS Visual Studio solution failed with an error which shows the intermediate/temp .vcxproj is using a GNU C++ compiler template instead of the MSVC's. This is my first try with cmake, so do you think I should check sth inside mlpack cmake files or it may be some bug in cmake?

Here's the error dump:

Performing C++ SOURCE FILE Test COMPILER_HAS_DEPRECATED_ATTR failed with the following output:
Change Dir: C:/home/src/mlpack-2.0.3/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_2cc0c.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
Microsoft (R) Build Engine version 14.0.25420.1

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/28/2016 6:46:04 PM.

Project "C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj" on node 1 (default targets).

PrepareForBuild:

Creating directory "cmTC_2cc0c.dir\Debug".

Creating directory "C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\Debug".

Creating directory "cmTC_2cc0c.dir\Debug\cmTC_2cc0c.tlog".

InitializeBuildStatus:

Creating "cmTC_2cc0c.dir\Debug\cmTC_2cc0c.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

ClCompile:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_HAS_DEPRECATED_ATTR /D _DEBUG /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"cmTC_2cc0c.dir\Debug" /Fd"cmTC_2cc0c.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue -O3 "C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx"

Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64

Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_HAS_DEPRECATED_ATTR /D _DEBUG /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"cmTC_2cc0c.dir\Debug" /Fd"cmTC_2cc0c.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue -O3 "C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx"

cl : Command line warning D9002: ignoring unknown option '-O3' [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

src.cxx

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C2065: 'deprecated': undeclared identifier [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C2448: 'attribute': function-style initializer appears to be a function definition [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

Done Building Project "C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj" (default targets) -- FAILED.

Build FAILED.

"C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj" (default target) (1) ->

(ClCompile target) ->

cl : Command line warning D9002: ignoring unknown option '-O3' [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

"C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj" (default target) (1) ->

(ClCompile target) ->

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C2065: 'deprecated': undeclared identifier [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\src.cxx(1): error C2448: 'attribute': function-style initializer appears to be a function definition [C:\home\src\mlpack-2.0.3\build\CMakeFiles\CMakeTmp\cmTC_2cc0c.vcxproj]

1 Warning(s)

3 Error(s)

Time Elapsed 00:00:00.44

Source file was:
attribute((deprecated)) int somefunc() { return 0; }
int main() { return somefunc();}

@rcurtin
Copy link
Member

rcurtin commented Sep 29, 2016

You are right, __attribute__((__deprecated)) does not exist for MSVC. Can you post the CMake configuration output? That might provide some information on why this happened.

Also, it looks like you are trying to compile a program that links against mlpack. Did mlpack itself compile successfully? I'm not sure I completely understand what you've done here.

@asadoll
Copy link
Author

asadoll commented Sep 29, 2016

It's the log for the error which occurred during compiling the temporary compiler feature test projects and it's the mlpack itself.
I cloned the master branch instead of 2.0.3 and it worked fine. I noticed the same error happened on COMPILER_HAS_DEPRECATED_ATTR but cmake retried with the next template and passed.
I will check the CMakeLists from both branches to see what's the difference.

@rcurtin
Copy link
Member

rcurtin commented Sep 29, 2016

Is it possible this could be a CMake bug? I am not sure if much has changed in the configuration between 2.0.3 and master that would affect your situation.

@asadoll
Copy link
Author

asadoll commented Sep 30, 2016

I couldn't reproduce the error for the master version.

@rcurtin
Copy link
Member

rcurtin commented Sep 30, 2016

In this case, should we close this? It sounds like if there is an issue, it will be fixed upon the next release.

@asadoll asadoll closed this as completed Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants