YAML issue trying to compile on windows. #269
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've been trying to compile tkDNN on windows but I cannot get past a YAML issue. Is there a specific YAML-CPP version that must be used?
It works with both yaml-cpp 0.7 and 0.6
Ah, cool. Should I have done something besides:
vcpkg.exe install yaml-cpp:x64-windows --x-install-root=C:\opt --x-buildtrees-root=C:\temp_vcpkg_buildto install it so I could compile?No that should be sufficient ..but how exactly are you using vcpkg built packages ?...is it through the vcpkg tool chain file or are you manually defining prefix path ?,I almost always only use the former and it works for me
I was following the build instructions here https://github.com/ceccocats/tkDNN/blob/master/docs/windows.md I ran the vcpkg tool the way the instructions said. Is there a different way to use vcpkg? I've not used it before trying to use tkDNN on windows.
vcpkg installed 'C:/opt/x64-windows/share/yaml-cpp/yaml-cpp-config.cmake, version: 0.7.0 (64bit)' but cmake told me the error (The following configuration files were considered but not accepted:) about yaml version: 0.7.0 in my original post. It clearly sees the yaml, and I not sure why it is not accepted.
I found info about vcpkg toolchain use here, https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md#cmake-integration . I used the vckpg toolchain file, it changed the error message source as coming from the vcpkg (C:/projects/vcpkg/scripts/buildsystems/vcpkg.cmake) now. I tried to use the yaml-cpp-config.cmake as a chainload cmake file, but that did not work either.
I was able to get rid of the static vs dynamic warnings about YAML, but I still cannot complete cmake successfully. Do you have any suggestions of what I might be doing wrong? I've tried to make tkDNN work on windows for days now. It works fine on Linux, but will not build on windows. I tried using Ninja, just Visual Studio, NMake, it does not matter the cmake throws errors. I did get cmake-gui to create a visual studio project that claims to have included everything including yaml, however when I try to build that it cannot find NvInfer.h which is very puzzling as cmake says it found cuda and cudnn. I've even tried windows 10 20H2 and Server 2019, I get the same issue on both versions of windows.
Regarding not being able to find the nvinfer.h file ,try putting tensorrt(include,bins and lib64) in the cuda directory itself like you did with cudnn,and the yaml-cpp issue you have ,i was unable to replicate your issue so i am afraid i am not of much help there
Interesting, I wonder how our environments are different then? I ran into issues instantly trying to follow only the directions here: https://github.com/ceccocats/tkDNN/blob/master/docs/windows.md . Simply following the directions as written results in errors for me. The vcpkg step worked fine.
I run into issues when trying to use cmake as outlined in the instructions:
I tried adding the compiler variables to the command line but that still resulted in an issue:
Using cmake-gui I run into the same issues. I had previously used cmake by launching it from inside the Visual Studio using the Developer Command Prompt. cmake seems to know more about the windows compiler when launched from here. All of my previous posts in this thread was from cmake output from the Visual Studio Developer Command Prompt. Me using cmake-gui launched from Visual Studio Developer Command Prompt:



I try to do the ninja as instructed, but there is an error finding CUDNN.
I add the dir to find CUDNN and then I get the yaml error. If I put in the yaml dir manually to cmake-gui I still get the same error.
Am I following the instructions wrong? They don't seem to work for me as-is, so I started fixing things, but I can't get past yaml. I can try what you suggest about nvinfer.h not being found but it will take me some time. If you have any more ideas about what I am doing wrong, or what is going wrong I would really appreciate to hear them. Thank you.
can you try building it from the developer command prompt?(https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160)
if that doesn't work ,can you try using the master branch on my fork https://github.com/perseusdg/tkDNN (build it from the developer command prompt)
That was it! Thank you! Using the x64 command prompt fix it instantly. Cmake now completes successfully. It might be worth adding to the instructions to use this command prompt to build. I did not have to add any extra cudnn or compiler variables for cmake to work.

Sadly, ninja threw an error, but I will keep at it.
the current master branch has some issues with using it on windows ,you can use this repo at this point https://github.com/ceccocats/tkDNN/tree/c306b368608893e92925bf143e7cf14f19525aeb or you can use the master branch here https://github.com/perseusdg/tkDNN(i fixed most of the compile issues on the current master branch ..though semantic segmentation doesn't work on windows) ..you can read up on this issue to know more https://github.com/ceccocats/tkDNN/issues/252
Thank you very much. Using the alternate repo and the checkout of a specific branch from master you posted I was able to build and run using ninja and just visual studio, after I did what you suggested and installed TensorRT and cudnn into the cuda directory itself. Sadly, there are many overlapping names in those programs so I am not sure how this will effect my other programs that just need cuda to run, but I backed up the old dir to figure that out.