Author Topic: MacOS issue(s) to install Kratos  (Read 3027 times)

carlosbenitos

  • Newbie
  • *
  • Posts: 5
MacOS issue(s) to install Kratos
« on: December 02, 2016, 06:56:22 PM »
Hello every body !!

My name is Charles-Benoît BONNARD, a French engeener student in his last year and I have to present a finite element software, so I chose Kratos.

I didn’t succed to install Kratos properly on my Macpookpro…
I’ve done all the step that are shown in the Wikki, but at the end when I run the .sh to mount Kratos I have this:

Code: [Select]
Script started on Fri Dec  2 18:24:32 2016
[?1034hbash-3.2$ topsh release_configure.sh
-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/local/bin/clang-omp
-- Check for working C compiler: /usr/local/bin/clang-omp -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/clang-omp++
-- Check for working CXX compiler: /usr/local/bin/clang-omp++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Subversion: /usr/bin/svn (found version "1.9.4")
KRATOS_EXCLUDE_OPENMP
OpenMP included
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp 
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   python
-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found version "3.6.0b4")
 
CMAKE_BUILD_TYPE ........ Release
 
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
 
INCOMPRESSIBLE_FLUID_APPLICATION ...
MESHING_APPLICATION ................
EXTERNAL_SOLVERS_APPLICATION........
PFEM_APPLICATION....................
STRUCTURAL_APPLICATION..............
STRUCTURAL_MECHANICS_APPLICATION....
CONVECTION_DIFFUSION_APPLICATION....
SOLID_MECHANICS_APPLICATION.........
PFEM_BASE_APPLICATION...............
PFEM_SOLID_MECHANICS_APPLICATION....
MACHINING_APPLICATION...............
FLUID_DYNAMICS_APPLICATION..........
PFEM_FLUID_DYNAMICS_APPLICATION.....
STRING_DYNAMICS_APPLICATION.........
ALE_APPLICATION.....................
FSI_APPLICATION.....................
EMPIRE_APPLICATION..................
MIXED_ELEMENT_APPLICATION...........
DEM_APPLICATION.....................
SWIMMING_DEM_APPLICATION............
CONSTITUTIVE_LAWS_APPLICATION.......
THERMO_MECHANICAL_APPLICATION.......
OPENCL_APPLICATION..................
MKL_SOLVERS_APPLICATION.............
MPI_SEARCH_APPLICATION..............
METIS_APPLICATION...................
TRILINOS_APPLICATION................
TURBULENT_FLOW_APPLICATION..........
BLOOD_FLOW_APPLICATION..............
PURE_DIFFUSION_APPLICATION..........
MESHLESS_APPLICATION................
WIND_TURBINE_APPLICATION ...........
CLICK2CAST_APPLICATION .............
MULTISCALE_APPLICATION .............
PFEM2_APPLICATION...................
FREEZING_SOIL_APPLICATION...........
ADJOINT_FLUID_APPLICATION...........
POROMECHANICS_APPLICATION...........
PARTICLE_MECHANICS_APPLICATION......
FORMING_APPLICATION.................
DAM_APPLICATION.....................
SHAPE_OPTIMIZATION_APPLICATION......
TOPOLOGY_OPTIMIZATION_APPLICATION...
MY_LAPLACIAN_APPLICATION............
LAGRANGIAN_MPM_APPLICATION..........
CONTACT_MECHANICS_APPLICATION.......
CONTACT_STRUCTURAL_MECHANICS_APPLICATION.......
MAPPING_APPLICATION.................
 
--------------------------------  standard install dir /Users/Charles-BenoitBONNARD/kratos/kratos
boost python lib used = /opt/local/lib/libboost_python-mt.dylib
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   Kratos
   KratosCore
   zlib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/Charles-BenoitBONNARD/kratos/kratos/cmake_build
release_configure.sh: line 36: -DBOOST_ROOT=/Users/Charles-BenoitBONNARD/kratos/kratos/external_libraries/boost_1_61_0: No such file or directory
release_configure.sh: line 43: -DSOLID_MECHANICS_APPLICATION=ON: command not found
release_configure.sh: line 69: -DEXCLUDE_ITSOL=ON: command not found
[ 25%] Built target zlibstatic
[ 26%] Built target zlib
[ 32%] Built target gidpost
[ 35%] Built target minigzip
[ 35%] Built target example
[ 61%] Built target KratosCore
[ 62%] Linking CXX shared library Kratos.so
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib' is not a directory
Undefined symbols for architecture x86_64:
  "__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE", referenced from:
      _PyInit_Kratos in kratos_python.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kratos/Kratos.so] Error 1
make[1]: *** [kratos/CMakeFiles/Kratos.dir/all] Error 2
make: *** [all] Error 2
[ 13%] Built target zlibstatic
[ 26%] Built target zlib
[ 28%] Built target example
[ 30%] Built target minigzip
[ 35%] Built target gidpost
[ 61%] Built target KratosCore
[ 62%] Linking CXX shared library Kratos.so
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib' is not a directory
Undefined symbols for architecture x86_64:
  "__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE", referenced from:
      _PyInit_Kratos in kratos_python.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kratos/Kratos.so] Error 1
make[1]: *** [kratos/CMakeFiles/Kratos.dir/all] Error 2
make: *** [all] Error 2


I saw that was an issue in the Wikki page but I am a newbi on Unix so I don’t know what I didn’t do or did wrong …

Thank you for your help,

CBB.
« Last Edit: December 02, 2016, 06:58:37 PM by carlosbenitos »

Ignasi de Pouplana

  • Newbie
  • *
  • Posts: 21
Re: MacOS issue(s) to install Kratos
« Reply #1 on: December 02, 2016, 08:08:58 PM »
Hello Charles,

I was looking through the output of your compilation and there are some strange messages (e.g. -DEXCLUDE_ITSOL=ON: command not found...).

Could you please paste here your configuration file (release_configure.sh)? Perhaps there are some flags you did not properly set...

Regards,

Ignasi

carlosbenitos

  • Newbie
  • *
  • Posts: 5
Re: MacOS issue(s) to install Kratos
« Reply #2 on: December 02, 2016, 08:16:21 PM »
Thank you Ignasi !

Code: [Select]

#!/bin/sh

# 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

# additional compiler flags could be added customizing the corresponding var, for example
# -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 ". Note that the "defaults are already correctly coded"
#so we should ass here only machine specific stuff

#an effort is made to autodetect all of the libraries needed HOWEVER:
#METIS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#TRILINOS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#MKL_SOLVERS_APPLICATION needs the var MKLSOLVER_INCLUDE_DIR and MKLSOLVER_LIB_DIR to be specified by the user (not needed if the app is set to OFF)
#note that the MKLSOLVER_LIB_DIR should include /lib/em64t. This is needed as intel is changing location of mkl at every update of the compiler!!

#the user should also note that the symbol "\" marks that the command continues on the next line. IT SHOULD ONLY BE FOLLOWED
#BY the "ENTER" and NOT by any space!!

clear

#you may want to decomment this the first time you compile
rm CMakeCache.txt
rm *.cmake
rm -rf CMakeFiles\

/Applications/CMake.app/Contents/bin/cmake ..                                                 \
-DCMAKE_C_COMPILER=/usr/local/bin/clang-omp                                          \
-DCMAKE_INSTALL_RPATH="/home/Charles-BenoitBONNARD/kratos/kratos/libs"                                 \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE                                         \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang-omp++                                      \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11 "                          \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 "                                \
-DCMAKE_BUILD_TYPE=Release                                        \

-DBOOST_ROOT="/Users/Charles-BenoitBONNARD/kratos/kratos/external_libraries/boost_1_61_0"                        \
-DBOOST_LIBRARYDIR="/Users/Charles-BenoitBONNARD/kratos/kratos/external_libraries/boost_1_61_0/stage/lib"        \
-DPYTHON_LIBRARY="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"                  \
-DPYTHON_INCLUDE_DIR="/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m" \
-DLAPACK_LIBRARIES="/usr/lib/liblapack.dylib"                                                 \
-DBLAS_LIBRARIES="/usr/lib/libblas.dylib"                                                       \

-DSOLID_MECHANICS_APPLICATION=ON                                        \
-DFLUID_DYNAMICS_APPLICATION=ON                                        \
-DCONVECTION_DIFFUSION_APPLICATION=ON                                \
-DDEM_APPLICATION=OFF                                                \
-DSWIMMING_DEM_APPLICATION=OFF                                                     \
-DINCOMPRESSIBLE_FLUID_APPLICATION=ON                                     \
-DMESHING_APPLICATION=ON                                            \
-DEXTERNAL_SOLVERS_APPLICATION=ON                                      \
-DPFEM_APPLICATION=ON                                              \
-DSTRUCTURAL_APPLICATION=ON                                        \
-DSTRUCTURAL_MECHANICS_APPLICATION=ON                                    \
-DALE_APPLICATION=ON                                                \
-DFSI_APPLICATION=ON                                              \
-DOPENCL_APPLICATION=OFF                                              \
-DMIXED_ELEMENT_APPLICATION=ON                                      \
-DMKL_SOLVERS_APPLICATION=OFF                                          \
-DMKLSOLVER_INCLUDE_DIR="/opt/intel/Compiler/11.1/072/mkl/include"             \
-DMKLSOLVER_LIB_DIR="/opt/intel/Compiler/11.1/072/mkl/lib/em64t"               \
-DMETIS_APPLICATION=OFF                                              \
-DPARMETIS_ROOT_DIR="/home/Charles-BenoitBONNARD/kratos/compiled_libraries/ParMetis-3.1.1"               \
-DTRILINOS_APPLICATION=OFF                                            \
-DTRILINOS_ROOT="/home/Charles-BenoitBONNARD/kratos/compiled_libraries/trilinos-10.2.0"           \
-DINSTALL_EMBEDDED_PYTHON=ON                                                       \
-DSHAPE_OPTIMIZATION_APPLICATION=OFF \
-DTOPOLOGY_OPTIMIZATION_APPLICATION=OFF
-DEXCLUDE_ITSOL=ON                                                                           \


#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j4
make install



Ignasi de Pouplana

  • Newbie
  • *
  • Posts: 21
Re: MacOS issue(s) to install Kratos
« Reply #3 on: December 02, 2016, 08:55:05 PM »
Ok Charles, I found various things that could be wrong in your configuration file. I am writing all of them in a list:

1. In release_configure.sh you have:
-DCMAKE_INSTALL_RPATH="/home/Charles-BenoitBONNARD/kratos/kratos/libs"                                         \
but if your are in macOS, your "home folder" is in /Users/Charles-BenoitBONNARD.

2. In release_configure.sh you have:
-DBOOST_LIBRARYDIR="/Users/Charles-BenoitBONNARD/kratos/kratos/external_libraries/boost_1_61_0/stage/lib"        \
while in the compilation output it appeared Boost version: 1.59.0. Check which is the boost version you have installed and write the proper path.

3. In release_configure.sh you have:
-DPYTHON_LIBRARY="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"                                 \
-DPYTHON_INCLUDE_DIR="/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m"                   \

and in the compilation output:
Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib (found version "3.6.0b4")
Again, check which is the version of python 3 you have installed and put the proper paths.

4. After the -DTOPOLOGY_OPTIMIZATION_APPLICATION=OFF you don't have the backslash \:
-DSHAPE_OPTIMIZATION_APPLICATION=OFF                                                          \
-DTOPOLOGY_OPTIMIZATION_APPLICATION=OFF
-DEXCLUDE_ITSOL=ON                                                                           \

5. I don't think there is a problem in separating groups of orders by two enters, but just in case, separate them just with one enter.

Please, check these five points and then try compiling again. If you encounter any other issue, feel free to ask once more.

Regards,

Ignasi

carlosbenitos

  • Newbie
  • *
  • Posts: 5
Re: MacOS issue(s) to install Kratos
« Reply #4 on: December 03, 2016, 01:31:55 AM »
I would like to say a Big Thanks to you !

I did succed to all of the 5 steps !

For the 1), you were right.
2) I had the wrong boost version.
3) I forgot the "6" at the end.

For the 4) and the 5) I corrected them.

What I have now.


 I see the three warnings that the wikki talk about but after that I can't open Kratos in the python3 terminal. After enter "from KratosMultiphysics import *" nothing happen.

Code: [Select]

[?1034hbash-3.2$ exitsh release_configure.sh
-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/local/bin/clang-omp
-- Check for working C compiler: /usr/local/bin/clang-omp -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/clang-omp++
-- Check for working CXX compiler: /usr/local/bin/clang-omp++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Subversion: /usr/bin/svn (found version "1.9.4")
KRATOS_EXCLUDE_OPENMP
OpenMP included
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp 
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   python
-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 (found version "3.6.0b4")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- A library with BLAS API found.
linker flags with blas =
BLA_VENDOR = All
-- A library with BLAS API found.
-- A library with LAPACK API found.
LAPACK = /usr/lib/liblapack.dylib
LAPACK modified = /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
 
CMAKE_BUILD_TYPE ........ Release
 
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
 
INCOMPRESSIBLE_FLUID_APPLICATION ... ON
MESHING_APPLICATION ................ ON
EXTERNAL_SOLVERS_APPLICATION........ ON
PFEM_APPLICATION.................... ON
STRUCTURAL_APPLICATION.............. ON
STRUCTURAL_MECHANICS_APPLICATION.... ON
CONVECTION_DIFFUSION_APPLICATION.... ON
SOLID_MECHANICS_APPLICATION......... ON
PFEM_BASE_APPLICATION...............
PFEM_SOLID_MECHANICS_APPLICATION....
MACHINING_APPLICATION...............
FLUID_DYNAMICS_APPLICATION.......... ON
PFEM_FLUID_DYNAMICS_APPLICATION.....
STRING_DYNAMICS_APPLICATION.........
ALE_APPLICATION..................... ON
FSI_APPLICATION..................... ON
EMPIRE_APPLICATION..................
MIXED_ELEMENT_APPLICATION........... ON
DEM_APPLICATION..................... OFF
SWIMMING_DEM_APPLICATION............ OFF
CONSTITUTIVE_LAWS_APPLICATION.......
THERMO_MECHANICAL_APPLICATION.......
OPENCL_APPLICATION.................. OFF
MKL_SOLVERS_APPLICATION............. OFF
MPI_SEARCH_APPLICATION..............
METIS_APPLICATION................... OFF
TRILINOS_APPLICATION................ OFF
TURBULENT_FLOW_APPLICATION..........
BLOOD_FLOW_APPLICATION..............
PURE_DIFFUSION_APPLICATION..........
MESHLESS_APPLICATION................
WIND_TURBINE_APPLICATION ...........
CLICK2CAST_APPLICATION .............
MULTISCALE_APPLICATION .............
PFEM2_APPLICATION...................
FREEZING_SOIL_APPLICATION...........
ADJOINT_FLUID_APPLICATION...........
POROMECHANICS_APPLICATION...........
PARTICLE_MECHANICS_APPLICATION......
FORMING_APPLICATION.................
DAM_APPLICATION.....................
SHAPE_OPTIMIZATION_APPLICATION...... OFF
TOPOLOGY_OPTIMIZATION_APPLICATION... OFF
MY_LAPLACIAN_APPLICATION............
LAGRANGIAN_MPM_APPLICATION..........
CONTACT_MECHANICS_APPLICATION.......
CONTACT_STRUCTURAL_MECHANICS_APPLICATION.......
MAPPING_APPLICATION.................
 
**** configuring KratosIncompressibleFluidApplication ****
**** configuring KratosMeshingApplication ****
**** configuring KratosExternalSolversApplication ****
**** configuring KratosPFEMApplication ****
**** configuring KratosStructuralApplication ****
**** configuring KratosStructuralMechanicsApplication ****
**** configuring KratosConvectionDiffusionApplication ****
**** configuring KratosFluidDynamicsApplication ****
**** configuring KratosALEApplication ****
**** configuring KratosFSIApplication ****
**** configuring KratosMixedElementApplication ****
**** configuring KratosSolidMechanicsApplication ****
python libraries to be installed are: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
--------------------------------  standard install dir /Users/Charles-BenoitBONNARD/kratos/kratos
boost python lib used = /Users/Charles-BenoitBONNARD/kratos/kratos/external_libraries/boost_1_61_0/stage/lib/libboost_python.dylib
installed blas = /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
installed lapack = /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   Kratos
   KratosALEApplication
   KratosConvectionDiffusionApplication
   KratosCore
   KratosExternalSolversApplication
   KratosFSIApplication
   KratosFluidDynamicsApplication
   KratosIncompressibleFluidApplication
   KratosMeshingApplication
   KratosMixedElementApplication
   KratosPFEMApplication
   KratosSolidMechanicsApplication
   KratosStructuralApplication
   KratosStructuralMechanicsApplication
   zlib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    MKLSOLVER_INCLUDE_DIR
    MKLSOLVER_LIB_DIR
    PARMETIS_ROOT_DIR
    TRILINOS_ROOT


-- Build files have been written to: /Users/Charles-BenoitBONNARD/kratos/kratos/cmake_build
[  1%] Built target triangle
[  1%] Built target tetgen
[  7%] Built target zlib
[  8%] Built target zlibstatic
[ 10%] Built target tetMeshOpt
[ 10%] Linking CXX executable runkratos
[ 22%] Built target superlu
[ 22%] Built target example
[ 23%] Built target minigzip
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6' is not a directory
ld: warning: -L path '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib' is not a directory
ld: warning: -L path '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib' is not a directory
ld: can't link with a main executable file '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6' for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [embedded_python/runkratos] Error 1
make[1]: *** [embedded_python/CMakeFiles/runkratos.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 24%] Built target gidpost
make: *** [all] Error 2
[  4%] Built target zlibstatic
[  7%] Built target zlib
[  7%] Built target example
[  8%] Built target minigzip
[  9%] Built target gidpost
[  9%] Linking CXX shared library libKratosCore.dylib
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6' is not a directory
ld: warning: -L path '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib' is not a directory
ld: warning: -L path '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib' is not a directory
ld: can't link with a main executable file '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6' for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kratos/libKratosCore.dylib] Error 1
make[1]: *** [kratos/CMakeFiles/KratosCore.dir/all] Error 2
make: *** [all] Error 2


What do you thing ?

Regards,

CBB.

(PS: I should go to bed)

Ignasi de Pouplana

  • Newbie
  • *
  • Posts: 21
Re: MacOS issue(s) to install Kratos
« Reply #5 on: December 03, 2016, 10:23:03 AM »
Hello Charles,

you still have not compiled, there is an error at the end... Looking again at your compilation output I realised a couple of potential source of problems:

1. Do you really have kratos inside a folder named kratos?

-- Build files have been written to: /Users/Charles-BenoitBONNARD/kratos/kratos/cmake_build

If it is the case and you write the paths correctly, there should be no problem. If it is not, correct it.

2. I think you have a wrong path for the Python Library. You have:

-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 (found version "3.6.0b4")

But following the wiki it should be:

-DPYTHON_LIBRARY="/Library/Frameworks/Python.framework/Versions/3.6/Python"                  \

And that's it. You must try compiling again, and if everything is alright you should see something like this at the end:

Code: [Select]
-- Build files have been written to: /Users/ignasi/kratos/cmake_build
[ 10%] Built target zlib
[ 10%] Built target zlibstatic
[ 10%] Built target runkratos
[ 28%] Built target superlu
[ 29%] Built target example
[ 30%] Built target minigzip
[ 32%] Built target gidpost
[ 42%] Built target KratosCore
[ 43%] Built target KratosExternalSolversApplication
[ 47%] Built target KratosConvectionDiffusionApplication
[ 61%] Built target Kratos
[ 82%] Built target KratosSolidMechanicsApplication
[ 96%] Built target KratosPoromechanicsApplication
[100%] Built target KratosDamApplication
[  5%] Built target zlib
[  6%] Built target example
[ 11%] Built target zlibstatic
[ 12%] Built target minigzip
[ 14%] Built target gidpost
[ 24%] Built target KratosCore
[ 38%] Built target Kratos
[ 56%] Built target superlu
[ 57%] Built target KratosExternalSolversApplication
[ 61%] Built target KratosConvectionDiffusionApplication
[ 82%] Built target KratosSolidMechanicsApplication
[ 96%] Built target KratosPoromechanicsApplication
[100%] Built target KratosDamApplication
[100%] Built target runkratos
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/__init__.py
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/kratos_utilities.py
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/kratos_globals.py
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/application_importer.py
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/KratosUnittest.py
-- Up-to-date: /Users/ignasi/kratos/libs/libboost_python.dylib
-- Up-to-date: /Users/ignasi/kratos/libs/libBLAS.dylib
-- Up-to-date: /Users/ignasi/kratos/libs/libLAPACK.dylib
-- Installing: /Users/ignasi/kratos/libs/libz.1.2.8.dylib
-- Up-to-date: /Users/ignasi/kratos/libs/libz.1.dylib
-- Up-to-date: /Users/ignasi/kratos/libs/libz.dylib
-- Installing: /Users/ignasi/kratos/libs/libz.a
-- Installing: /Users/ignasi/kratos/libs/libKratosCore.dylib
-- Installing: /Users/ignasi/kratos/libs/Kratos.so
-- Installing: /Users/ignasi/kratos/libs/KratosExternalSolversApplication.so
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/ExternalSolversApplication.py
-- Installing: /Users/ignasi/kratos/libs/KratosConvectionDiffusionApplication.so
-- Installing: /Users/ignasi/kratos/libs/KratosConvectionDiffusionApplication.so
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/ConvectionDiffusionApplication.py
-- Installing: /Users/ignasi/kratos/libs/KratosSolidMechanicsApplication.so
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/SolidMechanicsApplication.py
-- Installing: /Users/ignasi/kratos/libs/KratosPoromechanicsApplication.so
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/PoromechanicsApplication.py
-- Installing: /Users/ignasi/kratos/libs/KratosDamApplication.so
-- Up-to-date: /Users/ignasi/kratos/KratosMultiphysics/DamApplication.py
-- Installing: /Users/ignasi/kratos/./runkratos
-- Up-to-date: /Users/ignasi/kratos/./Python

If you still have compilation errors, you could try disabling some applications, but I don't think that is the problem...
Another possible source of problems could be that you are using a developer version of python 3, but I doubt it...

When you manage to successfully compile, remember that you still need to set up your shell environment by defining the PYTHONPATH and the DYLD_LIBRARY_PATH before you can import KratosMultiphysics.

Regards,

Ignasi

carlosbenitos

  • Newbie
  • *
  • Posts: 5
Re: MacOS issue(s) to install Kratos
« Reply #6 on: December 03, 2016, 02:28:13 PM »
Hello Ignasi,

So I deleted all the kratos folder and did it again.

I've download the same librarys when it was possible and now I have just an issue with python.

Code: [Select]

Script started on Sat Dec  3 14:18:28 2016
[?1034hbash-3.2$ sh release_configure.sh
-- The C compiler identification is Clang 3.5.0
-- The CXX compiler identification is Clang 3.5.0
-- Check for working C compiler: /usr/local/bin/clang-omp
-- Check for working C compiler: /usr/local/bin/clang-omp -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/clang-omp++
-- Check for working CXX compiler: /usr/local/bin/clang-omp++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Subversion: /usr/bin/svn (found version "1.9.4")
KRATOS_EXCLUDE_OPENMP
OpenMP included
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp 
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   python
-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.5/Python (found version "3.5.2")
 
CMAKE_BUILD_TYPE ........ Release
 
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
 
INCOMPRESSIBLE_FLUID_APPLICATION ...
MESHING_APPLICATION ................
EXTERNAL_SOLVERS_APPLICATION........
PFEM_APPLICATION....................
STRUCTURAL_APPLICATION..............
STRUCTURAL_MECHANICS_APPLICATION....
CONVECTION_DIFFUSION_APPLICATION....
SOLID_MECHANICS_APPLICATION.........
PFEM_BASE_APPLICATION...............
PFEM_SOLID_MECHANICS_APPLICATION....
MACHINING_APPLICATION...............
FLUID_DYNAMICS_APPLICATION..........
PFEM_FLUID_DYNAMICS_APPLICATION.....
STRING_DYNAMICS_APPLICATION.........
ALE_APPLICATION.....................
FSI_APPLICATION.....................
EMPIRE_APPLICATION..................
MIXED_ELEMENT_APPLICATION...........
DEM_APPLICATION.....................
SWIMMING_DEM_APPLICATION............
CONSTITUTIVE_LAWS_APPLICATION.......
THERMO_MECHANICAL_APPLICATION.......
OPENCL_APPLICATION..................
MKL_SOLVERS_APPLICATION.............
MPI_SEARCH_APPLICATION..............
METIS_APPLICATION...................
TRILINOS_APPLICATION................
TURBULENT_FLOW_APPLICATION..........
BLOOD_FLOW_APPLICATION..............
PURE_DIFFUSION_APPLICATION..........
MESHLESS_APPLICATION................
WIND_TURBINE_APPLICATION ...........
CLICK2CAST_APPLICATION .............
MULTISCALE_APPLICATION .............
PFEM2_APPLICATION...................
FREEZING_SOIL_APPLICATION...........
ADJOINT_FLUID_APPLICATION...........
POROMECHANICS_APPLICATION...........
PARTICLE_MECHANICS_APPLICATION......
FORMING_APPLICATION.................
DAM_APPLICATION.....................
SHAPE_OPTIMIZATION_APPLICATION......
TOPOLOGY_OPTIMIZATION_APPLICATION...
MY_LAPLACIAN_APPLICATION............
LAGRANGIAN_MPM_APPLICATION..........
CONTACT_MECHANICS_APPLICATION.......
CONTACT_STRUCTURAL_MECHANICS_APPLICATION.......
MAPPING_APPLICATION.................
 
--------------------------------  standard install dir /Users/Charles-BenoitBONNARD/kratos
boost python lib used = /Users/Charles-BenoitBONNARD/kratos/external_libraries/boost_1_61_0/stage/lib/libboost_python.dylib
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   Kratos
   KratosCore
   zlib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BLAS_LIBRARIES
    LAPACK_LIBRARIES


-- Build files have been written to: /Users/Charles-BenoitBONNARD/kratos/cmake_build
release_configure.sh: line 41: -DSOLID_MECHANICS_APPLICATION=ON: command not found
[ 26%] Built target zlib
[ 26%] Built target zlibstatic
[ 31%] Built target gidpost
[ 33%] Built target example
[ 35%] Built target minigzip
[ 61%] Built target KratosCore
[ 62%] Linking CXX shared library Kratos.so
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.5/Python' is not a directory
Undefined symbols for architecture x86_64:
  "__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE", referenced from:
      _PyInit_Kratos in kratos_python.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kratos/Kratos.so] Error 1
make[1]: *** [kratos/CMakeFiles/Kratos.dir/all] Error 2
make: *** [all] Error 2
[ 13%] Built target zlib
[ 15%] Built target example
[ 28%] Built target zlibstatic
[ 30%] Built target minigzip
[ 35%] Built target gidpost
[ 61%] Built target KratosCore
[ 62%] Linking CXX shared library Kratos.so
ld: warning: -L path '/Library/Frameworks/Python.framework/Versions/3.5/Python' is not a directory
Undefined symbols for architecture x86_64:
  "__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE", referenced from:
      _PyInit_Kratos in kratos_python.cpp.o
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [kratos/Kratos.so] Error 1
make[1]: *** [kratos/CMakeFiles/Kratos.dir/all] Error 2
make: *** [all] Error 2
bash-3.2$ exit
exit

Script done on Sat Dec  3 14:18:40 2016


The "release_configure.sh"

Code: [Select]

#!/bin/sh

# 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

# additional compiler flags could be added customizing the corresponding var, for example
# -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 ". Note that the "defaults are already correctly coded"
#so we should ass here only machine specific stuff

#an effort is made to autodetect all of the libraries needed HOWEVER:
#METIS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#TRILINOS_APPLICATION needs the var PARMETIS_ROOT_DIR to be specified by the user (not needed if the app is set to OFF)
#MKL_SOLVERS_APPLICATION needs the var MKLSOLVER_INCLUDE_DIR and MKLSOLVER_LIB_DIR to be specified by the user (not needed if the app is set to OFF)
#note that the MKLSOLVER_LIB_DIR should include /lib/em64t. This is needed as intel is changing location of mkl at every update of the compiler!!

#the user should also note that the symbol "\" marks that the command continues on the next line. IT SHOULD ONLY BE FOLLOWED
#BY the "ENTER" and NOT by any space!!

clear

#you may want to decomment this the first time you compile
rm CMakeCache.txt
rm *.cmake
rm -rf CMakeFiles\

/Applications/CMake.app/Contents/bin/cmake ..                                                      \
-DCMAKE_C_COMPILER=/usr/local/bin/clang-omp                                     \
-DCMAKE_INSTALL_RPATH="/home/Charles-BenoitBONNARD/kratos/libs"                              \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE                                        \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang-omp++                                     \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11 "                         \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 "                             \
-DCMAKE_BUILD_TYPE=Release                                        \
-DBOOST_ROOT="/Users/Charles-BenoitBONNARD/kratos/external_libraries/boost_1_61_0"                        \
-DBOOST_LIBRARYDIR="/Users/Charles-BenoitBONNARD/kratos/external_libraries/boost_1_61_0/stage/lib"        \
-DPYTHON_LIBRARY="/Library/Frameworks/Python.framework/Versions/3.5/Python"                  \
-DPYTHON_INCLUDE_DIR="/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m"  \
-DLAPACK_LIBRARIES="/usr/lib/liblapack.dylib"                                                \
-DBLAS_LIBRARIES="/usr/lib/libblas.dylib"
-DSOLID_MECHANICS_APPLICATION=ON                                        \
-DFLUID_DYNAMICS_APPLICATION=ON                                     \
-DCONVECTION_DIFFUSION_APPLICATION=ON                               \
-DDEM_APPLICATION=OFF                                             \
-DSWIMMING_DEM_APPLICATION=OFF                                                  \
-DINCOMPRESSIBLE_FLUID_APPLICATION=ON                                \
-DMESHING_APPLICATION=ON                                           \
-DEXTERNAL_SOLVERS_APPLICATION=ON                                     \
-DPFEM_APPLICATION=ON                                           \
-DSTRUCTURAL_APPLICATION=ON                                       \
-DSTRUCTURAL_MECHANICS_APPLICATION=ON                                 \
-DALE_APPLICATION=ON                                             \
-DFSI_APPLICATION=ON                                             \
-DOPENCL_APPLICATION=OFF                                           \
-DMIXED_ELEMENT_APPLICATION=ON                                     \
-DMKL_SOLVERS_APPLICATION=OFF                                       \
-DMKLSOLVER_INCLUDE_DIR="/opt/intel/Compiler/11.1/072/mkl/include"             \
-DMKLSOLVER_LIB_DIR="/opt/intel/Compiler/11.1/072/mkl/lib/em64t"               \
-DMETIS_APPLICATION=OFF                                           \
-DPARMETIS_ROOT_DIR="/home/Charles-BenoitBONNARD/compiled_libraries/ParMetis-3.1.1"          \
-DTRILINOS_APPLICATION=OFF                                         \
-DTRILINOS_ROOT="/home/Charles-BenoitBONNARD/compiled_libraries/trilinos-10.2.0"           \
-DINSTALL_EMBEDDED_PYTHON=ON                                                    \
-DSHAPE_OPTIMIZATION_APPLICATION=OFF \
-DTOPOLOGY_OPTIMIZATION_APPLICATION=OFF \
DEXCLUDE_ITSOL=ON                                                                           \

#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j4
make install



and the path in the boost.sh

Code: [Select]

# Boost.Build Configuration
# Automatically generated by bootstrap.sh

import option ;
import feature ;

# Compiler configuration. This definition will be used unless
# you already have defined some toolsets in your user-config.jam
# file.
if ! darwin in [ feature.values <toolset> ]
{
    using darwin ;
}

project : default-build <toolset>darwin ;

# Python configuration
import python ;
if ! [ python.configured ]
{
using python : 3.5 : /Library/Frameworks/Python.framework/Versions/3.5 : /Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m ;}

# List of --with-<library> and --without-<library>
# options. If left empty, all libraries will be built.
# Options specified on the command line completely
# override this variable.
libraries =  ;

# These settings are equivivalent to corresponding command-line
# options.
option.set prefix : /usr/local ;
option.set exec-prefix : /usr/local ;
option.set libdir : /usr/local/lib ;
option.set includedir : /usr/local/include ;

# Stop on first error
option.set keep-going : false ;


And you can see the path of the python in the picture I have attached.

For the moment I juste have an idea when I do this

Code: [Select]
Script started on Sat Dec  3 14:24:21 2016
[?1034hbash-3.2$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
bash-3.2$ ecxit
exit

Script done on Sat Dec  3 14:24:33 2016

Maybe my MacOS is configure with the 3.6 version even if I have the 3.5 ?

If you think it is that I will to this later, I have to moove...

Thank you very much again for your help and you patience.

Regards,

CBB.

Ignasi de Pouplana

  • Newbie
  • *
  • Posts: 21
Re: MacOS issue(s) to install Kratos
« Reply #7 on: December 03, 2016, 06:34:14 PM »
Don't worry Charles, I know that it is not so easy to compile Kratos for the first time ^^'

You still have a couple of problems in the release_configure.sh:

1. You have:

-DCMAKE_INSTALL_RPATH="/home/Charles-BenoitBONNARD/kratos/libs"                              \

but your home folder is in /Users/Charles-BenoitBONNARD

2. You forgot a backslash in the line of DBLAS_LIBRARIES:

-DLAPACK_LIBRARIES="/usr/lib/liblapack.dylib"                                                \
-DBLAS_LIBRARIES="/usr/lib/libblas.dylib"
-DSOLID_MECHANICS_APPLICATION=ON                                                      \

3. You forgot a dash before DEXCLUDE_ITSOL:

DEXCLUDE_ITSOL=ON                                                                           \

And, regarding the path of python3, you have the old path for python 3.6 in your .bash_profile. You must change it. Just open a terminal and type:

Code: [Select]
open -e .bash_profile 
to open the file with a text editor. Once you change the path and save the file, quit Terminal (cmd+Q) and open it again to have it working.

Let me know when you get to compile.

Regards,

Ignasi

carlosbenitos

  • Newbie
  • *
  • Posts: 5
Re: MacOS issue(s) to install Kratos
« Reply #8 on: December 04, 2016, 01:00:13 AM »
Hi Ignasi,

YEEEEEES ! It's working !

Thank you very much for your help !

When you want to compile Kratos and that does not work, it's better to delete the kratos folder and do all the step again since where you have to add the boost in the external_library... If not, when you change somethings to fix compilation's issues you have new bug wherease you didn't have them in the first try of compilation ^^' !

Pfiou...

CBB.