Build error on Windows #61

Open
opened 2020-06-29 07:07:55 +02:00 by 2damin · 5 comments
2damin commented 2020-06-29 07:07:55 +02:00 (Migrated from github.com)

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
**

### 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****
perseusdg commented 2020-09-02 19:11:21 +02:00 (Migrated from github.com)

try this:
in https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/CMakeLists.txt#L5 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:
https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/utils.h#L15
https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/DetectionNN.h#L7
https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/ImuOdom.h#L4
https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/Int8BatchStream.h#L15
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

try this: in https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/CMakeLists.txt#L5 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: https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/utils.h#L15 https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/DetectionNN.h#L7 https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/ImuOdom.h#L4 https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/Int8BatchStream.h#L15 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
nowhereman1999 commented 2021-08-27 04:20:13 +02:00 (Migrated from github.com)

try this:
in

https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/CMakeLists.txt#L5

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:
https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/utils.h#L15

https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/DetectionNN.h#L7

https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/ImuOdom.h#L4

https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/Int8BatchStream.h#L15

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

> try this: > in > > https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/CMakeLists.txt#L5 > > 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: > https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/utils.h#L15 > > > https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/DetectionNN.h#L7 > > > https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/ImuOdom.h#L4 > > > https://github.com/ceccocats/tkDNN/blob/38106a9495438465118f8e36021126f5fbcbb57d/include/tkDNN/Int8BatchStream.h#L15 > > > 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](https://user-images.githubusercontent.com/53631206/131061569-70487573-9eff-48f5-9490-daf9476f6f8d.png)
nowhereman1999 commented 2021-08-27 04:24:57 +02:00 (Migrated from github.com)

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?

[https://github.com/ceccocats/tkDNN/blob/master/CMakeLists.txt](url) 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](url) is different,which is your branch?
nowhereman1999 commented 2021-08-27 04:40:45 +02:00 (Migrated from github.com)

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?

[https://github.com/ceccocats/tkDNN/blob/master/include/tkDNN/utils.h](url) It seems like the code from master branch have add a precompiled statement to avoid the error ![image](https://user-images.githubusercontent.com/53631206/131063363-9bfa5ca7-4c8c-40e5-942b-b030a0e2a90e.png) 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](https://user-images.githubusercontent.com/53631206/131063786-006a4a1d-25c5-4745-a48e-1d789ba2f081.png) I think maybe it is caused by the header file?
nowhereman1999 commented 2021-08-27 04:59:11 +02:00 (Migrated from github.com)

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

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](https://user-images.githubusercontent.com/53631206/131064987-ab1e1f1a-8b69-42fc-b332-f21c7af39430.png)
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mmr/tkDNN#61