mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
docs code block formatting
`console` type code-block is designed mainly for examples of the console commands with the output. If it's just a shell script with comments, then `console` only gets in the way - e.g. if you try to select a console code block manually, you won't be able to select comment symbol `#` at the beginning of the command making code unrunnable if you try to copy and run it. I've replaced it with `bash` or `bat` (for Windows) code blocks where `console` wasn't necessary. I've also removed `$` symbols at the beginning of the commands if it's not a `console` code-block - since otherwise it just breaks "Copy Code Block" because you copy unrunnable code.
This commit is contained in:
@@ -46,9 +46,9 @@ operating systems. GCC (4.7 or newer) or Clang (any version) is required.
|
||||
|
||||
1. Fetch the latest source code, including all submodules.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -57,16 +57,16 @@ operating systems. GCC (4.7 or newer) or Clang (any version) is required.
|
||||
|
||||
2. Install basic dependencies:
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libcgal-dev
|
||||
sudo apt-get install git cmake gcc g++ libboost-all-dev libcgal-dev
|
||||
|
||||
3. Install OpenCascade Technology (OCCT). Officially v7.5.0 is supported. Other
|
||||
versions may have unexpected behaviour.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev
|
||||
sudo apt-get install libocct-data-exchange-dev libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev
|
||||
|
||||
.. seealso::
|
||||
|
||||
@@ -76,22 +76,22 @@ operating systems. GCC (4.7 or newer) or Clang (any version) is required.
|
||||
Another alternative is to use OpenCascade Community Edition (OCE), but it may
|
||||
lag behind OCCT and is no longer actively maintained so is not recommended.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
|
||||
sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
|
||||
|
||||
As a final alternative, you may also manually compile OCE:
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
|
||||
$ git clone https://github.com/tpaviot/oce.git
|
||||
$ cd oce
|
||||
$ mkdir build && cd build
|
||||
$ cmake ..
|
||||
sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
|
||||
git clone https://github.com/tpaviot/oce.git
|
||||
cd oce
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
# Replace X with number of CPU cores + 1
|
||||
$ make -j X
|
||||
$ sudo make install
|
||||
make -j X
|
||||
sudo make install
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -102,40 +102,40 @@ operating systems. GCC (4.7 or newer) or Clang (any version) is required.
|
||||
|
||||
4. For building IfcConvert with COLLADA (.dae) support (ON by default), OpenCOLLADA is needed:
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install libpcre3-dev libxml2-dev
|
||||
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
|
||||
$ cd OpenCOLLADA
|
||||
sudo apt-get install libpcre3-dev libxml2-dev
|
||||
git clone https://github.com/KhronosGroup/OpenCOLLADA.git
|
||||
cd OpenCOLLADA
|
||||
# Using a known good revision, but HEAD should work too:
|
||||
$ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
|
||||
$ mkdir build && cd build
|
||||
$ cmake ..
|
||||
git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
# Replace X with number of CPU cores + 1
|
||||
$ make -j X
|
||||
$ sudo make install
|
||||
make -j X
|
||||
sudo make install
|
||||
|
||||
5. For building the IfcPython wrapper (ON by default), SWIG and Python development are needed:
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install python-all-dev swig
|
||||
sudo apt-get install python-all-dev swig
|
||||
|
||||
6. For building support for HDF5 caching (ON by default), install dependencies:
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo apt-get install libhdf5-dev libaec-dev zlibc
|
||||
sudo apt-get install libhdf5-dev libaec-dev zlibc
|
||||
|
||||
7. Compile IfcOpenShell itself.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd /path/to/IfcOpenShell
|
||||
$ mkdir build && cd build
|
||||
cd /path/to/IfcOpenShell
|
||||
mkdir build && cd build
|
||||
# Customise the compile options to suit your environment
|
||||
# Check all paths are valid for your environment
|
||||
$ cmake ../cmake \
|
||||
cmake ../cmake \
|
||||
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
|
||||
-DOCC_INCLUDE_DIR=/usr/include/ \
|
||||
|
||||
@@ -156,9 +156,9 @@ operating systems. GCC (4.7 or newer) or Clang (any version) is required.
|
||||
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
|
||||
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu
|
||||
# Replace X with number of CPU cores + 1
|
||||
$ make -j X
|
||||
make -j X
|
||||
# Optionally install to the system
|
||||
$ sudo make install
|
||||
sudo make install
|
||||
|
||||
|
||||
Compiling on MacOS
|
||||
@@ -168,9 +168,9 @@ GCC (4.7 or newer) or Clang (any version) is required.
|
||||
|
||||
1. Fetch the latest source code, including all submodules.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -179,22 +179,22 @@ GCC (4.7 or newer) or Clang (any version) is required.
|
||||
|
||||
2. Install all dependencies using `Homebrew <https://brew.sh/>`__
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ brew install boost cmake python3 cgal ftgl gmp libaec opencascade swig hdf5 zlib
|
||||
brew install boost cmake python3 cgal ftgl gmp libaec opencascade swig hdf5 zlib
|
||||
# homebrew automatically links most libraries, except some keg-only ones
|
||||
$ brew link zlib --force
|
||||
brew link zlib --force
|
||||
|
||||
3. Build IfcOpenShell with flags for Homebrew dependencies: (``/usr/local/``) for Intel machines with x84_64 architecture,
|
||||
(``/opt/homebrew/``) for Apple Silicon processors with arm64 architecture.
|
||||
|
||||
::
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd /path/to/IfcOpenShell
|
||||
$ mkdir build && cd build
|
||||
cd /path/to/IfcOpenShell
|
||||
mkdir build && cd build
|
||||
# set library flags
|
||||
$ export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
|
||||
$ cmake ../cmake \
|
||||
export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress"
|
||||
cmake ../cmake \
|
||||
-DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.10 \
|
||||
-DPYTHON_LIBRARY=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib \
|
||||
-DPYTHON_INCLUDE_DIR=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/ \
|
||||
@@ -207,7 +207,7 @@ GCC (4.7 or newer) or Clang (any version) is required.
|
||||
-DHDF5_INCLUDE_DIR=/opt/homebrew/include/ \
|
||||
-DCOLLADA_SUPPORT=0
|
||||
# `sysctl -n hw.ncpu` returns the number of cpu cores on macOS
|
||||
$ make -j$(sysctl -n hw.ncpu)
|
||||
make -j$(sysctl -n hw.ncpu)
|
||||
|
||||
Compiling on Windows (Visual Studio)
|
||||
------------------------------------
|
||||
@@ -218,9 +218,9 @@ C++ Build Tools <http://landinghub.visualstudio.com/visual-cpp-build-tools>`__).
|
||||
|
||||
1. Fetch the latest source code, including all submodules.
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -230,17 +230,17 @@ C++ Build Tools <http://landinghub.visualstudio.com/visual-cpp-build-tools>`__).
|
||||
2. Assuming Visual Studio 2015 x64 environment variables set, build dependencies
|
||||
and run cmake.
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ cd IfcOpenShell\win
|
||||
$ build-deps.cmd
|
||||
$ run-cmake.bat
|
||||
cd IfcOpenShell\win
|
||||
build-deps.cmd
|
||||
run-cmake.bat
|
||||
|
||||
3. Open and build the solution file in Visual Studio:
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ ..\build-vs2015-x64\IfcOpenShell.sln
|
||||
..\build-vs2015-x64\IfcOpenShell.sln
|
||||
|
||||
As the scripts default to using the ``RelWithDebInfo`` configuration, and a
|
||||
freshly created solution by CMake defaults to ``Debug``, make sure to switch the
|
||||
@@ -252,9 +252,9 @@ C++ Build Tools <http://landinghub.visualstudio.com/visual-cpp-build-tools>`__).
|
||||
project easily from the command-line (installing a project will build it
|
||||
also, if required):
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ install-ifcopenshell.bat
|
||||
install-ifcopenshell.bat
|
||||
|
||||
.. seealso::
|
||||
|
||||
@@ -270,9 +270,9 @@ This is for users of `MSYS2 <https://msys2.github.io/>`__ and `MinGW
|
||||
|
||||
1. Fetch the latest source code, including all submodules.
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -281,12 +281,12 @@ This is for users of `MSYS2 <https://msys2.github.io/>`__ and `MinGW
|
||||
|
||||
2. Start the MSYS2 Shell and then:
|
||||
|
||||
::
|
||||
.. code-block:: bat
|
||||
|
||||
$ cd IfcOpenShell/win
|
||||
$ ./build-deps.sh
|
||||
$ ./run-cmake.sh
|
||||
$ ./install-ifcopenshell.sh
|
||||
cd IfcOpenShell/win
|
||||
./build-deps.sh
|
||||
./run-cmake.sh
|
||||
./install-ifcopenshell.sh
|
||||
|
||||
.. seealso::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user