STAIRLab logo
  • Docs 
  • Examples 
  •  
Docs
  • Getting started
    • Introduction
    • Modeling
    • Compiling
    • Contribute
  • Getting started
    • Introduction
    • Modeling
    • Compiling
    • Contribute

Compiling

Compiling your own version of xara.

On this page
Dependencies   Prerequisites   Compiling  

Dependencies  

The first step for compiling xara is to download some basic dependencies. The primary system dependencies required for compiling are LAPACK/BLAS and Tcl. Packages providing these libraries are listed below for various package management ecosystems. Anaconda is recommended for those that are not familiar with compiling.

  Note

When building in an Anaconda environment, you should install all dependencies with conda or mamba, and preferably from the conda-forge channel. Expand the notes on Anaconda below.

When using conda, you need to ensure that CMake only finds compilers that are compatible with the libraries in the environment. System compilers (like those installed by the operating system’s package manager) often cannot be used and can lead to segfaults. The following command should install everything you need:

conda install -c conda-forge fortran-compiler cxx-compiler c-compiler openblas openmpi
Dependency Package
BLAS libopenblas-dev
Tcl* tcl-dev
Compilers build-essential
Dependency Package
Tcl* tcl-tk
Compilers gcc
Dependency Package
LAPACK lapack
BLAS blas
Tcl* tcl
Dependency Package
LAPACK lapack-devel
Tcl* tcl-devel

Prerequisites  

  1. Clone the package repository:

    git clone https://github.com/peer-open-source/xara
  2. install run-time dependencies. These are the libraries that will be needed in order to use OpenSees. To install these, run:

    python -m pip install xara
  3. Install compile-time dependencies; see Dependencies below. These dependencies are only needed for the compiling process.

Windows installation notes  
On Windows you should additionally install Intel compilers and Conan

Compiling  

The next steps describe how to set up your compilers and build the OpenSees library.

  1. Create a directory to hold build artifacts

    mkdir build
  2. Configure the system for your system

    cd build
    cmake ..
  3. Start compiling

    cmake --build . --target OpenSees -j8
  4. When libOpenSeesRT.so is compiled locally, the opensees package needs to be told where to find it. This can be done by setting an environment variable with the name OPENSEESRT_LIB to point to the location of libOpenSeesRT.so in the build tree. To this end, you may want to add a line like the following to your shell startup script (e.g., .bashrc):

    export OPENSEESRT_LIB="/path/to/your/compiled/libOpenSeesRT.so"
  1. Create a directory to hold build artifacts

    mkdir build
  2. Run Conan

    cd build
    conan install .. --build missing
  3. Configure the system for your system

    cmake ..
  4. Start compiling

    cmake --build . --target OpenSees -j8
  5. When libOpenSeesRT.so is compiled locally, the opensees package needs to be told where to find it. This can be done by setting an environment variable with the name OPENSEESRT_LIB to point to the location of libOpenSeesRT.so in the build tree. To this end, you may want to add a line like the following to your shell startup script (e.g., .bashrc):

    export OPENSEESRT_LIB="/path/to/your/compiled/libOpenSeesRT.so"

Check that everything was built properly by running the following command:

python -m opensees

This should start an OpenSees interpreter which can be closed by running the exit command.


• add frame-0002 (6d9c19c)
On this page:
Dependencies   Prerequisites   Compiling  
Compiling
Compiling
A gallery of technical examples currated by the STAIRLab at UC Berkeley.
Code licensed BSD, docs CC BY-NC 4.0
 
Links
Home 
About 
Docs 
Examples
Working with solids 
Nonlinear dynamics 
Basic Statics 
Community
Issues   
Discussions   
Contribute 
STAIRLab
Code copied to clipboard