Skip to content

Commit fd62513

Browse files
committed
update install/build guides
1 parent 1c340af commit fd62513

File tree

7 files changed

+372
-7
lines changed

7 files changed

+372
-7
lines changed

source/about/features/dropped.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Dropped Capabilities
44
* All commands related to reliability analysis are dropped. This however does not include the commands for sensitivity analysis.
55
In particular, the following are *not* supported:
66

7-
* randomeVariable
7+
* randomVariable
8+
9+
* There are no plans to include the recently added ``damping`` commands.
810

9-
* There are no plan to include the recently added ``damping`` commands.
1011
* The recently added ``mesh`` and ``line`` commands of OpenSeesPy are replaced in |xara| by ``Model.surface``.
1112
Motivation: ``mesh`` is unpredictable, questionably defined, and needlessly cumbersome.

source/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
"article_header_start": ["toggle-primary-sidebar.html", "breadcrumbs"]
223223
})
224224

225+
g = "https://gallery.stairlab.io"
225226
html_context = {
226227
"root_doc": root_doc,
227228
"description": description,
@@ -230,7 +231,16 @@
230231
# "doc_path": "<path-from-root-to-your-docs>",
231232

232233
# HOME
233-
"examples": [],
234+
"examples": [
235+
{"title": "Basics", "link": f"{g}/examples/plane-0002/", "image": "../_static/images/gallery/Example6.png", "description": "Learn the basics of drawing models."},
236+
{"title": "Frames", "link": f"{g}/examples/portal-moments/", "image": "../_static/images/gallery/moments.png", "description": "Render structural models with extruded sections."},
237+
# {"title": "Sections", "link": f"{g}/examples/framesections/", "image": "../_static/images/gallery/Torsion.png", "description": "Detailed analysis of structural cross sections."},
238+
{"title": "Detailing", "link": f"{g}/examples/example7/", "image": "../_static/images/gallery/ShellFrame.png", "description": "."},
239+
{"title": "Finite Rotations", "link": f"{g}/examples/framecircle/", "image": "../_static/images/gallery/ShellCircle-576x324.webp", "description": "Render finite deformations in constrained members like Cosserat rods and shells."},
240+
{"title": "Versatility", "link": f"{g}/examples/cablestayed/", "image": "../_static/images/gallery/CableStayed02-576x324.webp", "description": "Import models from commercial platforms like ABAQUS."},
241+
# {"title": "Motions", "link": f"{g}/examples/framehelix/", "image": "../_static/images/gallery/sign-light-2800x2558.webp", "description": "Coming soon."},
242+
# {"title": "Interoperability", "link": f"{g}/examples/cablestayed/", "image": "../_static/images/gallery/CableStayed02-576x324.webp", "description": "Coming soon."},
243+
],
234244
"features": [
235245
{"title": "Fast", "body": "Core components have been refactored to leverage modern C++ features, which has furnished substantial performance improvements over the alternative serial OpenSees interpreters."},
236246
{"title": "Free", "body": "All source code contributed to xara is licensed under a <em>pure</em> BSD."},

source/user/guides/compile.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
.. _user-guides-compile:
2+
13
Compile
24
=======
35

6+
.. note::
7+
8+
The procedure outlined in this guide will create a temporary compile configuration,
9+
and clean up all intermediate files upon completion. This is useful for installing *xara* intro
10+
a Python environment or making changes to the Python source code.
11+
12+
If you wish to set up a persistent development environment to write C++ code,
13+
please refer to :ref:`develop <user-guides-develop>`.
14+
15+
16+
17+
418
To compile Xara from source, follow these steps:
519

620
1. Download the source repository to your computer by running:

source/user/guides/develop.rst

Lines changed: 195 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,202 @@
1+
.. _user-guides-develop:
2+
13
Develop
24
=======
35

4-
1. Set up a development environment by following the instructions in :ref:`compile <user/guides/compile>`.
5-
2. Install build dependencies by running:
6+
This guide walks through the steps required to set up a development environment for *xara*
7+
that can be used to develop code in C++.
8+
9+
10+
Initial Setup
11+
-------------
12+
13+
The following steps only need to be performed once to set up the development environment.
14+
15+
1. Download the source repository to your computer by running:
16+
17+
.. code-block:: shell
18+
19+
git clone https://github.com/peer-open-source/xara
20+
21+
2. Install *run-time* dependencies. You can install these with ``pip`` by running:
622

723
.. code-block:: bash
24+
25+
python -m pip install xara
26+
27+
These are the libraries that will be needed in order to use Xara once it is built.
28+
29+
3. Install *compile-time* dependencies. These dependencies are only
30+
needed for the compiling process. This is best done in an Anaconda environment.
31+
For alternative package management systems, see the **Advanced** section below.
32+
To install the required packages in an Anaconda environment, run:
33+
34+
.. tabs::
35+
36+
.. tab:: MacOS / Linux
37+
38+
.. note::
39+
40+
On MacOS, make sure to install the Xcode command line tools by running
41+
``xcode-select --install`` from your terminal.
42+
43+
.. code-block:: bash
44+
45+
conda install -c conda-forge fortran-compiler cxx-compiler c-compiler openblas openmpi cmake ninja
46+
47+
48+
.. tab:: Windows
49+
50+
.. note::
51+
52+
On Windows, make sure to install Visual Studio with the *"Desktop development with C++"* workload.
53+
54+
.. code-block:: bash
55+
56+
conda install -c conda-forge cmake ninja ifx_win-64 mkl-devel conda-forge/label/mkl_rc::blas
57+
58+
59+
4. Create a *persistent* build tree for C/C++ development:
60+
61+
a. Run the CMake *configure* operation. This should be carried out by running:
62+
63+
.. code-block:: shell
64+
65+
python setup.py cmake
66+
67+
This effectively runs the standard CMake *configure* procedure
68+
(i.e., ``mkdir build && cd build && cmake ..``) but adds flags to ensure
69+
the proper libraries and compilers are found. The name of the resulting
70+
build directory will depend on factors such as your operating system,
71+
and the version of Python that is installed in the environment. An example
72+
might be ``./build/temp.linux-x86_64-cpython-39_local/``, where ``.`` refers
73+
to the directory that contains ``setup.py``.
74+
75+
b. Navigate into the build tree that was generated by the last step, and
76+
build the ``OpenSeesRT`` target to create ``libOpenSeesRT.so``:
77+
78+
.. code-block:: shell
79+
80+
cmake --build . --target OpenSeesRT -j8
81+
82+
c. When ``libOpenSeesRT.so`` is built in a persistent tree, the ``xara``
83+
package needs to be told where to find it. This is done by setting
84+
an environment variable with the name ``OPENSEESRT_LIB`` to point to
85+
the location of ``libOpenSeesRT.so`` in the build tree.
86+
You may want to add a line like the following to your shell
87+
startup script (e.g., ``.bashrc``):
88+
89+
.. code-block:: bash
90+
91+
conda env config vars set OPENSEESRT_LIB="/path/to/libOpenSeesRT.so" -n my_environment
92+
93+
94+
5. Check that everything was built properly:
95+
96+
.. code-block:: shell
97+
98+
python -m xara
99+
100+
This will start a *xara* interpreter which can be closed by running
101+
the ``exit`` command.
102+
103+
104+
105+
106+
107+
Debug Builds
108+
------------
109+
110+
The build type can be configured through the file ``setup.py``.
111+
For example, to change from a ``Release`` to ``Debug`` build, look for the following lines
112+
in ``setup.py`` and make the appropriate change:
113+
114+
.. code-block:: python
115+
116+
cmake_configure_options = [
117+
"-G", "Unix Makefiles",
118+
*EnvArgs,
119+
"-DCMAKE_BUILD_TYPE=DEBUG",
120+
# "-DCMAKE_BUILD_TYPE=RELEASE",
121+
]
122+
123+
After this change, rerun the CMake configure and build steps described in
124+
**Develop → Create a persistent build tree**.
125+
126+
127+
Advanced
128+
--------
129+
130+
The primary system dependencies required for compiling are LAPACK/BLAS and Tcl.
131+
Packages providing these libraries are listed below for various package
132+
management ecosystems.
133+
134+
.. important::
135+
136+
When building in an Anaconda environment, you should install **all** dependencies
137+
with ``conda`` or ``mamba``, and preferably from the ``conda-forge`` channel.
138+
See the **Anaconda** tab below for details.
139+
140+
.. tabs::
141+
142+
.. tab:: Linux (APT)
8143

9-
python -m pip install amoeba-build
144+
The *APT* package manager is used by Debian-based Linux distributions, including Ubuntu.
145+
146+
.. list-table::
147+
:header-rows: 1
148+
:widths: 30 70
149+
150+
* - Dependency
151+
- Package
152+
* - LAPACK
153+
- ``liblapack-dev``
154+
* - BLAS
155+
- ``libblas-dev``
156+
* - Tcl
157+
- ``tcl-dev``
158+
159+
.. tab:: Linux (Pacman)
160+
161+
The Pacman package manager is used by Arch Linux and Manjaro.
162+
163+
.. list-table::
164+
:header-rows: 1
165+
:widths: 30 70
166+
167+
* - Dependency
168+
- Package
169+
* - LAPACK
170+
- ``lapack``
171+
* - BLAS
172+
- ``blas``
173+
* - Tcl
174+
- ``tcl``
175+
176+
.. tab:: Yum (CentOS, Red Hat Linux)
177+
178+
.. list-table::
179+
:header-rows: 1
180+
:widths: 30 70
181+
182+
* - Dependency
183+
- Package
184+
* - LAPACK
185+
- ``lapack-devel``
186+
* - Tcl
187+
- ``tcl-devel``
188+
189+
190+
.. tabs::
191+
192+
.. tab:: MacOS / Linux
193+
194+
.. code-block:: bash
195+
196+
export OPENSEESRT_LIB="/path/to/your/compiled/libOpenSeesRT.so"
197+
198+
.. tab:: Windows (Powershell)
199+
200+
.. code-block:: powershell
10201
202+
$env:OPENSEESRT_LIB="/path/to/your/compiled/libOpenSeesRT.so"

0 commit comments

Comments
 (0)