DIPlib / diplib

Quantitative Image Analysis in C++, MATLAB and Python
https://diplib.org
Apache License 2.0
222 stars 49 forks source link

Win10 x64 DIPlib compilation error #140

Closed AndreZeug closed 9 months ago

AndreZeug commented 9 months ago

I followed the instructions on https://diplib.org/diplib-docs/building_windows.html, downloaded and installed all components (latest version) and failed at the point BUILDING "Right-click on INSTALL and select “Build”."

ERROR code MSB3073 The command "setlocal "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd :VCEnd" exited with code 1. INSTALL C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 166

Output output.txt

CMake 3.28.1 CMake_2023-12-30 173355

Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.

~~~Configuring LibTIFF~~~
LibTIFF uses win32 IO: TRUE
LibTIFF has JPEG 8/12 bit dual mode: FALSE

Could NOT find FFTW3 (missing: FFTW3_INCLUDE_DIR FFTW3_LIBRARY_FFTW3F FFTW3_LIBRARY_FFTW3) Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVADOC_EXECUTABLE Java_JAVAH_EXECUTABLE Development) (Required is at least version "1.7") Could NOT find FreeGLUT (missing: FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR) FreeGLUT not found Could NOT find GLFW (missing: GLFW_LIBRARY GLFW_INCLUDE_DIR) GLFW not found Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.6")


DIPlib CONFIGURATION REPORT


Configuring done (1.0s) Generating done (1.8s)

Component Select one or more of: DIPlib / DIPviewer / CMake build scripts. Include the release version (3.4.1)

Describe the bug A clear and concise description of what the bug is. Include a description of observed results and expected results.

To Reproduce Clean Win10 system, including Matlab R2023b installed

System information:

AndreZeug commented 9 months ago

Update, when adding GLFW_INCLUDE_DIR Z:/GIT/GLFW/glfw-3.3.9.bin.WIN64/include GLFW_LIBRARY Z:/GIT/GLFW/glfw-3.3.9.bin.WIN64/lib-vc2022/glfw3.lib

I receive 42 ERRORS, the original persists 🙈 output2.txt

crisluengo commented 9 months ago

You have a long series of warning messages and then an error while parsing cmake_install.cmake. This is a file generated by CMake itself, so this makes very little sense. Unless you have two different versions of CMake on your system, and you used one to configure DIPlib, but then at build time it's using the other one.

I don't know how to check for this case, I'm not terribly comfortable using Windows.

Could MSVC come with a copy of CMake?


Don't worry about FFTW3, you don't need it. It's faster than the built-in FFT, but it's not that much of a difference.


The first error message compiling in the second output is consistent with an issue with CMake. You could have a syntax error there if the macro STRIP_SIZE_DEFAULT is not defined. It should be defined when invocating the compiler, and CMake is in charge of doing so.

AndreZeug commented 9 months ago

Moin Chris, Oh yeah, you are absolutely right, when installing MS Visual Studio I did select the package "Desktop development with C++" (thought this was told by your installation guide) which then installs a bunch of tools including CMake grafik

Need to check if I succeed when I uninstall the one (MSVS CMake) or the other (individually installed CMake)

AndreZeug commented 9 months ago

Uninstalling MSVS "Desktop development with C++" package causes serious errors 😪

grafik

AndreZeug commented 9 months ago

🥳

Thanks Cris! I cannot exactly tell why, but after reinstalling MSVS "Desktop development with C++" package, and gently restarting Win10 (unfortunately still a recommended habit using Windows 🙈) I succeed. grafik

Conclusion The description in Building the DIPlib project on Windows is correct / it works, but patience might help avoiding trouble after installing all components and a Windows typical restart might help before Creating Visual Studio project files

crisluengo commented 9 months ago

Wonderful! Happy you got it to work.

Reinstalling MSVC means you installed it after installing CMake, could that have an influence?