Dlib: Building dlib examples using MS VS 2017 takes forever?

Created on 11 Apr 2017  路  9Comments  路  Source: davisking/dlib

My notebook runs 64-bit Windows 10 (8 GB RAM), and already have VS2017 (with all the latest updates) installed. I'm trying to build the dlib examples, and after 8 hours it still stuck at compiling dnn_face_recognition_ex.cpp.

Steps to reproduce:

  1. Get the latest, official dlib (v19.4), and extract it somewhere, e.g C:\dev\dlib-19.4
  2. Run "x64 Native Tools Command Prompt for Visual Studio 2017"
  3. Do the steps described in http://dlib.net/faq.html#HowcanIusedlibinVisualStudio (I use cmake 3.8.0 x64)
  4. Lots of compilation lines will appear, but after reaching dnn_face_recognition_ex.cpp will stuck like this:
    Project "C:\dev\dlib-19.4\examplesbuild\ALL_BUILD.vcxproj" (1) is building "C:\dev\dlib-19.4\examplesbuild\dnn_face_recognition_ex.vcxproj" (15) on node 1 (default t
    argets).
    PrepareForBuild:
    Creating directory "dnn_face_recognition_ex.dir\Release\".
    Creating directory "dnn_face_recognition_ex.dir\Release\dnn_face.798D7D33.tlog\".
    InitializeBuildStatus:
    Creating "dnn_face_recognition_ex.dir\Release\dnn_face.798D7D33.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
    CustomBuild:
    Building Custom Rule C:/dev/dlib-19.4/examples/CMakeLists.txt
    CMake does not need to re-run because C:/dev/dlib-19.4/examples/build/CMakeFiles/generate.stamp is up-to-date.
    ClCompile:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017bin\HostX86x86\CL.exe /c /I"C:\dev\dlib-19.4\dlib.." /nologo /W3 /WX- /diag
    nostics:classic /O2 /Ob2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D DLIB_HAVE_SSE2 /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /arch:SSE2 /fp:precise /Zc:w
    char_t /Zc:forScope /Zc:inline /GR /Fo"dnn_face_recognition_ex.dir\Release\" /Fd"dnn_face_recognition_ex.dir\Release\vc141.pdb" /Gd /TP /analyze- /errorReport:queue
    /bigobj "C:\dev\dlib-19.4\examples\dnn_face_recognition_ex.cpp"
    dnn_face_recognition_ex.cpp

Most helpful comment

Visual Studio 2017 seems to be buggier than Visual Studio 2015. Other people have reported problems. I haven't even successfully installed it. I tried half a dozen times to install VC2017 but the installer crashed every time at some random point. One of the times it took part of windows with it and I needed to restore some files before my desktop functioned correctly.

In any case, this isn't a dlib bug. You should report this to the visual studio dev team and maybe they will fix it. As of right now my recommendation is to avoid visual studio 2017.

All 9 comments

So far, these are the examples that are successfully compiled.
dexe

Wonder why compiling dnn_face_recognition_ex.cpp take so loooong. Antivirus was disabled before compilation started.

Visual Studio 2017 seems to be buggier than Visual Studio 2015. Other people have reported problems. I haven't even successfully installed it. I tried half a dozen times to install VC2017 but the installer crashed every time at some random point. One of the times it took part of windows with it and I needed to restore some files before my desktop functioned correctly.

In any case, this isn't a dlib bug. You should report this to the visual studio dev team and maybe they will fix it. As of right now my recommendation is to avoid visual studio 2017.

I did some more testing and through commenting code , I found out that the following line is causing the build to stuck forever .

anet_type net;

Here is the minimum code from the face recognition example which is not compiling

include

using namespace dlib;
using namespace std;

template