GraspIt! Installation - Windows with MSys / MinGW

Step 1. Install MinGW, MSYS, Qt and CMake

  1. Download the `MinGW toolchain`_ (from the MinGW-w64 project) which is already set up for Qt and extract it, e.g. to C:/MinGW. See also the `MinGW Qt wiki`_ page.
  2. Download Qt 4 and run the installer (default destination is C:/Qt). We recommend to use Qt4 download from qt.io.
During installation, you have to locate the MinGW files previously extracted. See also this useful resource: Installing Qt for windows.
  1. Add the MinGW bin directory to your PATH in Windows.

  2. Download and install CMake for Windows.

  3. Install MSYS2
    • Download MSYS2 [from here](https://msys2.github.io/) and execute the installer.
    • Open a MSYS shell and add the MinGW bin directory to PATH, eg. echo "export PATH=${PATH}:<path-to-minGW-bin>" >> .bashrc
    • (optional): Install vim for MSYS shell with pacman -S vim

General notes for compiling with cmake

CMake and MSYS do not get along that well. When you use cmake from within the MSYS command line, it will complain about sh.exe being in your PATH. So in general, the best is to use the cmake graphical interface for Windows to generate the makefiles, and then use the MSYS shell to compile.

If you explicitly want to try and run cmake from within a MSYS shell, you should set it to generate MinGW makefiles: `` cd build cmake -G “MinGW Makefiles” .. ``

Note about the error with sh.exe

This error will go away after re-running cmake. Be careful though, because this may lead to the wrong compilers being chosen, ie. using the MSYS gcc/g++ instead of the MinGW ones. You could try to explicitly set them with CMAKE_CXX_COMPILER and CMAKE_C_COMPILER. In this guide however, only instructions for using the Windows CMake GUI are given.

Compiling

For convenience, you may want to create a softlink to ming32-make.exe and call it make.exe. Alternatively, just run the mingw make explicitly:

mingw32-make

Step 2. Install basic dependencies

  1. lapack/blas: Install from source. See also LAPACK for Windows.

    You can use the original LAPACK source.

  2. qhull: Compile from source cloning the qhull repository, and install.

Alternatively, try pacman to install the libraries. pacman -Ss lapack will list the specific name of the package. Then install with pacman -S <name>

For qhull you may try the same: find out package name with pacman -Ss qhull and install with -S

Step 3. Install Coin and SoQt

A good set of instructions can be found on this github wiki: SoQT for Windows. Please refer to the instructions given there for installation.

Binaries for Coin and SoQt exist as well. However they are not the most recent version any more.

A few notes about the installation:

Coin - Use the extra configure flag --build=x86_64-w64-mingw32, or if you are not on x86_64, get the output of gcc -dumpmachine.

Careful though not to use the MSYS build (it has to be the MinGW build).
  • As of May 2016, the source code had to be edited as suggested in the instructions linked above, except the change in freetype.cpp which was not necessary.
  • You also may need to install diffutils: pacman -S diffutils.
  • Add the bin directory of the resulting Coin install to your PATH environment variable.

SoQt - The environment variable QTDIR has to be set to the directory where all the Qt includes can be found.

Step 4 [optional]. Install bullet

If you want to use bullet as physics engine in GraspIt!, you need to install it. This is very straight forward with cmake. Clone the bullet repository and build with cmake.

Step 5. Compile GraspIt!

For compiling with CMake, the path to the MSYS bash.exe needs to be passed to cmake. This is required for cmake to be able to call soqt-config (which is not provided as Windows .exe file and needs to be run via bash). So you will need to pass the path to bash.exe (probably this is <your-msys-install>/usr/bin) with the CMAKE_PREFIX_PATH.

Use the CMake GUI to generate the make files, as running cmake from the MSYS shell may be problematic (see also building with cmake explained in Step 1).

  1. Start CMake GUI.

  2. Select source and build directory, then click “Configure”.

  3. Select “MinGW Makefiles”, and you may first try to stick to the default compilers.

    If it does not compile, or the default compilers causes other issues, try to re-run cmake and this time select “Specify native compilers”, choosing the fortran.exe/gcc.exe/g++.exe from your MinGW install (not MSYS).

  4. The first configuration process may be unsuccessful because not all directories are included.

    Either way, you still need to add the following to your CMAKE_PREFIX_PATH: - the path to bash.exe - the path to the Qt files (QTDIR), and - any other dependency directories. You can add the paths by clicking on “New Entry” and add a variable named CMAKE_PREFIX_PATH, in which you add all paths, separated by semicolons.

  5. Click “Configure” again. It should be printing something like “Result of soqt_config: ...” followed by a list of libraries.

    If it does not print the libraries, it did not find bash.exe, and the makefiles have not been generated properly!!

  6. After configuration was successful, click on “Generate”.

After the cmake files were generated in the GUI, go to the MSYS shell, change to the build directory, and type

mingw32-make

That’s all, you should be ready to go, try the graspit_simulator.exe in your build directory!