KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

Complilation Error in Windows #12583

Closed AFranci closed 2 weeks ago

AFranci commented 1 month ago

We have tried to compilate kratos in windows and we had the following error:

C:\Program Files (x86)\Kratos\scripts>configure_AF.bat The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified.

C:\Program Files (x86)\Kratos\scripts>cmake -G"Visual Studio 17 2022" -H"C:\Program Files (x86)\Kratos\scripts.." -B"C:\Program Files (x86)\Kratos\scripts../build\Release" -DUSE_TRIANGLE_NONFREE_TPL=ON -DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS /MP1" -DUSE_MPI=OFF -DKRATOS_EXCLUDE_OPENMP=OFF -DINSTALL_RUNKRATOS=OFF -DUSE_EIGEN_MKL=OFF -DKRATOS_BUILD_TESTING=ON -DINCLUDE_MMG=OFF -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631. -- The C compiler identification is MSVC 19.40.33813.0 -- The CXX compiler identification is MSVC 19.40.33813.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- No KRATOS_SOURCE_DIR is defined, using: C:/Program Files (x86)/Kratos -- No KRATOS_BINARY_DIR is defined, using: C:/Program Files (x86)/Kratos/build/Release -- No KRATOS_INSTALL_PYTHON_USING_LINKS is defined, setting to OFF -- No CMAKE_INSTALL_MESSAGE is defined. Setting to NEVER -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.45.2.windows.1") -- CMAKE_SYSTEM_NAME = Windows -- CMAKE_CXX_COMPILER_ID = MSVC -- CMAKE_CXX_FLAGS = -D_SCL_SECURE_NO_WARNINGS /MP1 -- CMAKE_C_FLAGS = /DWIN32 /D_WINDOWS /W3 Detected compiler as MSVC -- Found Python: C:/Users/ASUS/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.10") found components: Interpreter -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Found PythonInterp: "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\python.exe" (Required is at least version "3.6") CMake Error at cmake_modules/FindPythonLibsNew.cmake:152 (message): Python config failure:

Call Stack (most recent call first): cmake_modules/pybind11Tools.cmake:16 (find_package) CMakeLists.txt:330 (include)

-- Configuring incomplete, errors occurred! See also "C:/Program Files (x86)/Kratos/build/Release/CMakeFiles/CMakeOutput.log". See also "C:/Program Files (x86)/Kratos/build/Release/CMakeFiles/CMakeError.log".

C:\Program Files (x86)\Kratos\scripts>rem Build

C:\Program Files (x86)\Kratos\scripts>cmake --build "C:\Program Files (x86)\Kratos\scripts../build/Release" --target install -- /property:configuration=Release /p:Platform=x64 MSBuild version 17.10.4+10fbfbf2e for .NET Framework MSBUILD : error MSB1009: Project file does not exist. Switch: install.vcxproj

C:\Program Files (x86)\Kratos\scripts>goto:eof

C:\Program Files (x86)\Kratos\scripts>

The configure.bat is this:

@echo off rem Please do not modify this script

rem For any question please contact with us in: rem - https://github.com/KratosMultiphysics/Kratos

rem Optional parameters: rem You can find a list will all the compiation options in INSTALL.md or here: rem - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options

rem Set compiler set CC=cl.exe set CXX=cl.exe

rem Set variables if not defined KRATOS_SOURCE set KRATOS_SOURCE=%~dp0.. if not defined KRATOS_BUILD set KRATOS_BUILD=%KRATOS_SOURCE%/build

rem Warning: In windows this option only works if you run through a terminal with admin privileges rem set KRATOS_INSTALL_PYTHON_USING_LINKS=ON

rem Set basic configuration if not defined KRATOS_BUILD_TYPE set KRATOS_BUILD_TYPE=Release if not defined BOOST_ROOT set BOOST_ROOT=C:\Program Files (x86)\boost_1_85_0 if not defined PYTHON_EXECUTABLE set PYTHON_EXECUTABLE="C:\Users\ASUS\AppData\Local\Programs\Python\Python310\python.exe"

rem Set applications to compile set KRATOS_APP_DIR=applications set KRATOS_APPLICATIONS= CALL :add_app %KRATOS_APP_DIR%\LinearSolversApplication; CALL :add_app %KRATOS_APP_DIR%\DelaunayMeshingApplication; CALL :add_app %KRATOS_APP_DIR%\PfemFluidDynamicsApplication;

rem Clean del /F /Q "%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%\cmake_install.cmake" del /F /Q "%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%\CMakeCache.txt" del /F /Q "%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%\CMakeFiles"

rem Configure @echo on cmake -G"Visual Studio 17 2022" -H"%KRATOS_SOURCE%" -B"%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" ^ -DUSE_TRIANGLE_NONFREE_TPL=ON ^ -DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS /MP1" ^ -DUSE_MPI=OFF ^ -DKRATOS_EXCLUDE_OPENMP=OFF ^ -DINSTALL_RUNKRATOS=OFF ^ -DUSE_EIGEN_MKL=OFF ^ -DKRATOS_BUILD_TESTING=ON ^ -DINCLUDE_MMG=OFF

rem Build cmake --build "%KRATOS_BUILD%/%KRATOS_BUILD_TYPE%" --target install -- /property:configuration=%KRATOS_BUILD_TYPE% /p:Platform=x64 goto:eof

rem Function to add apps :add_app set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%1; goto:of

We also tried with more recent python and make version and we obtained the same error in two different machines. Any help is welcome!

loumalouomega commented 1 month ago

Looks like python is not properly recognized.

roigcarlo commented 1 month ago

Yep, seems that there is two version of python, 3.10 which you are setting in the configure and 3.6 which is somehow finding.

Can you try to remove the build folder and rerun?

AFranci commented 1 month ago

Hi Carlos. I removed the build and I got the same error...

matekelemen commented 1 month ago

Can you make sure that the python installation at that path is valid and complete? (just open a terminal, call the interpreter and type some python commands)

I vaguely remember some problems with python installations from the microsoft store. On my machine, there was a default installation stub I couldn't get working right, so I had to completely uninstall it, then manually download the python installer and use that instead.

roigcarlo commented 1 month ago

@matekelemen Sorry we already made a patch for this yesterday, still the problem is very dark. Seems that cmake is unable to invoke python via èxecute_process.

As I sade we found a temporal solution but I will leave this open just to remember to take a closer look.

AFranci commented 1 month ago

thank you for your help!