1. How to Build¶
SimCenter tools all comprise a frontend UI and some backend applications. They are kept in seperate github repositories and are also built seperately. The following3 sections outline (1) the applications needed to build and run, (2) instructions for building the backend applications, (3) instructions for building the frontend UI, and (4) operations to perform in the running UI to link the UI and the backend.
1.1. Install Dependencies¶
First, ensure the following dependencies are installed:
C++17 compliant compiler: many of the workflow applications included use C++17 features, consequently they may need a newer C++17 compliant compiler. Fow Windows users, MSVC in Visual Studio (Community edition) can be used. Some extensions of Visual Studio are also needed: Open Visual Studio Installer, go to Installed / More / Modify, under the Workloads tab, check Desktop development with C++ and Visual Studio extension development; under the Individual components tab, check C++ CMake tools for windows. Then click Modify.
OpenSees: The workflow applications require an installation of OpenSees to carry out structural analysis using the finite element method.
DAKOTA: The workflow applications require an installation of DAKOTA to handle and propagate the uncertainties defined in the input files for the workflow applications.
Python: The workflow requires at least Python 3.7.
CMake: This repository uses CMake for managing the build process. Version 3.15 or later is recommended.
Qt: Qt is free for open source developers. Version 5.15 or later is required. Make sure to include Qt Creator in the installer.
Qt Version 6.0 is currently available. It is so new we do not use it.
1.2. Build the Backend Applications¶
Instructions to build the workflow applications on your local desktop depend on your operating system.
1.2.1. Setup the development environment with Conan¶
conan remote add simcenter https://nherisimcenter.jfrog.io/artifactory/api/conan/simcenter
Create a default Conan profile if this is the first time you use Conan for building packages.
conan profile new default --detect
Check the default profile of your build environment using:
conan profile show default
If the compiler name and compiler version are not listed, then you will need to select a specific compiler. For instance, on Windows using Visual Studio 2019, you can specify the compiler as follows:
conan profile update settings.compiler="Visual Studio" default conan profile update settings.compiler.version="16" default
1.2.2. Build the applications¶
Obtain the code in the SimCenterBackendApplications repository from Github. You can do that by using your preferred Git client/GUI or by using the
git clonecommand in the terminal:
git clone https://github.com/NHERI-SimCenter/SimCenterBackendApplications
To build the applications you need to now navigate to the SimCenterBackendApplications folder that was created with the git clone command. Once there you will issue the following set of commands to create a build folder, change director to that folder, install needed software using conan, and finally use cmake to build and install thge applications. The following are the set of commands to type in the terminal (see notes below the code block if the commands fail):
mkdir build cd build conan install .. --build missing cmake .. cmake --build . --config Release cmake --install . cd ..
On Windows it is necessary to specify a compiler for CMake. To do this you need to add additional arguments to line 4, i.e. if you have Visual Studio 2019 you would instead type:
cmake .. -G "Visual Studio 16 2019"
For Mac users running Big Sur and version 12 of XCode there are some reported issues. Replace line 3 above with the following two lines:
conan install .. --build missing --build=libcurl mv ./missing/* ./
For Mac users, add the following command after cmake –install . to ensure the binary applications are copied to the applications folder.
make install .
If building and installation were successful you should find a folder called
applications in the repository with all the applications inside of it. The name of this folder should not be changed.
1.3. Build the User Interface¶
To build the interface you first need to download the repo and a companion repo(SimCenterCommon) from github using our github repos. In a folder in which you wish to build the application, issue the following two commands.
git clone https://github.com/NHERI-SimCenter/SimCenterCommon.git git clone https://github.com/NHERI-SimCenter/APP_NAME.git
Use the above links if you just want to download and build the applications. If you intend to make changes to any of the code in the repo’s, you should fork the latter repo and then clone your forked repo. Forking a repo at github is done through your browser.
git clone https://github.com/YOUR_GITHUB_NAME/APP_NAME.git
You now have two ways to build the application: (1) using the Qt Creator desktop application provided by Qt and (2) from terminal application.
Start Qt Creator, then open the PBE.pro file located in the PBE directory that was downloaded in the previous step.
Setup the development kit in Qt Creator. This is usually done by selecting the Qt version, compiler and configuration and following the onscreen dialog.
Build the application and run it in Qt Creator IDE by using the Run button. This can be done using the keyboard shortcut
F5to build and start the tool.
The operations are similar to what was done when building the backend applications. In the terminal application, starting inside the directory of the cloned application again, you will create a build directory, cd into that build directory, run qmake, and finally make (or on Windows nmake)
mkdir build cd build qmake ../PBE.pro make
qmake is an application installed with Qt. To be able to run the command as whown, the path to the Qt bin folder needs to be added to your PATH environment variable. Alternativily you need to specify the full path to qmake, i.e. on my desktop (if I had not set my PATH variable) I would replace line 3 with the following:
On a Windows 10 with Visual Studio, the above commands need to be performed using a Visual Studio x64 command prompt . As a consequence you also need to replace line 4 with the following:
If installed, jom can also be used to build in parallel.
Once built, you can now run the tool executable.
1.4. Modify the User Interface Preferences¶
Once built the tool Preferences needs to be modified. To do this open the PBE tool, then click on File -> Preferences in the main menu if on Windows or PBE -> Preferences if on a Mac. This will bring up a dialog window shown below. You need to modify certain values:
Python: provide the full path to the python intertpreter.
OpenSees: provide the full path to the OpenSees executable
Dakota: provide full path to the dakota executable.
Custom Local Application: Here select the checkbox to the left, and then provide the path to the SimCenterBackendApplications directory. The code assumes that the folder applications, which you created when building the backend applications, exists.