OOPSMP: Installation

Installation

  • Follow the installation instructions for OS X, Linux, or MS Windows.
  • Instructions on how to run OOPSMP programs are found here
  • You can get started by running some of the demo programs
  • [optional] Download and install Doxygen if you want to regenerate the documentation in doc. After you re-run cmake, doxygen will be detected and you can type "make doc".

Installation on OS X

The following instructions are known to work on OS X 10.4 and OS X 10.5:
  1. Install gcc. The easiest way is to download the Apple Developer Tools from http://connect.apple.com (free, but requires registration). You can also install gcc through a package manager such as MacPorts or Fink.
  2. Install CMake. This program is used to automatically generate makefiles and project files for different operating systems and compilers. The CMake web site has binaries, but you can also install it through your package manager (MacPorts, Fink, etc.).
  3. Download and extract OOPSMP
  4. Download and extract PQP and Triangulate. Beware that the Triangulate tar ball doesn't extract the files in a separate directory if you use "tar". The OS X Finder (and perhaps other programs) extract the tar ball into a directory called "triangulation." Add "#include <string.h>" to triangulate.h to solve some compilation warnings. Move the PQP_v1.3 and triangulation directories to OOPSMP/src.
  5. [optional] Install Google sparsehash, STL-like hash sets and hash maps.
  6. [optional] Install Google SketchUp. OOPSMP contains a plugin for SketchUp that allows you to run OOPSMP completely within SketchUp. You can also use SketchUp to export motion planning problems (in case you want to run OOPSMP from the command line or on a different machine). The SketchUp plugin page has more information. Installing SketchUp is highly recommended for novice users.
  7. Compile and install OOPSMP
    1. In the OOPSMP directory, run setup.sh. If all goes well, cmake will detect where your dependencies are installed and generate Makefiles in the directories build/Debug and build/Release.
    2. Go to the build/Release directory and type "make".
    3. By default OOPSMP installs in /usr/local. This requires administrator access. To change the installation prefix, type "cmake -DCMAKE_INSTALL_PREFIX=/my/prefix ." (notice the period), where "/my/prefix" is the desired destination.
    4. Type "sudo make install" (or "make install" if you changed the installation prefix to one of your own directories). The oopsmp binary is installed in $prefix/bin, the libraries in $prefix/lib/OOPSMP, the header files in $prefix/include/OOPSMP, and the sample XML files in $prefix/share/OOPSMP/xml.

Installation on Linux

The instructions below are known to work on recent versions of Ubuntu Linux, and Red Hat Enterprise Linux. OOPSMP is also known to compile with the PGI Compilers (in fact, the CMake files explicitly check for the presence of PGI C++ compiler).
  1. Install g++ through your package manager.
  2. Install CMake. This program is used to automatically generate makefiles and project files for different operating systems and compilers. The CMake web site has binaries, but you can also install it through your package manager.
  3. Install OpenGL & GLUT. Your package manager may have hardware-accelerated versions of OpenGL for your video card. If not, install the Mesa libraries and header files. Both the glut and freeglut packages should satisfy the GLUT dependency.
  4. Download and extract OOPSMP
  5. Download and extract PQP and Triangulate. Beware that the Triangulate tar ball doesn't extract the files in a separate directory if you use "tar", so create a directory called "triangulation" first and extract the tar ball there. Add "#include <string.h>" to triangulate.h to solve some compilation warnings. Move the PQP_v1.3 and triangulation directories to OOPSMP/src.
  6. [optional] Install Google sparsehash, STL-like hash sets and hash maps.
  7. Compile and install OOPSMP
    1. In the OOPSMP directory, run setup.sh. If all goes well, cmake will detect where your dependencies are installed and generate Makefiles in the directories build/Debug and build/Release.
    2. Go to the build/Release directory and type "make".
    3. By default OOPSMP installs in /usr/local. This requires root access. To change the installation prefix, type "cmake -DCMAKE_INSTALL_PREFIX=/my/prefix ." (notice the period), where "/my/prefix" is the desired destination.
    4. Type "sudo make install" (or "make install" if you changed the installation prefix to one of your own directories). The oopsmp binary is installed in $prefix/bin, the libraries in $prefix/lib/OOPSMP, the header files in $prefix/include/OOPSMP, and the sample XML files in $prefix/share/OOPSMP/xml.

Installation on Windows

The instructions below are known to work for Windows XP. There are still a few issues in getting OOPSMP to compile on Windows Vista. We are still working on this, but we appreciate any diagnostic information from Vista users. We hope to release a Windos Vista fix in version 1.1.1.
  1. Install a compiler such as MinGW or Microsoft Visual C++ Express Edition
  2. Install CMake. This program is used to automatically generate makefiles and project files for different operating systems and compilers.
  3. Install GLUT.
    • For MinGW, download a pre-compiled version can be found here. Copy glut.h in C:/MinGW/include/GL. Remove libglut.a and libglut32.a from C:/MinGW/lib. Copy libglut32win.a to C:/MinGW/lib and rename it to libglut32.a. Finally, copy glut32.dll to C:/Windows/System32.
    • For Microsoft Visual Studio, a pre-compiled version can be found here. Put glut32.dll inside C:/Windows/system32, put glut.h inside C:/Program Files/Microsoft SDKs/Windows/ "latest version"/Include/GL, and put glut32.lib inside C:/Program Files/Microsoft SDKs/Windows/ "latest version"/Lib
  4. Download and extract OOPSMP
  5. Download and extract PQP and Triangulate. Beware that the Triangulate tar ball doesn't extract the files in a separate directory if you use "tar", so create a directory called "triangulation" first and extract the tar ball there. Patch PQP and Triangulate following the instructions below. Move the PQP_v1.3 and triangulation directories to OOPSMP/src.
  6. [optional] Install Google sparsehash, STL-like hash sets and hash maps.
  7. [optional] Install Google SketchUp. OOPSMP contains a plugin for SketchUp that allows you to run OOPSMP completely within SketchUp. You can also use SketchUp to export motion planning problems (in case you want to run OOPSMP from the command line or on a different machine). The SketchUp plugin page has more information. Installing SketchUp is highly recommended for novice users.
  8. Compile and install OOPSMP
    1. Start the CMake program and set the source directory to be the top-level OOPSMP directory. The build directory can be anywhere, but a subdirectory "build" would a good choice (CMake will create it, if necessary). CMake can generate Visual Studio project files and MinGW-type Makefiles. You can also run 'cmake -G "MinGW Makefiles" ' (in case you are using MinGW) in the OOPSMP directory from cmd.exe.
    2. Go to the build directory and type "make" if you're using MinGW or open the Visual Studio project file.
    3. By default OOPSMP installs in "C:/Program Files/OOPSMP". This may require administrator access. To change the installation prefix, either use the CMake GUI or type "cmake -DCMAKE_INSTALL_PREFIX=/my/prefix ." (notice the period), where "/my/prefix" is the desired destination.
    4. Make the INSTALL target. The oopsmp.exe binary is installed in $prefix/bin, the libraries in $prefix/lib/OOPSMP, the header files in $prefix/include/OOPSMP, and the sample XML files in $prefix/share/OOPSMP/xml.
    5. Add the location of OOPSMP libraries to the PATH variable. This variable can be found in Control Panel -> Performance and Maintenance -> System -> Advanced -> Environmental Variables.
    6. f you are using MinGW and MingGW complains that it cannot create/find certain files, then move OOPSMP to some other place with a shorter absolute path, i.e., C:/OOPSMP

Patch PQP on MS Windows

Microsoft Visual Studio generates certain errors when compiling PQP source files.
  • Comment out from PQP_compile.h the following lines (lines 47–50)
    inline float sqrt(float x) { return (float)sqrt((double)x); }
    inline float cos(float x) { return (float)cos((double)x); }
    inline float sin(float x) { return (float)sin((double)x); }
    inline float fabs(float x) { return (float)fabs((double)x); }   
    
  • To ensure that PQP links correctly with OOPSMP, certain classes and functions must be exported. Add the directive __declspec(dllexport) in the file PQP.h to the declaration of PQP_Collide (line 207), PQP_Distance (line 268), and PQP_Tolerance (line 325) as illustrated below:
    __declspec(dllexport) PQP_Collide(PQP_CollideResult *result,
    __declspec(dllexport) PQP_Distance(PQP_DistanceResult *result, 
    __declspec(dllexport) PQP_Tolerance(PQP_ToleranceResult *res, 
    
    Do the same in the file PQP_Internal.h in the declaration of PQP_Model (line 44), CollisionPair (line 76), and PQP_CollideResult (line 82) as illustrated below:
    class __declspec(dllexport) PQP_Model
    struct _declspec(dllexport) CollisionPair
    struct _declspec(dllexport) PQP_CollideResult  
    

Patch Triangulate on MS Windows

Microsoft Visual Studio also generates certain errors when compiling Triangulate source files.
  • In tri.c comment out #include <sys/time.h>.
  • In misc.c:
    1. replace #include <sys/time.h> by #include <time.h>
    2. inside the function generate_random_ordering comment out
      struct timeval tval;
      struct timezone tzone;
      gettimeofday(&tval, &tzone);
      srand48(tval.tv_sec);
      
      and add instead
      srand((unsigned) time(NULL));
      
    3. inside the for loop of the function generate_random_ordering replace lrand48 with rand
    4. comment out everything in
      #ifdef __STDC__
      extern double log2(double);
      #else
      extern double log2();
      #endif
      
      and add instead
      double log2(const double a)
      {
       return log(a)/log(2.0);
      }
      
  • To ensure that Triangulate links correctly with OOPSMP, certain functions must be exported. Add the directive __declspec(dllexport) to the declaration of triangulate_polygon in file tri.c, line 72, as illustrated below:
    int __declspec(dllexport) triangulate_polygon(ncontours, cntr, vertices, triangles)