Environment Variables

To run any Open CASCADE Technology application you need to set the environment variables.

要运行任何 Open CASCADE Technology 应用程序,您需要设置环境变量。

On Windows 在 Windows 上

You can define the environment variables with env.bat script located in the $CASROOT folder. This script accepts two arguments to be used: the version of Visual Studio (vc12 – vc143) and the architecture (win32 or win64).

The additional environment settings necessary for compiling OCCT libraries and samples by Microsoft Visual Studio can be set using script custom.bat located in the same folder. You might need to edit this script to correct the paths to third-party libraries if they are installed on your system in a non-default location.

Script msvc.bat can be used with the same arguments for immediate launch of Visual Studio for (re)compiling OCCT.

您可以使用 $CASROOT 文件夹中的 env.bat 脚本定义环境变量。此脚本接受两个要使用的参数:Visual Studio 的版本 (vc12 – vc143) 和体系结构(win32 或 win64)。

通过 Microsoft Visual Studio 编译 OCCT 库和示例所需的其他环境设置,可以使用位于同一文件夹中的脚本 custom.bat 进行设置。如果第三方库安装在系统上的非默认位置,您可能需要编辑此脚本来更正第三方库的路径。

脚本 msvc.bat 可以与相同的参数一起使用,以立即启动 Visual Studio 来编译或重编译 OCCT。

On Unix 在Unix上

If OCCT was built by Code::Blocks, you can define the environment variables with env_cbp.sh or custom_cbp.sh script.

If OCCT was built by Automake, you can define the environment variables with env_amk.sh or custom_amk.sh script.

The scripts are located in the OCCT root folder.

如果 OCCT 是由 Code::Blocks 构建的,您可以使用 env_cbp.sh 或 custom_cbp.sh 脚本定义环境变量。

如果 OCCT 是由 Automake 构建的,您可以使用 env_amk.sh 或 custom_amk.sh 脚本定义环境变量。

这些脚本位于 OCCT 根文件夹中。

Description of system variables: 系统变量说明:

  • CASROOT is used to define the root directory of Open CASCADE Technology;

  • PATH is required to define the path to OCCT binaries and 3rdparty folder;

  • LD_LIBRARY_PATH is required to define the path to OCCT libraries (on UNIX platforms only; DYLD_LIBRARY_PATH variable in case of macOS);

  • MMGT_OPT (optional) if set to 1, the memory manager performs optimizations as described below; if set to 2, Intel (R) TBB optimized memory manager is used; if 0 (default), every memory block is allocated in C memory heap directly (via malloc() and free() functions). In the latter case, all other options starting with MMGT, except MMGT_CLEAR, are ignored;

  • CASROOT用于定义Open CASCADE Technology的根目录;

  • PATH用于定义 OCCT 二进制文件和 3rdparty 文件夹的路径;

  • LD_LIBRARY_PATH用于定义 OCCT 库的路径(仅在 UNIX 平台上;对于 macOS,需要DYLD_LIBRARY_PATH变量);

  • MMGT_OPT(可选)如果设置为 1,内存管理器将执行如下所述的优化;如果设置为 2,则使用 Intel (R) TBB 优化内存管理器;如果为 0(默认),则每个内存块都直接在 C 内存堆中分配(通过 malloc() 和 free() 函数)。在后一种情况下,除了 MMGT_CLEAR 之外,以MMGT开头的所有其他选项都将被忽略;

  • MMGT_CLEAR (optional) if set to 1 (default), every allocated memory block is cleared by zeros; if set to 0, memory block is returned as it is;

  • MMGT_CELLSIZE (optional) defines the maximal size of blocks allocated in large pools of memory. Default is 200;

  • MMGT_NBPAGES (optional) defines the size of memory chunks allocated for small blocks in pages (operating-system dependent). Default is 10000;

  • MMGT_THRESHOLD (optional) defines the maximal size of blocks that are recycled internally instead of being returned to the heap. Default is 40000;

  • MMGT_MMAP (optional) when set to 1 (default), large memory blocks are allocated using memory mapping functions of the operating system; if set to 0, they will be allocated in the C heap by malloc();

  • MMGT_CLEAR(可选)如果设置为1(默认),则每个分配的内存块都被清零;如果设置为0,则按原样返回内存块;

  • MMGT_CELLSIZE(可选)定义在大型内存池中分配的块的最大大小。默认为 200;

  • MMGT_NBPAGES(可选)定义为页面中的小块分配的内存块的大小(取决于操作系统)。默认为 10000;

  • MMGT_THRESHOLD(可选)定义内部回收而不是返回到堆的块的最大大小。默认为 40000;

  • MMGT_MMAP(可选)当设置为1(默认)时,使用操作系统的内存映射函数分配大内存块;如果设置为0,它们将通过malloc()分配在C堆中;

  • CSF_LANGUAGE (optional) defines default language of messages;

  • CSF_DEBUG (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;

  • CSF_DEBUG_BOP (optional): if defined then it should specify directory where diagnostic data on problems occurred in Boolean operations will be saved;

  • CSF_MDTVTexturesDirectory defines the directory for available textures when using texture mapping;

  • CSF_ShadersDirectory (optional) defines the directory for GLSL programs for Ray Tracing renderer (embedded resources are used when variable is undefined);

  • CSF_LANGUAGE(可选)定义消息的默认语言;

  • CSF_DEBUG(可选,仅限 Windows):如果定义,则在出现异常时显示诊断消息;

  • CSF_DEBUG_BOP(可选):如果定义,则应指定保存布尔运算中出现问题的诊断数据的目录;

  • CSF_MDTVTexturesDirectory定义使用纹理映射时可用纹理的目录;

  • CSF_ShadersDirectory(可选)定义光线追踪渲染器的 GLSL 程序的目录(当变量未定义时使用嵌入资源);

  • CSF_SHMessage (optional) defines the path to the messages file for ShapeHealing;

  • CSF_XSMessage (optional) defines the path to the messages file for STEP and IGES translators;

  • CSF_StandardDefaults, CSF_StandardLiteDefaults, CSF_XCAFDefaults, and CSF_PluginDefaults define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents);

  • CSF_IGESDefaults and CSF_STEPDefaults (optional) define paths to directory where resource files of IGES and STEP translators are located;

  • CSF_XmlOcafResource is required in order to set the path to XSD resources, which defines XML grammar.

  • CSF_MIGRATION_TYPES is required in order to read documents that contain old data types, such as TDataStd_Shape;

  • CSF_SHMessage (可选)定义ShapeHealing的消息文件的路径;

  • CSF_XSMessage (可选)定义STEP和IGES转换器的消息文件的路径;

  • CSF_StandardDefaults、CSF_StandardLiteDefaults、CSF_XCAFDefaultsCSF_PluginDefaults定义 OCAF 持久性配置文件所在目录的路径(对 OCAF 文档进行打开/保存操作所需);

  • CSF_IGESDefaultsCSF_STEPDefaults(可选)定义IGES和STEP转换器资源文件所在目录的路径;

  • CSF_XmlOcafResource用于设置XSD资源的路径,XSD资源定义了 XML 语法;

  • CSF_MIGRATION_TYPES用于读取包含旧数据类型的文档,例如TDataStd_Shape。

Last updated