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.02k stars 245 forks source link

Error with configuration in windows 7 #4284

Closed Glovedsasquatchcodes closed 5 years ago

Glovedsasquatchcodes commented 5 years ago

When configuring with cmake on windows 7 I am getting the following errors.

The C compiler identification is MSVC 19.0.24215.1 The CXX compiler identification is MSVC 19.0.24215.1 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done Undefined CMAKE_BUILD_TYPE, building in 'Release' mode. Found Git: C:/Program Files (x86)/Git/cmd/git.exe (found version "2.16.2.windows.1") fatal: Not a git repository (or any of the parent directories): .git

Detected compiler as MSVC KRATOS_BUILD_TESTING not defined. Setting to ON Found PythonInterp: C:/ProgramData/Anaconda2/envs/py35/python.exe (found version "1.4") CMake Error at cmake_modules/FindPythonLibsNew.cmake:95 (message): Python config failure:

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

Configuring incomplete, errors occurred! See also "D:/Projects/Kratos_Multiphysics/Kratos_installation/Kratos/CMakeFiles/CMakeOutput.log".

=================================================================== My configure.bat file looks like this: del CMakeCache.txt :: this is an example file...please DO NOT MODIFY if you don't want to do it for everyone :: to use it, copy it to another file and run it

cls

:: you may want to decomment this the first time you compile del CMakeCache.txt

cmake -G "Visual Studio 14 2015 Win64" ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS " ^ -DBOOST_ROOT="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\boost_1_69_0" ^ -DPYTHON_EXECUTABLE="C:\ProgramData\py35\python\Anaconda2\envs\py35\python.exe" ^ -DLAPACK_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\libs\liblapack.lib" ^ -DBLAS_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\libs\libblas.lib" ^ -DMESHING_APPLICATION=ON ^ -DEXTERNAL_SOLVERS_APPLICATION=ON ^ -DSTRUCTURAL_MECHANICS_APPLICATION=ON ^ -DCONVECTION_DIFFUSION_APPLICATION=ON ^ -DSOLID_MECHANICS_APPLICATION=ON ^ -DCONSTITUTIVE_MODELS_APPLICATION=ON ^ -DFLUID_DYNAMICS_APPLICATION=ON ^ -DMESH_MOVING_APPLICATION=ON ^ -DFSI_APPLICATION=ON ^ -DDEM_APPLICATION=OFF ^ -DSWIMMING_DEM_APPLICATION=OFF ^ -DINSTALL_PYTHON_FILES=ON ^ -DINSTALL_EMBEDDED_PYTHON=ON ^ -DEXCLUDE_ITSOL=ON ^ ..

roigcarlo commented 5 years ago

Hi @Glovedsasquatchcodes ,

Seems that cmake is not able to find the python library, this may be caused because you are trying to use anaconda instead of a regular python version, which is fine, but may cause some modules become harder to find.

Could yo try to add -DPYTHON_LIBRARIES= so it points to your python35.dll file? It should be somewhere inside the anaconda folder.

For example:

 -DPYTHON_LIBRARIES="C:\ProgramData\py35\python\Anaconda2\envs\py35\python35.dll" ^
Glovedsasquatchcodes commented 5 years ago

Hi @roigcarlo , I tried doing what you said but it didn't work. So, I removed the python and installed it fresh from the source (without anaconda package manager). I continuing with both the -DPYTHON_LIBRARIES and -DPYTHON_EXECUTABLE in the configure.bat file setting them to the correct path that I obtain from the windows command prompt. However, the error now this seems to be the error.

Detected compiler as MSVC KRATOS_BUILD_TESTING not defined. Setting to ON CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) Call Stack (most recent call first): C:/Program Files (x86)/CMake/share/cmake-3.9/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE) C:/Program Files (x86)/CMake/share/cmake-3.9/Modules/FindPythonInterp.cmake:152 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake_modules/FindPythonLibsNew.cmake:60 (find_package) cmake_modules/pybind11Tools.cmake:16 (find_package) CMakeLists.txt:196 (include)

What do you think is the way forward? I tried looking up for a response and saw most of it was to do with Ubuntu, so I feel a little clueless.

roigcarlo commented 5 years ago

Hi @Glovedsasquatchcodes the error seems to be the same. Could you send me the configuration file so I can take a look?

Glovedsasquatchcodes commented 5 years ago

Yeah, I understand that except that I was trying to eliminate the Anaconda package manager. Here, is the file:

del CMakeCache.txt
:: this is an example file...please DO NOT MODIFY if you don't want to do it for everyone
:: to use it, copy it to another file and run it

cls

:: you may want to decomment this the first time you compile
del CMakeCache.txt

cmake -G "Visual Studio 14 2015 Win64"                                              ^
-DCMAKE_BUILD_TYPE=Release                                                          ^
-DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS "                                     ^
-DBOOST_ROOT="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\boost_1_69_0"  ^
-DPYTHON_LIBRARIES="C:\Users\Z003YZ8N\AppData\Local\Programs\Python\Python37\python37.dll" ^
-DPYTHON_EXECUTABLE="C:\Users\Z003YZ8N\AppData\Local\Programs\Python\Python37\python.exe"  ^
-DLAPACK_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\libs\liblapack.lib" ^
-DBLAS_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_support_lib_DND\libs\libblas.lib"     ^
-DMESHING_APPLICATION=ON                                                            ^
-DEXTERNAL_SOLVERS_APPLICATION=ON                                                   ^
-DSTRUCTURAL_MECHANICS_APPLICATION=ON                                               ^
-DCONVECTION_DIFFUSION_APPLICATION=ON                                               ^
-DSOLID_MECHANICS_APPLICATION=ON                                                    ^
-DCONSTITUTIVE_MODELS_APPLICATION=ON                                                ^
-DFLUID_DYNAMICS_APPLICATION=ON                                                     ^
-DMESH_MOVING_APPLICATION=ON                                                                ^
-DFSI_APPLICATION=ON                                                                ^
-DDEM_APPLICATION=OFF                                                               ^
-DSWIMMING_DEM_APPLICATION=OFF                                                      ^
-DINSTALL_PYTHON_FILES=ON                                                           ^
-DINSTALL_EMBEDDED_PYTHON=ON                                                        ^
-DEXCLUDE_ITSOL=ON                                                                  ^
..
roigcarlo commented 5 years ago

Dear @Glovedsasquatchcodes, you can have as many installations of python as you want (same for the anaconda package manger). Can you try to add this in the configure script, just before the cmake command:

set PYTHONHOME=C:\Users\Z003YZ8N\AppData\Local\Programs\Python\Python37\

That should avoid problems with the python interpreter.

Glovedsasquatchcodes commented 5 years ago

Dear @roigcarlo , The exact same error repeats. Initially, I had checked the python package path is available within the environment variable. So, is this command making the entire folder available to cmake while configuration?

Nevertheless, I do not really understand why is the same problem repeating again.

roigcarlo commented 5 years ago

Hi @Glovedsasquatchcodes, answering your first question, the set PYTHONHOME command should change the default location where the python interpreter looks for the its standard libraries (like os, sys, etc...). Normally you don't want to touch this variable, but sometimes it helps if several python versions are in the same machine.

PYTHONPATH is somehow similar but it only work for python modules (for example, numpy, scipy, etc...). It should not have any impact in the tests that cmake performs, but its better if its not set while executing the configure.

As for the error, it can be triggered in two situations, either because there is no python.exe file in the specified location (which do not seems to be the case), or because cmake is unable to execute the interpreter. At the same time not being able to execute the interpreter could be a symptom of multiple problems, the most common of them being not able to import some required standard libs (hence my suggestion to test setting the PYTHONHOME).

So at the sight of the results, what I could try is:

With that info we should get able to get an idea of what is happening...

Glovedsasquatchcodes commented 5 years ago

Dear @roigcarlo , I checked all the three things that you mentioned in the bullet points. And all of them works fine. In fact when I type the command:

C:\Users\Z003YZ8N>where python C:\Users\Z003YZ8N\AppData\Local\Programs\Python\Python37\python.exe which confirms the presence of the python path in the environment variables. I also cross-checked the environment variables and found this to be the case.

I also ran a small test code from both the python shell and the command prompt and both worked without an error. So, as far as my understanding goes this might be a problem with something else.

Glovedsasquatchcodes commented 5 years ago

Dear @roigcarlo , I abandoned configuration using the configure.bat file and instead followed the cmake interface version 3.9.4. It worked now and am installing Kratos now. Will update you tomorrow on how it goes (upon its completion).

Glovedsasquatchcodes commented 5 years ago

Dear @roigcarlo , Sorry for the delay in updating this thread. The installation through cmake GUI worked very nicely.

When it come to configuring using the shell command line, I realized very late that the configure file should have the path to the cmake.exe as shown:

`del CMakeCache.txt :: this is an example file...please DO NOT MODIFY if you don't want to do it for everyone :: to use it, copy it to another file and run it

cls

:: you may want to decomment this the first time you compile del CMakeCache.txt

"C:\Program Files (x86)\CMake\bin\cmake.exe" -G "Visual Studio 14 2015 Win64" ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_CXX_FLAGS=" -D_SCL_SECURE_NO_WARNINGS " ^ -DBOOST_ROOT="D:\Projects\Kratos_Multiphysics\Kratos_installation\Kratos_support_lib_DND\boost_1_69_0" ^ -DPYTHON_EXECUTABLE="C:\Users\Z003YZ8N\AppData\Local\Programs\Python\Python37\python.exe" ^ -DLAPACK_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_installation\Kratos_support_lib_DND\libs\liblapack.lib" ^ -DBLAS_LIBRARIES="D:\Projects\Kratos_Multiphysics\Kratos_installation\Kratos_support_lib_DND\libs\libblas.lib" ^ -DMESHING_APPLICATION=ON ^ -DEXTERNAL_SOLVERS_APPLICATION=ON ^ -DSTRUCTURAL_MECHANICS_APPLICATION=ON ^ -DCONVECTION_DIFFUSION_APPLICATION=ON ^ -DSOLID_MECHANICS_APPLICATION=ON ^ -DCONSTITUTIVE_MODELS_APPLICATION=ON ^ -DFLUID_DYNAMICS_APPLICATION=ON ^ -DMESH_MOVING_APPLICATION=ON ^ -DFSI_APPLICATION=ON ^ -DDEM_APPLICATION=ON ^ -DCONTACT_STRUCTURAL_MECHANICS_APPLICATION=ON ^ -DSWIMMING_DEM_APPLICATION=ON ^ -DMIXED_ELEMENT_APPLICATION=ON ^ -DSHAPE_OPTIMIZATION_APPLICATION=ON ^ -DINSTALL_PYTHON_FILES=ON ^ -DINSTALL_EMBEDDED_PYTHON=ON ^ -DEXCLUDE_ITSOL=ON ^ ..`

This is very important if the same is not available in the path (in the Environment variables interface). So, this issue is resolved and I am closing it.

roigcarlo commented 5 years ago

Hi @Glovedsasquatchcodes

Glad to hear it worked. I will note down the issue with the CMake and add it to the troubleshot section.