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.05k stars 246 forks source link

Impossibility to install Kratos on Windows #7120

Closed gpietrop closed 4 years ago

gpietrop commented 4 years ago

Dear all, I am a new entry in the Kratos' universe and I would like to install correctly Kratos (on Windows 10), but something goes wrong.

This is the modified configure file (that is actually a .bat file in my Kratos folder):

configure.txt.

When I launch the program on my cmd the following errors occur: errors

roigcarlo commented 4 years ago

Dear @GloriaPietropolli

Depending on the CMake version you are using the generator will be unable to find the correct architecture. Please try to change to the configure to:

cmake -G"Visual Studio 15 2017" -A x64"

or

cmake -G"Visual Studio 15 2017" Win64"

or update CMake

Also if possible I recommend you to use Visual Studio 2019

gpietrop commented 4 years ago

Thank you sincerely @roigcarlo ! error3 This is my output now, the code compiled for 4 minutes and then shows me this.. The output says 'generating done' but also 'CMake Generate step failed', so I don't know if the process ended successfully. What can I do?

roigcarlo commented 4 years ago

Hi @GloriaPietropolli,

Can you send me or past here the full output?

gpietrop commented 4 years ago

@roigcarlo Microsoft Windows [Versione 10.0.17134.1246] (c) 2018 Microsoft Corporation. Tutti i diritti sono riservati.

C:\Users\Gloria>echo %PYTHONPATH% %PYTHONPATH%

C:\Users\Gloria>set PYTHONPATH=%PYTHONPATH%;C:/Users/Gloria/Desktop/Kratos/bin/Release

C:\Users\Gloria>echo %PYTHONPATH% %PYTHONPATH%;C:/Users/Gloria/Desktop/Kratos/bin/Release

C:\Users\Gloria>set PATH=%PATH%;C:/Users/Gloria/Desktop/Kratos/bin/Release/libs

C:\Users\Gloria>echo %PATH% C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Users\Gloria\AppData\Local\Microsoft\WindowsApps;C:\Program Files\CMake\bin;C:\Users\Gloria\AppData\Local\Programs\Microsoft VS Code\bin;C:/Users/Gloria/Desktop/Kratos/bin/Release/libs

C:\Users\Gloria>cd Desktop

C:\Users\Gloria\Desktop>cd Kratos

C:\Users\Gloria\Desktop\Kratos>cd scripts

C:\Users\Gloria\Desktop\Kratos\scripts>configure

C:\Users\Gloria\Desktop\Kratos\scripts>rem Optional parameters:

C:\Users\Gloria\Desktop\Kratos\scripts>rem You can find a list will all the compiation options in INSTALL.md or here:

C:\Users\Gloria\Desktop\Kratos\scripts>rem - https://github.com/KratosMultiphysics/Kratos/wiki/Compilation-options

C:\Users\Gloria\Desktop\Kratos\scripts>rem Set compiler

C:\Users\Gloria\Desktop\Kratos\scripts>set CC=cl.exe

C:\Users\Gloria\Desktop\Kratos\scripts>set CXX=cl.exe

C:\Users\Gloria\Desktop\Kratos\scripts>rem Set variables

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_SOURCE=~0,-1/..

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_BUILD=~0,-1/../build

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APP_DIR=applications

C:\Users\Gloria\Desktop\Kratos\scripts>rem Warning: In windows this option only works if you run through a terminal with admin privileges

C:\Users\Gloria\Desktop\Kratos\scripts>rem set KRATOS_INSTALL_PYTHON_USING_LINKS=ON

C:\Users\Gloria\Desktop\Kratos\scripts>rem Set basic configuration

C:\Users\Gloria\Desktop\Kratos\scripts>if not defined KRATOS_BUILD_TYPE set KRATOS_BUILD_TYPE=Release

C:\Users\Gloria\Desktop\Kratos\scripts>if not defined BOOST_ROOT set BOOST_ROOT=C:\Users\Gloria\Desktop\boost_1_73_0\boost_1_73_0

C:\Users\Gloria\Desktop\Kratos\scripts>set PYTHON_EXECUTABLE=C:\Windows\py.exe

C:\Users\Gloria\Desktop\Kratos\scripts>rem Set applications to compile

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APPLICATIONS=

C:\Users\Gloria\Desktop\Kratos\scripts>CALL :add_app applications\EigenSolversApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APPLICATIONS=applications\EigenSolversApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>goto:eof

C:\Users\Gloria\Desktop\Kratos\scripts>CALL :add_app applications\StructuralMechanicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APPLICATIONS=applications\EigenSolversApplication;applications\StructuralMechanicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>goto:eof

C:\Users\Gloria\Desktop\Kratos\scripts>CALL :add_app applications\FluidDynamicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APPLICATIONS=applications\EigenSolversApplication;applications\StructuralMechanicsApplication;applications\FluidDynamicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>goto:eof

C:\Users\Gloria\Desktop\Kratos\scripts>CALL :add_app applications\ParticleMechanicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>set KRATOS_APPLICATIONS=applications\EigenSolversApplication;applications\StructuralMechanicsApplication;applications\FluidDynamicsApplication;applications\ParticleMechanicsApplication;

C:\Users\Gloria\Desktop\Kratos\scripts>goto:eof

C:\Users\Gloria\Desktop\Kratos\scripts>rem Clean

C:\Users\Gloria\Desktop\Kratos\scripts>del /F /Q "~0,-1/../build\Release\cmake_install.cmake" Impossibile trovare il file specificato.

C:\Users\Gloria\Desktop\Kratos\scripts>del /F /Q "~0,-1/../build\Release\CMakeCache.txt" Impossibile trovare il file specificato.

C:\Users\Gloria\Desktop\Kratos\scripts>del /F /Q "~0,-1/../build\Release\CMakeFiles" Impossibile trovare il file specificato.

C:\Users\Gloria\Desktop\Kratos\scripts>rem Configure

C:\Users\Gloria\Desktop\Kratos\scripts>cmake -G"Visual Studio 15 2017" -A x64 -H"~0,-1/.." -B"~0,-1/../build\Release"-DUSE_EIGEN_MKL=OFF -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134. -- No KRATOS_SOURCE_DIR is defined, using: C:/Users/Gloria/Desktop/Kratos -- No KRATOS_BINARY_DIR is defined, using: C:/Users/Gloria/Desktop/Kratos/build/Release-DUSE_EIGEN_MKL=OFF -- No INSTALL_RUNKRATOS is defined, setting to ON -- No KRATOS_INSTALL_PYTHON_USING_LINKS is defined, setting to OFF -- No KRATOS_BUILD_TESTING is defined. Setting to ON -- No CMAKE_INSTALL_MESSAGE is defined. Setting to NEVER -- CMAKE_SYSTEM_NAME = Windows Detected compiler as MSVC -- User defined install dir C:/Users/Gloria/Desktop/Kratos/bin/Release -- OpenMP included -- Boost Include: C:/Users/Gloria/Desktop/boost_1_73_0/boost_1_73_0 -- Boost Linkdir: -- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR) -- Preparing local ZLIB compilation. -- AMatrix not found. Please define the AMATRIX_DIR pointing to the AMatrix root directory.

CMAKE_BUILD_TYPE ........ Release

WARNING: YOUR GIDPOST IS BEING COMPILED WITHOUT DEBUG (ALL ASSERTS WILL BE AVOIDED) -- Configuring applications (ENV): Adding application 'applications\EigenSolversApplication' configuring KratosEigenSolversApplication Adding application 'applications\StructuralMechanicsApplication' configuring KratosStructuralMechanicsApplication Adding application 'applications\FluidDynamicsApplication' configuring KratosFluidDynamicsApplication Adding application 'applications\ParticleMechanicsApplication' configuring KratosParticleMechanicsApplication


    LIST OF APPLICATIONS THAT ARE GOING TO BE COMPILED:

    EigenSolversApplication
    StructuralMechanicsApplication
    FluidDynamicsApplication
    ParticleMechanicsApplication

    APPLICATIONS ADDED TO COMPILATION THROUGH DEPENDENCIES:

List of upcoming api-breaking changes: Making variables non-copiable: https://github.com/KratosMultiphysics/Kratos/pull/6339 Deprecation of NOT_FLAGS : https://github.com/KratosMultiphysics/Kratos/pull/6233 Removing long deprecated conditions : https://github.com/KratosMultiphysics/Kratos/pull/6475 Changing 'FindNodalNeighboursProcess' constructor signature: https://github.com/KratosMultiphysics/Kratos/pull/4947 Minor update of import mechanism for applications: https://github.com/KratosMultiphysics/Kratos/pull/6556 -- triangle : C:/Users/Gloria/Desktop/Kratos/external_libraries/triangle python libraries to be installed are: C:/Users/Gloria/AppData/Local/Programs/Python/Python36/libs/python36.lib -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Gloria/Desktop/Kratos/build/Release-DUSE_EIGEN_MKL=OFF

C:\Users\Gloria\Desktop\Kratos\scripts>rem Build

C:\Users\Gloria\Desktop\Kratos\scripts>cmake --build "~0,-1/../build/Release" --target install -- /property:configuration=Release /p:Platform=x64 Microsoft (R) Build Engine versione 15.9.21+g9802d43bc3 per .NET Framework Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.

MSBUILD : error MSB1009: il file di progetto non esiste. Opzione: install.vcxproj

C:\Users\Gloria\Desktop\Kratos\scripts>goto:eof

C:\Users\Gloria\Desktop\Kratos\scripts>

roigcarlo commented 4 years ago

Thx!

Seems that there is a problem around the line

cmake -G"Visual Studio 15 2017" -A x64 -H"%KRATOS_SOURCE%" -B"%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%"          ^
-DUSE_EIGEN_MKL=OFF

My guess is that ^ is missing or there is a missing space between -B"%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" and -DUSE_EIGEN_MKL=OFF

Not quite sure what it is because the output is a bit preprocessed in the log, but I would say is the missing space.

Could you check if any of this fixes the problem?

gpietrop commented 4 years ago

Well, now finally it seems to work becuase, as you can see, the output says 'Configuring Done' and 'Generating Done' correct The only problem left to solve is the one in the last line. Indeed, I tried to compile the generated file 'KratosMultiphysics.sln' on Visual Studio 2017, by running the 'INSTALL' file, but the result is the following: problemavisualstudio I don't know really how to solve this problem.. What can I do? Anyway, thank you so much for your patience @roigcarlo !

roigcarlo commented 4 years ago

I am afraid problem seems the same.

The line Build files have been written to: C:/Users/Gloria/Desktop/Kratos/build/Release-DUSE_EIGEN_MKL=OFF

Its the problem, that means that is somehow merging the MKL option and the build path into a single string, so it thinks that the build path is "Release-DUSE_EIGEN_MKL=OFF" instead of "Release" and hence is unable to find the install project.

Try to delete C:/Users/Gloria/Desktop/Kratos/build folder and try with this one: https://pastebin.com/GbfvJABd

gpietrop commented 4 years ago

evviva Thank you sincerely, after 18 hours it ended up (these are just the last lines, the entire output is very very long), and no errors occur during the process! Now there is a new folder 'build' inside my Kratos folder with the 'KratosMultiphysics.sln' code! Is there, now, anything else that I should do? Or is everything set? Thank you again for your valuable advice @roigcarlo, and for your patience!

roigcarlo commented 4 years ago

Hi @GloriaPietropolli

If it all went correctly you should have a bin folder where the installation is located. If you have that folder you can just follow the steps in https://github.com/KratosMultiphysics/Kratos/blob/master/INSTALL.md#post-compilation

If that folder is missing it means an error may have appeared. its easy to miss, specially in windows as the wall text is no joke. If that's the case rerunning the script again should jump directly to the error so its easier (and faster) to see

gpietrop commented 4 years ago

@roigcarlo I have the 'bin' folder. Inside the bin folder I have the 'Relase' folder. Inside the Relase folder I have the 'libs' folder, but this last older contains only two files.. I think they are not enough, should I repeat the procedure? if the answer is yes, should I delete some folder before repeating the procedure?

roigcarlo commented 4 years ago

You should definitely have more, try to rerun the configure file.

It should not take long either by creating the other files you need or by giving a meaningfull error/warning

roigcarlo commented 4 years ago

Hi @GloriaPietropolli any news with the installation?

Virginiasam commented 4 years ago

Hi @roigcarlo , I'm trying to compile Kratos but got the fatal error C1083 Here attached the message

C:\Virginia\Kratos\scripts>cmake -G"Visual Studio 16 2019" -A x64 -H"~0,-1/.." -B"~0,-1/../build\Release" -DUSE_EIGEN_MKL=OFF -- No KRATOS_SOURCE_DIR is defined, using: C:/Virginia/Kratos -- No KRATOS_BINARY_DIR is defined, using: C:/Virginia/Kratos/build/Release -- No INSTALL_RUNKRATOS is defined, setting to ON -- No KRATOS_INSTALL_PYTHON_USING_LINKS is defined, setting to OFF -- No KRATOS_BUILD_TESTING is defined. Setting to ON -- No CMAKE_INSTALL_MESSAGE is defined. Setting to NEVER -- CMAKE_SYSTEM_NAME = Windows Detected compiler as MSVC -- User defined install dir C:/Program Files (x86)/KratosMultiphysics -- OpenMP included -- Boost Include: C:/Virginia/Multiphysics/Boost/boost_1_74_0 -- Boost Linkdir: -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Preparing local ZLIB compilation. -- AMatrix not found. Please define the AMATRIX_DIR pointing to the AMatrix root directory.

CMAKE_BUILD_TYPE ........ Release

WARNING: YOUR GIDPOST IS BEING COMPILED WITHOUT DEBUG (ALL ASSERTS WILL BE AVOIDED) -- Configuring applications (ENV): Adding application 'applications\LinearSolversApplication' configuring KratosLinearSolversApplication Adding application 'applications\StructuralMechanicsApplication' configuring KratosStructuralMechanicsApplication Adding application 'applications\FluidDynamicsApplication' configuring KratosFluidDynamicsApplication


    LIST OF APPLICATIONS THAT ARE GOING TO BE COMPILED:

    LinearSolversApplication
    StructuralMechanicsApplication
    FluidDynamicsApplication

    APPLICATIONS ADDED TO COMPILATION THROUGH DEPENDENCIES:

List of upcoming api-breaking changes: Making variables non-copiable: https://github.com/KratosMultiphysics/Kratos/pull/6339 Deprecation of NOT_FLAGS : https://github.com/KratosMultiphysics/Kratos/pull/6233 Removing long deprecated conditions : https://github.com/KratosMultiphysics/Kratos/pull/6475 Changing 'FindNodalNeighboursProcess' constructor signature: https://github.com/KratosMultiphysics/Kratos/pull/4947 Minor update of import mechanism for applications: https://github.com/KratosMultiphysics/Kratos/pull/6556 -- triangle : C:/Virginia/Kratos/external_libraries/triangle python libraries to be installed are: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/libs/python37.lib -- Configuring done -- Generating done -- Build files have been written to: C:/Virginia/Kratos/build/Release

C:\Virginia\Kratos\scripts>rem Build

C:\Virginia\Kratos\scripts>cmake --build "~0,-1/../build/Release" --target install -- /property:configuration=Release /p:Platform=x64 Microsoft(R) Build Engine versão 16.7.0+b89cb5fde para .NET Framework Copyright (C) Microsoft Corporation. Todos os direitos reservados.

Checking Build System KratosVersion.vcxproj -> C:\Virginia\Kratos\build\Release\kratos\KratosVersion.dir\Release\KratosVersion.lib Building Custom Rule C:/Virginia/Kratos/external_libraries/zlib/CMakeLists.txt zlib.vcxproj -> C:\Virginia\Kratos\build\Release\external_libraries\zlib\Release\zlib.dll Building Custom Rule C:/Virginia/Kratos/external_libraries/gidpost/CMakeLists.txt gidpost.vcxproj -> C:\Virginia\Kratos\build\Release\external_libraries\gidpost\Release\gidpost.lib triangle.vcxproj -> C:\Virginia\Kratos\build\Release\external_libraries\triangle\Release\triangle.lib flags.cpp global_variables.cpp deprecated_variables.cpp c2c_variables.cpp cfd_variables.cpp mesh_moving_variables.cpp mapping_variables.cpp dem_variables.cpp fsi_variables.cpp mat_variables.cpp global_pointer_variables.cpp variables.cpp kratos_application.cpp integration_rules.cpp communicator.cpp serializer.cpp kernel.cpp periodic_condition.cpp constitutive_law.cpp kratos_components.cpp Gerando Código... C:\Virginia\Kratos\kratos\sources\kernel.cpp : fatal error C1083: Não é possível abrir arquivo gerado pelo compilador: 'C:\Virginia\Kratos\build\Release\kratos\KratosCore.dir\Release\kernel.obj': Permission denied [C:\Virginia\Kratos\buil d\Release\kratos\KratosCore.vcxproj]

Virginiasam commented 4 years ago

@roigcarlo Can you please help me with this?

roigcarlo commented 4 years ago

Hi, @Virginiasam

That error means the file is missing or you have no permission to open it. Could you check that the file exists and you have read rights (right click, properties)?

If the file is not there should be enough updating the repo

loumalouomega commented 4 years ago

Plan B @Virginiasam, you can try with MinGW https://github.com/KratosMultiphysics/Kratos/wiki/Windows-Install-(MinGW) (it is like using GNU/Linux at the end)

loumalouomega commented 4 years ago

BTW, did we included MinGW in the common installation instructions?

roigcarlo commented 4 years ago

@loumalouomega We did not included because we prefer not to use that method in windows. All guides and tutorials in Kratos for win are made with the visual studio compilation in mind.

Virginiasam commented 4 years ago

It seems it works now. image How can I test it? do I need to create a test.py script in a certain location? can I execute a file test.py containing only "from KratosMultiphysics import *" and call this file in Prompt?

Virginiasam commented 4 years ago

Thank you, @roigcarlo and @loumalouomega ! Now I can see the files in the release folder. I tried the "runkratos.exe" script but I get the message that it can't find "python37.dll". How can I fix this?

loumalouomega commented 4 years ago

Did you add the corresponding environment variables?

loumalouomega commented 4 years ago

https://github.com/KratosMultiphysics/Kratos/blob/master/INSTALL.md

loumalouomega commented 4 years ago

image

loumalouomega commented 4 years ago

image image image Can you check that Kratos is there?

Virginiasam commented 4 years ago

Gracias! It works now! image

loumalouomega commented 4 years ago

Gracias! It works now! image

imagen

roigcarlo commented 4 years ago

Closing since its solved. Thx all.