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

Build error on Windows #61

Open
2damin opened this issue Jun 29, 2020 · 5 comments
Open

Build error on Windows #61

2damin opened this issue Jun 29, 2020 · 5 comments

Comments

@2damin
Copy link

2damin commented Jun 29, 2020

Is it possible to build on Windows?

  • Setting
    OS : Windows10
    GPU : Titan XP(CUDA10.1, CuDNN_v7.6.5)
    CPU : AMD
    OpenCV : 4.3.0

1. When i compiled it using "make", It is impossible to compile because "Makefile" didn't made automatically.

2. So when i build&compile it using "cmake", occurs compile error.

`cd build`
`cmake ..`
`cmake --build . --config "Release" `

-> nvcc fatal : 32 bit compilation is only supported for MS Visual Studio 2013 and earlier
CMake Error at kernels_generated_activation_elu.cu.obj.Release.cmake:220 (message):
Error generating
D:/tkdnn/build/CMakeFiles/kernels.dir/src/kernels/Release/kernels_generated_activation_elu.cu.obj

3. So i changed x86 -> x64

`cd build`
`cmake -G "Visual Studio 15 2017 Win64" ..`
`cmake --build . --config "Release" `

-> cl : error D8021 : '/Who-deprecated-declarations' ~
CMake Error at kernels_generated_activation_elu.cu.obj.Release.cmake:220 (message):
Error generating
D:/tkdnn/build/CMakeFiles/kernels.dir/src/kernels/Release/kernels_generated_activation_elu.cu.obj
**

@2damin 2damin changed the title Build on Windows Build error on Windows Jun 29, 2020
@perseusdg
Copy link
Contributor

perseusdg commented Sep 2, 2020

try this:
in

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -Wno-deprecated-declarations -Wno-unused-variable")
remove "-Wno-deprecated-declarations -Wno-unused-variable" they are unsupported command line options for MSVC, and
you will have to comment out and probably replace "unistd.h" with "windows.h" in the following places:
#include <unistd.h>

#include <unistd.h>

#include <unistd.h>

#include <unistd.h>

and even after this MSVC will compile it with a ton of warnings and after deserialization there's a high chance you end up with errors like those pointed out in the other windows related issues

@Hezhexi2002
Copy link

try this:
in

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -Wno-deprecated-declarations -Wno-unused-variable")

remove "-Wno-deprecated-declarations -Wno-unused-variable" they are unsupported command line options for MSVC, and
you will have to comment out and probably replace "unistd.h" with "windows.h" in the following places:

#include <unistd.h>

#include <unistd.h>

#include <unistd.h>

#include <unistd.h>

and even after this MSVC will compile it with a ton of warnings and after deserialization there's a high chance you end up with errors like those pointed out in the other windows related issues

I met a similar error when I use ninja -j4
image

@Hezhexi2002
Copy link

Hezhexi2002 commented Aug 27, 2021

https://github.com/ceccocats/tkDNN/blob/master/CMakeLists.txt this is my current CMaKeLists.txt and this is the master branch but the CMaKeLists.txt https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/CMakeLists.txt#L5 is different,which is your branch?

@Hezhexi2002
Copy link

Hezhexi2002 commented Aug 27, 2021

https://github.com/ceccocats/tkDNN/blob/master/include/tkDNN/utils.h It seems like the code from master branch have add a precompiled statement to avoid the error
image

but I still got the similar error even when I use the master branch,so how can I fix it?
this is the error
image
I think maybe it is caused by the header file?

@Hezhexi2002
Copy link

I have solved that,it is really caused by the headerfile,I add the wtypes.h and #define uint UINT and the two errors disappeard,but now I face a new problem.It should be a link error:
image

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

3 participants