SIGMA

Scalable Interfaces for Geometry and Mesh based Applications

Download and Build CGM

Posted by in CGM

Prerequisites:

Since CGM is mostly just an interface to various geometry engines, you’ll need one of those engines for CGM to use. There are various options:
* Facet-engine: CGM is distributed natively with a Facet-based geometry engine that can be used to reconstruct a continuous geometry from faceted surface mesh representations. While such a mechanism may not yield very accurate geometry reconstruction (since its typically based on minimum parametric angles as input), a more continuous solid modeling engine is recommended for complex applications. For simpler geometries, this native CGM interface is more than sufficient.
* Open.Cascade: CGM supports OCC in beta form right now. To use this option, install Open.Cascade v6.6, and use the –with-occ= configure option. (See FAQ for notes on patching OpenCascade for CGM).
To build CGM from sources

  1. Grab the code straight from the repository using Bitbucket, using the command ‘git clone [email protected]:fathomteam/cgm.git CGM’. Change into the CGM subdirectory.
  2. Run ‘autoreconf -fi’. NOTE: CGM relies on the autotools (autoconf, libtool, automake) that come with most LINUX/UNIX distributions. If they’re not part of your OS, or you’re getting mysterious autotools errors, you might want to try downloading/building more recent versions of those packages then trying again.
  3. In the top-level source directory (the one below which are geom/ and util/), run the configure script, with the various options you want. To get a list of options, run ./configure –help.
  4. Run make, then make install. This will install the CGM include files and libraries in include/ and lib/ subdirectories below the prefix directory input to the configure script (which is /usr/local by default; change with the –prefix= configure option).

Now you are ready to use the CGM library.

Mac OSX

All above steps are general and work on Linux. Notes and limitations on Mac OSX are listed below:
CGM has been tested with OCC (6.5.x, 6.6.x, 6.7.0), OCE (0.10, 0.13, 0.16) and previously supported Cubit versions (12.0, 13.1, 14.0, 15.0) 32-bit and 64-bit versions. But recently, the Cubit support has been removed due to licensing restrictions.
OCE
Install Open CASCADE Community Edition (OCE) and use the –with-occ= configure option. Note that OCE places the include files into INCLUDE_DIR/oce, while CGM searches for include files in the INCLUDE_DIR. This can be done by specifying OCE_INSTALL_INCLUDE_DIR. It might also be required to set OCE_INSTALL_PREFIX. From CGM v14.1, the configuration has been modified to look at both INCLUDE_DIR and INCLUDE_DIR/oce.
Recently, all the patches for our OCE builds have been incorporated natively in the original source repository. This means that starting from OCE version 0.17.1, additional patches for CGM are not necessary. However, if you are working with older versions of OCC/OCE, The patched version of the OCE sources available at SIGMA’s fork has been tested with different platforms. Use the following branches depending on the versions needed.

  1. OCC 6.7.1 <=> OCE 0.16 <=> Branch sigma/oce_0.16_occ_6.7.1
  2. OCC 6.6.0 <=> OCE 0.13 <=> Branch sigma/oce_0.13_occ_6.6
  3. OCC 6.5.3 <=> OCE 0.10 <=> Branch sigma/oce_0.10_occ_6.5.3

OCC
OCC versions 6.5.x, 6.6.x, 6.7.0 have been thoroughly tested on various platforms (Linux, OSX and partial support on Windows).
Facet engine
Several tests are run nightly with a faceted representation of geometries either specified through STL files or built within the CGM code framework. To configure with this support, the user does not have to specify any configure options since it is built by default.


Copyright © 2014--2023 SIGMA. All Rights Reserved.