Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

cmake - Visual Studio 2015 Win64 hangs during solution build

I'm trying to build some third party libraries from source using Visual Studio 2015. I'm creating the solution file using cmake 3.2.3 and I'm using the ExternalProject_add module. I previously compiled and built this cmake code successfully in 32 bit Visual Studio 2012, but did not in 64 bit.

I'm now trying to build it in 64 bit Visual Studio 2015, and the IDE inexplicably hangs during the build process with both debug and release builds. Sometimes the build processes are still running, such as cl.exe, but nothing advances and I have to go into task manager and end all the processes associated with the build. I then try to build it again, and sometimes it builds successfully while other times it runs into the same error; freezing at different lines in the code depending on how far it got in the build.

I've gotten the same hanging issue when trying to build the solution in 32 bit as well.

I'm not sure if there is an issue with my Visual Studio 2015 installation, or if it is an issue with my cmake code that is causing this hanging. I don't know much about cmake outside of ExternalProject_add, so any and all help with cmake or visual studio is much appreciated.

Here's the external project code that initiates the build:

include(ExternalProject)

ExternalProject_Add(${3rdPartyLibraryName}
    DOWNLOAD_DIR ${3rdParty_CacheDir}
    URL ${3rdPartyURL}
    SOURCE_DIR ${3rdPartySourceDir}
    TMP_DIR ${3rdPartySourceDir}/${3rdPartyLibraryName}
    BUILD_COMMAND nmake /f makefile.vc MSVC_VER=${MSVC_VERSION} WIN64=YES INCDIR=${CMAKE_SOURCE_DIR}/../3rdParty/${3rdPartyLibraryName}/test/include
    BINARY_DIR ${3rdPartySourceDir}
    CMAKE_ARGS
      -DCMAKE_INSTALL_PREFIX:string=${3rdPartySourceDir}
    INSTALL_COMMAND ""
)

Edit

Additionally, I've tried building this from the command line set up with the VS 2015 environment and have gotten the same hanging issue.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It took a while and some research, but I think that I have reproduced your problem and found a solution. I found that cl.exe would seem to hang, but there was a process called "cvtres.exe" that was actually hanging. When I killed that process, the compilation would continue. There appears to be a known bug that KB3118401 seems to fix. I installed this patch and I haven't had the problem since. Hope this helps!

https://www.microsoft.com/en-us/download/details.aspx?id=51161


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...