Users:HowToUseCarat/InstallationWindows

From Carat++ Public Wiki
< Users:HowToUseCarat(Difference between revisions)
Jump to: navigation, search
(Created page with "This page shows how Carat++ can be compiled under a Windows environment. * Windows 10 64bit * Microsoft Visual Studio 2015 * TODO git/svn * CMake XXX * Boost 1.63.0 * MKL (Intel ...")
 
(Get the source code)
 
(37 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
* Microsoft Visual Studio 2015
 
* Microsoft Visual Studio 2015
 
* TODO git/svn
 
* TODO git/svn
* CMake XXX
+
* CMake 3.8.0
 
* Boost 1.63.0
 
* Boost 1.63.0
* MKL (Intel mkl 2017)
+
* MKL (Intel MKL 2017)
 
+
 
+
  
 
== Windows Version ==
 
== Windows Version ==
Line 14: Line 12:
  
 
Carat++ installation was tested also under the following Windows versions:
 
Carat++ installation was tested also under the following Windows versions:
# TODO please add more if you tested it there
+
* Windows 7 64bit
 +
* TODO please add more if you tested it there
  
 
== IDE ==  
 
== IDE ==  
  
The IDE of choice is Micrsoft Visual Studio 2015 and the related
+
The IDE of choice is Microsoft Visual Studio 2015 Community. Furthermore, the setup with Microsoft Visual Studio 2017 Community is similar.
 +
 
 +
* Download it from https://www.microsoft.com/de-DE/download/details.aspx?id=48146
 +
 
 +
* In Visual Studio 2015, Visual C++ is not installed by default. When installing, be sure to choose Custom installation and then choose the C++ components you require.
 +
 
 +
* If Visual Studio 2015 is already installed, choose File | New | Project | C++ and you will be prompted to install the necessary components.
 +
 
 +
//TODO Screenshots
 +
 
 +
Settings for Visual Studio:
 +
* Text-editor -> C/C++ -> Tabstopps:
 +
** Indent: Intelligent
 +
** Tabstopp size: 2
 +
** Indent size: 2
 +
** Insert spaces
  
 
== Git ==
 
== Git ==
Line 28: Line 42:
 
== Get the source code ==
 
== Get the source code ==
  
TODO
+
* Navigate to the folder where you want to have the source code.
 +
* Right click -> Git Clone...
 +
* Enter the URL: https://gitlab.lrz.de/chair_of_structural_analysis/carat.git (if you are not yet a member of the Chair of Structural Analysis group on GitLab, ask someone to add you to the group (if applicable) or project)   
 +
* Click OK.
 +
* Enter your trac-username and -password.
 +
 
 +
Note that the original carat version with documentation is available under 129.187.141.105:/repos/carat.git as read_only.
 +
 
 +
<gallery>
 +
File:git_clone.png|Git Clone
 +
File:git_clone_url.png|URL
 +
</gallery>
  
 
== Create directory for build and libraries ==
 
== Create directory for build and libraries ==
 
   
 
   
TODO
+
In "C:\carat\" create the empty directories "libs" and "build".
  
 
== CMake ==  
 
== CMake ==  
 
Install the latest CMake version
 
Install the latest CMake version
 
  
 
== Boost ==
 
== Boost ==
  
Get the latest boost library from https://boost.org.
+
Get the boost library version 1.63.0 from https://boost.org.
 
Download and unpack it.  
 
Download and unpack it.  
 
Copy the unpacked folder with the version number into the "carat/libs" directory.
 
Copy the unpacked folder with the version number into the "carat/libs" directory.
Line 46: Line 70:
 
In order to use the Boost logging, it needs to be compiled:
 
In order to use the Boost logging, it needs to be compiled:
  
# Open the Windwos command prompt.
+
* Open the Windwos command prompt.
# Navigate to the "carat/libs/boost_X_XX directory.
+
* Navigate to the "carat/libs/boost_1_63_0 directory.
# Compile boost with the following lines in the command prompt.
+
* Compile boost with the following lines in the command prompt.
  
 
<pre>
 
<pre>
 +
bootstrap
 +
 +
b2 link=shared address-model=64 runtime-link=shared --with-atomic --with-chrono --with-date_time --with-filesystem --with-log --with-system --with-thread
  
 +
b2 link=static address-model=64 runtime-link=static --with-atomic --with-chrono --with-date_time --with-filesystem --with-log --with-system --with-thread
 
</pre>
 
</pre>
 +
If there is an error ''command "cl" missing'', refer to the IDE section above.
  
Now add the following path to the compiled boost libraries to your environmental variable "PATH":
+
* Now add the following path to the compiled boost libraries to your environmental variable "Path":
  
 
<pre>
 
<pre>
 
+
C:\carat\libs\boost_1_63_0\stage\lib\
 
</pre>
 
</pre>
  
Line 64: Line 93:
 
Intel MKL is a equation solving library, that is strongly recommended to use.  
 
Intel MKL is a equation solving library, that is strongly recommended to use.  
  
This guide shows a simple Installation without any administrator rights.
+
* Install the Intel mkl package located at "\\DC01\F_Users\TEMP\software\intel_suite\MKL_2017_standalone\windows" with default settings.
(Advanced: To use all the features of the intel suite please refer to http://129.187.141.105/trac/wiki/IntelSuite12.1)
+
* Now add the following path to the compiled boost libraries to your environmental variable "Path":
 +
 
 +
<pre>
 +
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017\windows\redist\intel64\mkl\
 +
</pre>
 +
 
 +
== RapidJSON ==
 +
 
 +
RapidJSON is a JSON parser and generator for C++. It is used to read a Carat Inputfile in JSON-format. This library is optional.
 +
 
 +
* Copy the library "rapidjson-master" from "\\DC01\F_Users\TEMP\software\Carat_libs" to your carat libraries.  
 +
<!-- * Set the respective path in "CARAT_ROOT\src\cmake_personal_input.dat". -->
 +
<!-- * Check USE_WITH_JSON in the CMAKE file in order to include it in your project. By default it is not part of the project. -->
  
# Copy the "license.lic" from smb://dc01/f_users/TEMP/software/intel_suite into ~/software/intel/ into into e.g. ~/software/intel/.
 
# Copy the Intel Composer package "l_ccompxe_2013_sp1.2.144.tgz" from smb://dc01/f_users/TEMP/software/intel_suite/Intel_Comp14SP1 into e.g. ~/software/intel/.
 
# Unpack it and execute the "install_GUI.sh".
 
# Select "Install as current user"
 
# Select "Chose alternative activation"
 
# Select "Use a license file"
 
# Browse to "~/software/intel/license.lic"
 
# Costumize installation
 
# Destination Folder: Browse to "~/software/intel/2013/
 
# Ignore warnings about missing Java and 32bit. To use MKL solver this is not needed.
 
# After installation you can delete "l_ccompxe_2013_sp1.2.144.tgz" and l_ccompxe_2013_sp1.2.144
 
  
 
== Compile Carat ==
 
== Compile Carat ==
Line 86: Line 116:
  
 
Navigate to the Carat++ source directory and make a copy of the "cmake_personal_input.template" to "cmake_personal_input.dat".
 
Navigate to the Carat++ source directory and make a copy of the "cmake_personal_input.template" to "cmake_personal_input.dat".
<pre>
+
 
~/software/carat/src
+
Do not modify the "cmake_personal_input.template"!
cp cmake_personal_input.template cmake_personal_input.dat
+
 
</pre>
+
In the "cmake_personal_input.dat" file you find the following part with commented lines where you have to set your user defined paths:
In this file you find the following part with commented lines where you have to set your user defined paths:
+
 
<pre>
 
<pre>
 
#==============================
 
#==============================
# set directories paths
+
# set directory paths
 
#==============================
 
#==============================
  
Line 113: Line 142:
  
 
set(CARAT_ROOT "~/software/carat")
 
set(CARAT_ROOT "~/software/carat")
set(LIB_BOOST_INCLUDE_DIR "~/software/carat/libs/boost_1_63_0")
+
set(LIB_BOOST_INCLUDE_DIR "C:/carat/libs/boost_1_63_0")
set(LIB_BOOST_DIR "~/software/carat/libs/boost_1_63_0/boost")
+
set(LIB_BOOST_DIR "C:/carat/libs/boost_1_63_0/stage/lib")
set(LIB_MKL_DIR "~/software/intel/xe_2013/composer_xe_2013_sp1/mkl")
+
set(LIB_MKL_DIR "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2017/windows/mkl")
 
</pre>
 
</pre>
  
=== Set up the project ===
+
Make sure to use a "/" as a separator in the paths.
  
Navigate to the "build" directory. This is important so that all files are created here:
+
=== Create the project with CMake===
<pre>
+
~/software/carat/build
+
</pre>
+
Use ccmake to set up the project:
+
<pre>
+
ccmake ../src/
+
</pre>
+
  
Press "c" to configure the project. And set the follwing settings for a very basic installation:
+
TODO add pictures (already created)
  
<pre>
+
* Open CMake
BUILD_EXECUTABLE                ON                                                                                                                                                                     
+
* Set the carat source path: "C:/carat/src"
BUILD_NX_PLUG_IN                OFF                                                                                                                                                                     
+
* Set the carat build directory: "C:/carat/build" (create this folder if it does not exist)
BUILD_RHINO_PLUG_IN_SDK4        OFF                                                                                                                                                                     
+
* Click "Configure"
BUILD_RHINO_PLUG_IN_SDK5        OFF                                                                                                                                                                     
+
* Select Visual Studio 2015
BUILD_SHARED_LIB                OFF                                                                                                                                                                     
+
* Check the desired Flags (for the basic setup you can use the default values as you see in the sreenshot below)
BUILD_STATIC_LIB                OFF                                                                                                                                                                     
+
* Click "Generate
CFD_OPT                          OFF                                                                                                                                                                     
+
CMAKE_BUILD_TYPE                Release                                                                                                                                                                 
+
CMAKE_INSTALL_PREFIX            /usr/local                                                                                                                                                             
+
ENABLE_CHOLMOD                  OFF                                                                                                                                                                     
+
ENABLE_PREC_SOLVER_LIB          OFF                                                                                                                                                                     
+
EXTENSIVE_BENCHMARKS            OFF                                                                                                                                                                     
+
MODULE_DESIGN                    ON                                                                                                                                                                     
+
MODULE_FORM_AND_CUT              ON                                                                                                                                                                     
+
MODULE_GUI                      OFF                                                                                                                                                                     
+
MODULE_OPTIMIZATION              ON                                                                                                                                                                     
+
MODULE_REPORT                    ON                                                                                                                                                                     
+
USE_32bit                        OFF                                                                                                                                                                     
+
USE_BOOST_LOGGING                OFF                                                                                                                                                                     
+
USE_COSIMULATION                OFF                                                                                                                                                                     
+
USE_FLANN_64BIT                  OFF                                                                                                                                                                     
+
USE_INTEL_COMP                  OFF                                                                                                                                                                     
+
USE_MKL                          ON                                                                                                                                                                     
+
USE_MPP                          OFF                                                                                                                                                                     
+
USE_OPENCASCADE                  OFF                                                                                                                                                                     
+
USE_OPENMP                      OFF                                                                                                                                                                     
+
USE_TRILINOS                    OFF 
+
</pre>
+
  
Press "g" to generate.
+
=== Open the Carat++ project with Visual Studio 2015 ===
 +
 
 +
Now you can open the Carat++ Project with Visual Studio 2015 and edit/compile it.
 +
 
 +
* Open Visual Studio 2015
 +
* Click "Open Project..." and select the "C:/Carat/build/Carat++.sln" project file.
 +
* Right-click the "carat" module in the project explorer on the right and "Set StartUp Projects".
 +
 
 +
Now you are ready to compile Carat++!
  
 
=== Compile ===
 
=== Compile ===
  
Still in the "build" directory:
 
<pre>
 
make -j 8
 
</pre>
 
  
Now you have a compiled version of Carat++ in your build directory.
 
In [[Users:HowToUseCarat#Step_2:_Run_Carat|Run Carat]] it is explained how to run Carat++.
 
  
 
== Benchmarks ==  
 
== Benchmarks ==  
  
 
After each build or at least before a git commit the benchmarks have to be tested.
 
After each build or at least before a git commit the benchmarks have to be tested.
In the "build" directory type:
+
 
 +
* Compile "carat_benchmark"
 +
* RUN_TEST
 +
 
 +
You should add a benchmark for every development. Therefore you can add two types of benchmarks in the folder example/benchmark_examples/:
 +
 
 +
* cbm_myfile1.dat: This benchmark is executed in every RUN_TESTS. The runtime should be short ( < 1s)
 +
* xcbm_myfile1.dat: This benchmark is only executed in RUN_TESTS, if the flag EXTENSIVE_BENCHMARKS.
 +
 
 +
In addition, you have to provide a reference file with the correct solution in a file called ref_myfile1.dat.
 +
 
 
<pre>
 
<pre>
make test
+
Result "Displacement" "Load Case" 0 Vector OnNodes
 +
Values
 +
  79  -1.1022632867e+000  -9.8466095193e-001  -1.3132351571e-001
 +
  83  -1.1400399584e+000  -1.1658915870e+000  -9.1812530586e-002
 
</pre>
 
</pre>

Latest revision as of 10:03, 31 July 2018

This page shows how Carat++ can be compiled under a Windows environment.

  • Windows 10 64bit
  • Microsoft Visual Studio 2015
  • TODO git/svn
  • CMake 3.8.0
  • Boost 1.63.0
  • MKL (Intel MKL 2017)

Contents

Windows Version

In this installation guide Windows 10 64bit is used.

Carat++ installation was tested also under the following Windows versions:

  • Windows 7 64bit
  • TODO please add more if you tested it there

IDE

The IDE of choice is Microsoft Visual Studio 2015 Community. Furthermore, the setup with Microsoft Visual Studio 2017 Community is similar.

  • In Visual Studio 2015, Visual C++ is not installed by default. When installing, be sure to choose Custom installation and then choose the C++ components you require.
  • If Visual Studio 2015 is already installed, choose File | New | Project | C++ and you will be prompted to install the necessary components.

//TODO Screenshots

Settings for Visual Studio:

  • Text-editor -> C/C++ -> Tabstopps:
    • Indent: Intelligent
    • Tabstopp size: 2
    • Indent size: 2
    • Insert spaces

Git

Git is used as version control system. It is needed to download the Carat++ source code.

TODO

Get the source code

  • Navigate to the folder where you want to have the source code.
  • Right click -> Git Clone...
  • Enter the URL: https://gitlab.lrz.de/chair_of_structural_analysis/carat.git (if you are not yet a member of the Chair of Structural Analysis group on GitLab, ask someone to add you to the group (if applicable) or project)
  • Click OK.
  • Enter your trac-username and -password.

Note that the original carat version with documentation is available under 129.187.141.105:/repos/carat.git as read_only.

Create directory for build and libraries

In "C:\carat\" create the empty directories "libs" and "build".

CMake

Install the latest CMake version

Boost

Get the boost library version 1.63.0 from https://boost.org. Download and unpack it. Copy the unpacked folder with the version number into the "carat/libs" directory.

In order to use the Boost logging, it needs to be compiled:

  • Open the Windwos command prompt.
  • Navigate to the "carat/libs/boost_1_63_0 directory.
  • Compile boost with the following lines in the command prompt.
bootstrap

b2 link=shared address-model=64 runtime-link=shared --with-atomic --with-chrono --with-date_time --with-filesystem --with-log --with-system --with-thread

b2 link=static address-model=64 runtime-link=static --with-atomic --with-chrono --with-date_time --with-filesystem --with-log --with-system --with-thread

If there is an error command "cl" missing, refer to the IDE section above.

  • Now add the following path to the compiled boost libraries to your environmental variable "Path":
C:\carat\libs\boost_1_63_0\stage\lib\

MKL

Intel MKL is a equation solving library, that is strongly recommended to use.

  • Install the Intel mkl package located at "\\DC01\F_Users\TEMP\software\intel_suite\MKL_2017_standalone\windows" with default settings.
  • Now add the following path to the compiled boost libraries to your environmental variable "Path":
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017\windows\redist\intel64\mkl\

RapidJSON

RapidJSON is a JSON parser and generator for C++. It is used to read a Carat Inputfile in JSON-format. This library is optional.

  • Copy the library "rapidjson-master" from "\\DC01\F_Users\TEMP\software\Carat_libs" to your carat libraries.


Compile Carat

User Settings

First of all it is necessary to set some paths depending on where you stored the carat source and libs.

Navigate to the Carat++ source directory and make a copy of the "cmake_personal_input.template" to "cmake_personal_input.dat".

Do not modify the "cmake_personal_input.template"!

In the "cmake_personal_input.dat" file you find the following part with commented lines where you have to set your user defined paths:

#==============================
# set directory paths
#==============================

# BASIC INSTALLATION

#set(CARAT_ROOT "C:/carat")
#set(LIB_BOOST_INCLUDE_DIR "C:/carat/libs/boost_1_55_0")
#set(LIB_BOOST_DIR "C:/carat/libs/boost_1_55_0/boost")
#set(LIB_MKL_DIR "C:/Program Files (x86)/Intel/Composer XE 2011 SP1/mkl")

With the paths used in this installation guide the block should look like (don't forget to remove the #):

#==============================
# set directories paths
#==============================

# BASIC INSTALLATION

set(CARAT_ROOT "~/software/carat")
set(LIB_BOOST_INCLUDE_DIR "C:/carat/libs/boost_1_63_0")
set(LIB_BOOST_DIR "C:/carat/libs/boost_1_63_0/stage/lib")
set(LIB_MKL_DIR "C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2017/windows/mkl")

Make sure to use a "/" as a separator in the paths.

Create the project with CMake

TODO add pictures (already created)

  • Open CMake
  • Set the carat source path: "C:/carat/src"
  • Set the carat build directory: "C:/carat/build" (create this folder if it does not exist)
  • Click "Configure"
  • Select Visual Studio 2015
  • Check the desired Flags (for the basic setup you can use the default values as you see in the sreenshot below)
  • Click "Generate

Open the Carat++ project with Visual Studio 2015

Now you can open the Carat++ Project with Visual Studio 2015 and edit/compile it.

  • Open Visual Studio 2015
  • Click "Open Project..." and select the "C:/Carat/build/Carat++.sln" project file.
  • Right-click the "carat" module in the project explorer on the right and "Set StartUp Projects".

Now you are ready to compile Carat++!

Compile

Benchmarks

After each build or at least before a git commit the benchmarks have to be tested.

  • Compile "carat_benchmark"
  • RUN_TEST

You should add a benchmark for every development. Therefore you can add two types of benchmarks in the folder example/benchmark_examples/:

  • cbm_myfile1.dat: This benchmark is executed in every RUN_TESTS. The runtime should be short ( < 1s)
  • xcbm_myfile1.dat: This benchmark is only executed in RUN_TESTS, if the flag EXTENSIVE_BENCHMARKS.

In addition, you have to provide a reference file with the correct solution in a file called ref_myfile1.dat.

Result "Displacement" "Load Case" 0 Vector OnNodes
Values
  79  -1.1022632867e+000  -9.8466095193e-001  -1.3132351571e-001
  83  -1.1400399584e+000  -1.1658915870e+000  -9.1812530586e-002




Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Personal tools
Content for Developers