-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
I am trying to build a Release version of SCIP from source on Windows using CMake, but the build fails with both the Ninja and Visual Studio 17 2022 generators.
- Microsoft Windows 11 Pro (10.0.26100 N/A Build 26100) x64
- SCIP v9.2.2 (416226a)
- CMake 3.31.5
- MSVC 14.44.35207
- Cl 19.44.35211
Here is what I have tried.
1. CMake using Visual Studio 17 2022 as generator
- Configure command:
PS C:\tool\scip\scip> cmake -S . -B build-vs17 -DAUTOBUILD=ON -G "Visual Studio 17 2022" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- Error:
CMake Error at build-vs17/_deps/soplex-build/src/cmake_install.cmake:213 (file):
file INSTALL cannot find
"C:/tool/scip/scip/build-vs17/_deps/soplex-build/bin/Release/soplex.exe":
File exists.
- It seems that it was built during the configure step using Debug mode:
- Complete log: https://gist.github.com/alexandredias3d/a8f2bc39bfde91af3de0278fa9c60521
2. CMake using Ninja as generator for Release build
- Configure command (configuration works):
cmake -S . -B build-ninja-release -DAUTOBUILD=ON -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release
- Build command:
PS C:\tool\scip\scip> cmake --build build-ninja-release
- Error:
FAILED: [code=4294967295] bin/libscip.dll lib/libscip.lib
C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --msvc-ver=1944 --intdir=src\CMakeFiles\libscip.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\ENTERP~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\libscip.rsp /out:bin\libscip.dll /implib:lib\libscip.lib /pdb:bin\libscip.pdb /dll /version:9.2 /machine:x64 /INCREMENTAL:NO && cd ."
LINK: command "C:\PROGRA~1\MIB055~1\2022\ENTERP~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\libscip.rsp /out:bin\libscip.dll /implib:lib\libscip.lib /pdb:bin\libscip.pdb /dll /version:9.2 /machine:x64 /INCREMENTAL:NO /MANIFEST:EMBED,ID=2" failed (exit code 1120) with the following output:
libsoplex-pic.lib(spxdefines.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(spxdefines.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(spxout.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(spxout.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(idxset.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(idxset.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(spxid.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(spxid.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(usertimer.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(usertimer.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(wallclocktimer.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(wallclocktimer.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(nameset.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(nameset.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(didxset.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(didxset.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(mpsinput.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in exprinterpret_cppad.cpp.obj
libsoplex-pic.lib(mpsinput.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in exprinterpret_cppad.cpp.obj
Creating library lib\libscip.lib and object lib\libscip.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
libsoplex-pic.lib(didxset.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(mpsinput.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(spxdefines.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(spxout.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(idxset.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(nameset.cpp.obj) : error LNK2001: unresolved external symbol __imp__calloc_dbg
libsoplex-pic.lib(didxset.cpp.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libsoplex-pic.lib(spxout.cpp.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libsoplex-pic.lib(idxset.cpp.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libsoplex-pic.lib(spxid.cpp.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
libsoplex-pic.lib(nameset.cpp.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReport
bin\libscip.dll : fatal error LNK1120: 2 unresolved externals
It works if I configure for Debug with Ninja; however, I was expecting it to work for Release builds as well.
Am I missing a CMake option to force it to link the CRT libraries correctly according to the configuration type?