When I build Slicer in my Windows 11 Intel laptop using the following instructions as stated in Slicer website the I got the following error,
Instructions:
mkdir C:\D\S4R
cd /d C:\D\S4R
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -A x64 -DQt5_DIR:PATH=C:\Qt\5.15.2\msvc2019_64\lib\cmake\Qt5 C:\D\S4
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release
The error is not immediate and it showed after four hours of building.
Thanks for any help.
ERROR:
CMake/LastConfigureStep/CMakeLists.txt:41 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMake/SlicerPackageAndUploadTarget.cmake:118 (message):
Variable Slicer_WC_LAST_CHANGED_DATE is expected to be defined.
Call Stack (most recent call first):
CMake/LastConfigureStep/CMakeLists.txt:41 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/merts/Slicer-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/merts/Slicer-build/CMakeFiles/CMakeError.log".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Micro
soft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom buil
d for 'C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-mk
dir.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-
download.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Sl
icer-update.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf
\Slicer-patch.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3f
bf\Slicer-configure.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea8
8f0c3fbf\Slicer-build.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0bae
a88f0c3fbf\Slicer-forceconfigure.rule;C:\Users\merts\CMakeFiles\64875fd3510
9041c8e0baea88f0c3fbf\Slicer-install.rule;C:\Users\merts\CMakeFiles\6a457aa
83091fe4a6245d53ff14120bf\Slicer-complete.rule;C:\Users\merts\CMakeFiles\2e
18417901a880d0571e033b5beb779a\Slicer.rule;C:\D\S4\CMakeLists.txt' exited w
ith code 1. [C:\Users\merts\Slicer.vcxproj]
Here are few questions to help understand what is happening.
Questions
Which version of Slicer source are you building against ?
Which version of CMake are you using ?
And what is the output of the following commands executed in the Slicer source tree:
$ git rev-parse --verify -q --short=7 HEAD
30d8416
$ git show -s --format=%ci 30d8416
2021-12-09 14:36:22 -0500
What is the output associated with the Regular Expression Explorer provided by the cmake-gui.exe corresponding to your version of CMake ? (Tools → Regular Expression Explorer)
Slicer needs to extract date and time from the git log during build. Your build fails because this date&time is in an unexpected format, most likely due to your regional settings (how date&time is formatted). That’s why @jcfr asked to get the an example of a printout of the date from git, and then testing that in CMake’s regular expression explorer. The window is expected to be empty and you copy the content there.
@jcfr can you copy the regular expression that needs to be tested? (it would be error-prone to copy it from the screenshot)
I have changed date&time settings and rerun the build in debug mode this time, and issue persist.
Error Code:
-- Setting 'CTEST_MODEL' variable with default value 'Experimental'
-- Setting 'SLICER_PACKAGE_MANAGER_CLIENT_EXECUTABLE' variable with default value 'SLICER_PACKAGE_MANAGER_CLIENT_EXEC
UTABLE-NOTDEFINED'
-- Setting 'SLICER_PACKAGE_MANAGER_URL' variable with default value 'SLICER_PACKAGE_MANAGER_URL-NOTDEFINED'
CMake Warning (dev) at CMake/SlicerMacroExtractRepositoryInfo.cmake:75 (message):
Skipping repository info extraction: directory [C:/D/S4] is not a GIT or
SVN checkout
Call Stack (most recent call first):
CMake/SlicerPackageAndUploadTarget.cmake:105 (SlicerMacroExtractRepositoryInfo)
CMake/LastConfigureStep/CMakeLists.txt:41 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMake/SlicerPackageAndUploadTarget.cmake:118 (message):
Variable Slicer_WC_LAST_CHANGED_DATE is expected to be defined.
Call Stack (most recent call first):
CMake/LastConfigureStep/CMakeLists.txt:41 (include)
-- Setting 'SLICER_PACKAGE_MANAGER_API_KEY' variable with default value 'OBFUSCATED'
-- Configuring incomplete, errors occurred!
See also "C:/Users/merts/Slicer-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/merts/Slicer-build/CMakeFiles/CMakeError.log".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241
,5): error MSB8066: Custom build for 'C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-mkdir.rule;C:\U
sers\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-download.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8
e0baea88f0c3fbf\Slicer-update.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-patch.rule;C:\User
s\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-configure.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0
baea88f0c3fbf\Slicer-build.rule;C:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-forceconfigure.rule;C
:\Users\merts\CMakeFiles\64875fd35109041c8e0baea88f0c3fbf\Slicer-install.rule;C:\Users\merts\CMakeFiles\6a457aa83091fe4
a6245d53ff14120bf\Slicer-complete.rule;C:\Users\merts\CMakeFiles\2e18417901a880d0571e033b5beb779a\Slicer.rule;C:\D\S4\C
MakeLists.txt' exited with code 1. [C:\Users\merts\Slicer.vcxproj]
Are you following the example of the build instructions for the location on the Slicer build folder? Are you using “C:/S4R” or “C:/Users/merts/Slicer-build/”? A longer initial build directory could lead to downstream issues.
I’m just noticing from your screenshots that your “where to build the binaries” is “C:/users/merts/Documents/Slicer_built” which doesn’t seem to match with “C:/D/S4D”. It’s indicating your build is going into your user location instead.