Scalable Interfaces for Geometry and Mesh based Applications

Frequently Asked Questions (FAQ)

Posted by on Jul 23, 2014 in CGM

  • How do I build CGM from scratch?
  • I get warnings about “Attribute type -1 not recognized”?

    CGM has a “geometry attributes” capability which allows applications to define their own attributes, and write those attributes to the geometric model when the model is saved to a file. Attribute types are registered with the attribute manager upon instantiation of CGM, and are assigned an ID number. When reading in a new model, CGM matches the attribute name to a previously-registered attribute name and returns the ID number. If an attribute is found whose name has not been registered, CGM emits the error:

    ERROR: Attribute type -1 not recognized.

    CUBIT uses attributes to store mesh-related data, including things like mesh scheme and mesh interval specified by the user. When a model from CUBIT is read into CGM, the CUBIT attributes will not have been registered, therefore you get an error when those attributes are encountered. More information about CGM’s internals can be found here and here.

  • Linking warning about “tmpnam”

    When linking CGM applications, sometimes you get the link warning that looks something like: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

    This is a known problem, due to the use of a “tmpnam” function for naming a temporary file. We have not seen any problem with its use in the past.

  • Linking warning about libstdc++

    When I link an application of CGM using CUBIT’s shared libs, I get the following link warning:

    /usr/bin/ld: warning:, needed by <...>/lib/, may conflict with

    This warning is due to CUBIT’s shared library ( depending on a specific version of libstdc++, rather than a generic version of the library. This usually is not a problem. In cases where it does produce an error, one workaround may be to symbolic-link to on your system (though we don’t vouch for the safety of doing this on your system).

  • Patching OCC for CGM

    OpenCASCADE must be patched to enable all CGM tests to run correctly and to fix problems building on Linux 10.x/GCC 4.4.x.The occ_patches file should be your CGM source tree at <CGM_SOURCE>/geom/OCC. Once you have downloaded and untarred the OpenCASCADE software there should be an OpenCASCADE6.3.0 directory. Change to that directory. To apply the patch do the following:

    patch -p0 < <CGM_SOURCE>/geom/OCC/occ_patches

    This should apply the patches to your OpenCASCADE software. If the patch command did not work you can open the occ_patches file and find the files that need to be modified. You can then manually change them as described in the patch file. Once the patch has been applied you can then build/rebuild OpenCASCADE.

  • Building with OCC support

    Building OCC 6.5 on a linux system (Ubuntu, but probably others too) requires:As specified in the build dependencies for OCC 6.5, you will need version 2.1.2 of the FTGL library. Debian & Ubuntu provide packages for FTGL, but only 2.1.3-RC5 which seems to have significant API changes despite the patch-type version number change. So you have to build this library from source and then when building OCC specify the –with-ftgl=<dir> configure option to tell it where you installed the FTGL library.That option, combined with “CPPFLAGS=-I/usr/include/freetype2” was sufficient to get OCC 6.5 to build on my system.

    For building with OCC 6.6 on Ubuntu 12.04, follow the link.

Copyright © 2014 SIGMA. All Rights Reserved.