Build Kit

SEDRIS SDK Release 4.1.4

July 1, 2011

  1. Introduction
  2. Supported Platforms And Compilers
  3. Build Requirements
  4. Build Options and Commands
  5. Compiling
  6. Running Core Applications / Testing the Build
  7. Using the Libraries
  8. Problems with the Build
  9. Recommended Reading
  10. Bug Reports and Feedback
  11. Web Pages

Introduction

This page covers instructions on how to compile this SEDRIS SDK. In addition, it provides steps that can be used to verify that the compilation completed successfully.

NOTE: This document is intended for those users who are building the SEDRIS libraries from the source code distributions. Pre-compiled (binary) distributions for both static and dynamic linking for all supported platforms are available for download from the SEDRIS Web Site.

The SEDRIS SDK includes other SDKs as part of its distribution. If you need to work with those SDKs as separate components, see the Release Notes for the included SDKs:

For general information about this release, where to obtain it, and items that require specific attention, see the Release Notes.

For help, comments, and bug reports please send email to help@sedris.org. If you are an associate, please use se-coders@sedris.org.

Return to: Top

Supported Platforms And Compilers

If you require SEDRIS support on other platforms or compilers, you can send email to se-scrccb@sedris.org stating the specific platform, operating system, and C/C++ compiler requirements. The SEDRIS project will try to accommodate your requests as much as possible.

Platform Compiler
Linux
(RH9 with kernel 2.4.20-8
and FC4 with kernel 2.6)
  • GCC 3.2.2, 4.0.1, 4.3.4
Windows 98/Me/NT/2000/XP
  • Microsoft Visual C++ 6.0, .NET 2003, 2005, 2008, 2010
  • Cygwin 1.5, 1.6, 1.7 w/GCC 3.2.2, 4.0.1, 4.3.4
Irix 6.5 (n32 only)
  • MipsPro 7.2 (n32 only)
  • GCC 3.2.2
SunOS 5.6
  • SC 5.2 - Forte (without optimization) (requires compiler patches: 105591-09, 106327-11, 106300-12, 106950-16, and 104631-07)
  • GCC 3.2.2
SunOS 5.7
  • SC 5.2 - Forte (without optimization) (requires compiler patches: 105591-09, 106327-11, 106300-12, 106950-16, and 104631-07)
  • GCC 3.2.2

Return to: Top


Build Requirements

The SEDRIS software will compile and work "out-of-the-box" on all supported systems. However, your particular system may have different libraries or different versions of the make utility and compiler versions, so read the following sections carefully to verify your system.

To compile and run the Model Viewer application included in this release you will need the following libraries installed:

The build requirements for Unix and Win32 environments are:

Unix

The SDK Build Environment for Unix requires the use of the GNU "make" utility (the "gmake" program) version 3.78.1 or higher, older versions will not work. GNU "make" is freely available under the GNU General Public License and may be downloaded via several mirror sites. You can verify your availability of "make" and its version by just executing the command "make -v". If you get a "command not found" error, you may need to install it.

You will also need the OpenGL and GLUT libraries to build the Model Viewer tool. There are binary distributions of these libraries available for most operating systems, so follow the instructions provided in those distributions. Typically, this will involve installing the headers under your compiler's "include/GL" directory (e.g. "/usr/include/GL"), libraries under your linker's "lib" directory (e.g. "/usr/lib"), and the runtime libraries under a directory accessible by the "LD_LIBRARY_PATH" variable (e.g. "/usr/lib").

Win32

The SDK Build Environments for Win32 are based on Microsoft Visual Studio editions with Visual C++. Workspace files ("*.dsw") are available for Visual Studio 6.0, and solution files ("*.sln") for Visual Studio .NET 2003, 2005, 2008, and 2010 (an upgrade process will be triggered for the 2005, 2008, and 2010 versions; use default upgrade options if prompted).

A default installation of Microsoft Visual Studio should be sufficient to successfully build all the SDK libraries and applications. The only exception is the Model Viewer tool, which requires that the OpenGL and GLUT libraries be installed. The OpenGL headers and libraries should have been installed by default when you installed Visual Studio, and your Windows system should also have all the OpenGL runtime libraries you will need.

The GLUT distributions include the headers, libraries, and DLLs. Install the header files in the Visual C++ installation "include" sub-directory ("VC98\include\GL", "VC7\include\GL", or "VC\include\GL" depending on your version), the libraries in the "lib" sub-directory, and the runtime libraries "glut.dll" and "glut32.dll" in your Windows "system" directory (typically "C:\Windows\System" or "C:\Windows\System32").

Return to: Top

Build Options and Commands

The following is a list of the most common build environment variables and commands for the SDK Build Environment for Unix. The options for the SDK Build Environment for Win32 are controlled from the Visual C++ IDE interface.

The default settings are marked with an asterisk "*" and in bold. Also note that you can use "YES", "TRUE", "ON", and "1" to signify an "active" state, and "NO", "FALSE", "OFF", and "0" to signify a "non-active" state (you can use all lower or all upper case letters - no mixed case).

Variable Valid Settings Description
BUILD_MODE OPT*, STD, DEBUG, PROF Compile mode: optimized, standard, debug, or profiling. (Default is optimized)
BIND_STATIC YES, NO* Static linking. (Default is dynamic linking)
USE_GNU YES, NO* Use gcc/g++. ('YES' is the default for Linux)
VERBOSE YES, NO* Verbosity Level. ('YES' causes an increased amount of information to be printed)

The following is a list of the most common build environment commands for Unix:

Command Description
make env Displays the current build settings.
make Builds software contained in the current directory and installs to "[root]/lib/platform" or "[root]/bin/platform" directory.
make clean Deletes compiled software from current directory.
make realclean Deletes compiled software from "[root]/lib/platform" and "[root]/bin/platform" directory. Also performs a "make clean" of current directory and removes headers from the "include" directory.
make distclean Only operates on the entire release from the "[root]" directory. Removes all ".objects" and ".depends" directories, the "lib" and "bin" directories, and removes all header files from the "include" directory, returning the entire release to its original "pristine" state. Note that a sharing violation may occur if the command tries to delete files that you are currently using (like one of the SDK applications still running).

Return to: Top

Compiling

Compiling the libraries and applications on all supported platforms requires only a few simple steps. In the following sections, the "[root]" directory is where you extracted the SDK source code.

Unix

A "make" command in the "[root]" directory will recursively go through the SDK directory structure and build all libraries and applications provided with the distribution using the default settings. For this release, the default settings are:

  • BUILD_MODE=OPT
  • BIND_STATIC=no
  • USE_GNU=false (set to true under Linux by default)
  • USE_MESA=no

These settings will compile the release using optimization and dynamic linking.

Win32

Follow these steps to build all the SDK libraries and applications:

  1. From Windows Explorer, locate and run (i.e. double click) the "win32_headers.bat" file in the "[root]" directory of your installation. This step creates the top "include" directory with all the header files for the technology components.
  2. If you want to compile the SDK using Dynamic linking (i.e. linking against DLLs), open the "vcpp_dynamic.dsw" project workspace file for VC++ 6.0, or open the "vcpp_dynamic.sln" solution file for VC++ .NET 2003, 2005, 2008, or 2010. For Static linking, open the "vcpp_static.dsw" file or "vcpp_static.sln" file instead.
  3. From the Visual C++ IDE, select "all_sdk" as your "Active Project" and "Release" or "Debug" for your "Active Configuration". For example, to compile in "Release" mode, choose "Build->Set Active Configuration..." and select the "all_sdk - Win32 Release" entry.
  4. From the "Build" menu, choose "Rebuild All".

Notes:

  • If you will be switching between the Static and Dynamic project workspaces, make sure to use the "Rebuild All" command so that the previous compilation files are deleted.
  • You can build individual applications by making them the current "Active Project" ("Project->Set Active Project" menu), and choosing "Rebuild All".
  • If you open a project solution file in Visual Studio 2005, 2008, or 2010, an upgrade process will be triggered automatically; accept the default options (if prompted) to produce an updated project and proceed with the build normally.

If you have any errors or warnings reported by the build process, see Problems with the Build.

Return to: Top


Running Core Applications / Testing the Build

In order to run the included applications, you will need to add, to your current path, the paths where the libraries are. (if compiled "dynamic")

Unix

The names of the application and library directories can be retrieved by executing the command "make env". Look for the lines containing "EXE_DIR" and "LIB_DIR". For example, you can use the command "make env | grep _DIR" to list all the directories specified by the build environment. You can also do an "ls" in the "[root]/bin" and "[root]/lib" directories (and their subdirectories) to find where the applications or libraries reside. For example, on a Linux system, the path to the executable applications might be "[root]/bin/linux-2.4.20-8-i386/OPT". You will need to add this application directory to your "PATH" environment variable, and similarly the libraries directory to your "LD_LIBRARY_PATH" directory. For example, to add the previous Linux executable applications path in a Bash shell, you can use

  > export PATH=$PATH:[root]/bin/linux-2.4.20-8-i386/OPT

for the bin directory and,

  > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[root]/lib/linux-2.4.20-8-i386/OPT

for the lib directory. Remember to replace "[root]" with the path where you installed the SEDRIS package.

Win32

The executable applications reside in the "[root]\bin\Release" or "[root]\bin\Debug" depending on build mode. Similarly, the libraries reside in either "[root]\lib\Release" or "[root]\lib\Debug". From a DOS Prompt, add these directories to the "PATH" environment variable by using the command "set PATH=[root]\bin\Release;[root]\lib\Release;%PATH%" (or use "Debug" instead of "Release" if you compiled in "Debug" mode). Remember to replace "[root]" with the path where you installed the SEDRIS package.

An alternative to setting the "PATH" environment variable from the DOS Prompt is to use the System Properties in Control Panel to globally change the "PATH" variable. A limitation of this approach is that doing this could prevent multiple SEDRIS SDK installation/application versions to properly operate within the same system.

You are now ready to try one of the SEDRIS applications. From the "[root]" directory, execute the command

This will run the Depth Tool on the transmittal "test.stf". You should see a quick scroll of object classes and a final couple of lines looking like:

              1       Transmittal Summary
              1       Union of Geometry Hierarchy
              2       Union of Primitive Geometry
             27       Vertex
      Total object count = 114

If you see something like what is shown above, you have successfully compiled the SEDRIS SDK!

To learn more about the applications included in the SEDRIS SDK and sample runs, see the Tools And Utilities page.

More information on runtime issues is available in the Release Notes page.

Return to: Top


Using the Libraries

This section describes the steps needed to link your software against the libraries produced by this SDK. Applications and/or libraries that use this SDK will need to refer to the "[root]/include" directory for compilation, and the libraries in the "[root]/lib" subdirectories for linking. The examples that follow create an application called "myapp" which you can use as a starting point for your own development.

The library your applications will need to link against for the SEDRIS SDK is called "libsedris.a" in Unix, and "sedris.lib" for the C SDK or "sedris_cpp.lib" for the C++ SDK in Win32 environments.

Unix

The Unix Build Environment uses standard Makefiles and "include" files that specify the process for compiling and linking the applications and libraries. The following steps show how to integrate an application into the build environment. If you want to create an application in another directory, you will need to change the relative paths as appropriate.

  1. From a Unix shell, create a new directory called "myapp" under "[root]/src/apps".
  2. Create a "Makefile" file in the "myapp" directory with the following lines:
    DEPTH =  ../../..
    
    include $(DEPTH)/src/templates/setup.mk
    
    include localdefs.mk
    
    BUILD_OPTIONS =  \
    	BUILD_MODE=$(BUILD_MODE) \
    	USE_SEDEBUG=$(USE_SEDEBUG) \
    	BIND_STATIC=$(BIND_STATIC) \
    	USE_GNU=$(USE_GNU) \
    	USE_MIPSPRO72=$(USE_MIPSPRO72) \
    	USE_MIPSPRO73=$(USE_MIPSPRO73) \
    	USE_SC40=$(USE_SC40) \
    	USE_SC50=$(USE_SC50) \
    	VERBOSE=$(VERBOSE) \
    	USE_DEPEND=$(USE_DEPEND) \
    	API_IMPL=$(API_IMPL)
    
    all:
    	@($(MAKE) $(MAKE_NO_PRINT) -C $(DEPTH) $(BUILD_OPTIONS) \
    	dir_targets app_$(APPNAME))
    
    clean::
    	@($(MAKE) $(MAKE_NO_PRINT) -C $(DEPTH) $(BUILD_OPTIONS) \
    	dir_targets clean_app_$(APPNAME)_tgt)
    
    realclean::
    	@($(MAKE) $(MAKE_NO_PRINT) -C $(DEPTH) $(BUILD_OPTIONS) \
    	dir_targets realclean_app_$(APPNAME)_tgt)
    
    header_targets:
    
    lib_targets:
    
    app_targets:
    
  3. Create a "localdefs.mk" file in the "myapp" directory with the following lines:
    include $(DEPTH)/src/templates/cleanup_macros.mk
    
    DIR_PATH := src/apps/myapp
    APPNAME := myapp
    
    C_SOURCES := myapp.c
    
    CXX_SOURCES :=
    
    REQUIRED_LIBS := $(SEDRIS_CORE_LIBS)
    
    LOCAL_INCLUDES := -I$(INC_DIR)
    
    include $(DEPTH)/src/templates/localtargets.mk
    
  4. Put your "myapp.c" source code file into the "myapp" directory.
  5. You should now be able to run the "make" command from the "[root]" directory and have your application compiled and linked against the SDK libraries.

 

Win32 Application

To compile your own applications from the Win32 Build Environment, use one of the provided applications as a model for your project files (the ".dsp" files), edit them as needed, insert them into the appropriate workspace (either "vcpp_dynamic.dsw" or "vcpp_static.dsw") by using the VC++ menu command "Project->Insert Project Into Workspace...", and set the project dependencies as done for the other applications. As an alternative, you can create the project from scratch directly from the SDK workspace. The following steps show you exactly how to do this.

The following steps create an application to be linked dynamically against the SDK libraries. The application will be created in the "[root]/src/apps" directory. If you want to create an application in another directory, you will need to change the relative paths as appropriate.

Note: The following examples are written for the VC++ 6.0 compiler, but the techniques for later VC++ versions are similar.

  1. Open the "vcpp_dynamic.dsw" file.
  2. Select "Project->Add To Project->New...".
  3. Choose the "Projects" tab in the "New" dialog, and select "Win32 Console Application".
  4. In the "Location:" box, click the "..." button and navigate to the "[root]/src/apps" directory, and click the "OK" button.
  5. In the "Project name:" box, enter "myapp".
  6. Verify the "Add to current workspace" choice is selected, and click the "OK" button
  7. In the next dialog, leave the selection to "An empty project", click the "Finish" button, and the "OK" button in the next dialog.
  8. Your new project is now in the workspace, and it should be "bolded" indicating it is the current project. If it is not, use the "Project->Set Active Project" menu to make it active.
  9. Choose "Project->Add To Project->Files...", and add your source code files to it.
  10. Choose "Project->Settings...", select the "myapp" project on the left side of the "Project Settings" dialog, and choose "Win32 Release" for the "Settings For:" drop down menu on the top left of the dialog.
  11. In the "General" tab, enter "../../../bin/Release" in the "Output files:" box.
  12. In the "C/C++" tab, choose "Code Generation" in the "Category:" drop down menu, and choose "Multithreaded DLL" in the "Use run-time library:" drop down menu.
  13. Now choose "Win32 Debug" for the "Settings For:" drop down menu.
  14. In the "C/C++" tab, choose "Code Generation" in the "Category:" drop down menu, and choose "Debug Multithreaded DLL" in the "Use run-time library:" drop down menu.
  15. In the "General" tab, enter "../../../bin/Debug" in the "Output files:" box.
  16. Now choose "All Configurations" for the "Settings For:" drop down menu.
  17. In the "C/C++" tab, choose "Preprocessor" in the "Category:" drop down menu, and enter "../../../include" in the "Additional include directories:" box.
  18. Click the "OK" button in the "Project Settings" dialog.
  19. Choose "Project->Dependencies...", and select "myapp" in the "Select project to modify:" drop down menu.
  20. Click the box beside the "sedris" entry in the "Dependent on the following project(s):" scroll list so that a check mark is inside it, and click the "OK" button.
  21. You should now be able to build your project by pressing the "F7" key or from the menu by choosing "Build->Build myapp.exe".
  22. The executable will be located in the "[root]\bin\Release" or "[root]\bin\Debug" directory depending on your build mode.

To create a project for static linking, see the settings for those applications in the static workspace and set the preprocessor definition

EXPORT_DLL="" for VC++ 6.0 or EXPORT_DLL= for later versions
in the "Preprocessor definitions" options for your project. You can do this from the VC++ IDE using the following steps:
  1. Open your project and choose "Project->Settings...".
  2. Select "All Configurations" in the "Settings For:" drop down menu.
  3. Select your application project on the left part of the dialog.
  4. In the "C/C++" tab, select "General" in the "Category:" drop down menu.
  5. In the "Preprocessor definitions:", enter the following at the end of all other entries:
    ,EXPORT_DLL=""
  6. Click "OK" and build your project using "Build->Rebuild All".

 

Win32 Library

If you are linking your own libraries against this SDK library, you will need to set a preprocessor definition in your project files or "unresolved" errors will appear when linking. From the Visual C++ IDE, use the following steps:

  1. Open your project and choose "Project->Settings...".
  2. Select "All Configurations" in the "Settings For:" drop down menu.
  3. Select your library project on the left part of the dialog.
  4. In the "C/C++" tab, select "General" in the "Category:" drop down menu.
  5. In the "Preprocessor definitions:" entry box, enter the following at the end of all other entries:
    ,EXPORT_DLL="__declspec(dllimport)"
    if linking your libraries against this SDK built dynamically, or
    ,EXPORT_DLL=""
    if linking your libraries against this SDK built statically.
  6. Click "OK" and build your project using "Build->Rebuild All".

To run your application, follow the same steps as described in Testing the Build.

Return to: Top


Problems with the Build

Why am I having errors using "make" in Unix?

Check that you are using the proper "make". See Build Requirements.

How do I get the release back to its pristine start condition?

Run the "make distclean" command ("Build->Clean" in Win32) to remove the created subdirectories, as well as their contents.

In Win32, I compiled "dynamic" and now I am trying to build "static" but I am getting some errors. What's wrong?

Make sure you use the "Build->Rebuild All" command from the VC++ menu so that the older compilation files are rebuilt.

In Win32, I am linking my own libraries or static application against the SDK and I get "unresolved references" errors. What's wrong?

You may need to set some of the preprocessor definitions as explained in Using the Libraries.

I can't compile the Model Viewer because of an error saying something about "GLUT".

The Model Viewer requires the GLUT headers and libraries to be installed in your system. See the Build Requirements section for more information.

Return to: Top


Recommended Reading

Return to: Top


Bug Reports and Feedback

For help, comments, and bug reports please send email to help@sedris.org. If you are an associate, please use se-coders@sedris.org.

Return to: Top


Web Pages

These links require Internet access.

Return to: Top


Copyright © 2011 SEDRIS