Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
OpenWalnut Core
OpenWalnut Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • OpenWalnut
  • OpenWalnut CoreOpenWalnut Core
  • Wiki
  • InstallMSYS2

InstallMSYS2

Last edited by Jonas Bürger (HS Worms) Mar 05, 2020
Page history

Compile and Install OpenWalnut with MSYS2

MSYS2 Setup

MSYS is a very well known Cygwin derived Posix-like environment for Windows. MSYS2 is a great successor to MSYS. It allows 64Bit builds and integrates a package manager which makes the setup of software and libraries easy.

  • Before you start, please ensure that no other MSYS or Cygwin install interfere with us. Usually, this only happens when you modify your Windows Environment Variables, especially "PATH". Keep this in mind.
  • Go to http://sourceforge.net/projects/msys2
  • Download MSYS2 (its a 64Bit environment)
  • Install. We chose c:\ow_workspace\msys2 here. If you are using another path, adapt the following instructions accordingly.
  • The Setup should now start your shell.
  • Follow the update instructions on the MSYS2 site: https://github.com/msys2/msys2/wiki/MSYS2-installation
  • In general, it is a standard shell you will find on many Linux and Unix systems out there. It might look old-school but the reason that this kind of interaction still exists is that it is proven to be effective if used accordingly.
  • MSYS2 provides a package management system to the user.
  • First, update package database and your setup:
    • $ pacman -Syu
  • Exit the shell: $ exit
  • Start fresh instance from Start menu.

Configure Build Environment

  • Devel:
    • $ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules make pkg-config grep sed gzip tar git openssh mingw64/mingw-w64-x86_64-python2
  • Dependencies:
    • $ pacman -S mingw-w64-x86_64-qt5 mingw-w64-x86_64-qtwebkit mingw-w64-x86_64-OpenSceneGraph mingw-w64-x86_64-boost mingw-w64-x86_64-eigen3
  • Important: to use packages that are pre-fixed with "mingw" in their name, you need to start a mingw shell. In your Start menu, you will find entries "MinGW-w64 Win64 Shell". ALWAYS start this shell in the future.

Build Dependencies

  • Build Nifti:
    • Download Nifticlib (the C library):
      • Got to http://sourceforge.net/projects/niftilib/files/nifticlib/
      • Choose the latest release
      • Download and place the archive to c:\ow_workspace
    • $ cd /c/ow_workspace
    • Extract archive: $ tar xzf nifticlib-2.0.0.tar.gz
    • $ cd nifticlib-2.0.0/
    • The next step is to configure the NiftiLib code. This is done via cmake. It is important to choose "Unix Makefiles" as generator here, as we are working in a Unix-a-like environment. We also instruct cmake to build a release binaries. If you plan to develop with OpenWalnut, this is a good point to get used to cmake, as we use this very powerful tool too.
    • The following command is a bit tricky, but ensures all the files we need later are installed in the right places.
    • $ cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX=/c/ow_workspace/nifticlib-2.0.0/build .
      • (NOTE: error? Command not found? -> Did you start the "MinGW-w64 Win64 Shell" from the Start menu?)
    • cmake now created the script files to build the code (the "Makefile"). To actually execute the make-process:
    • $ make
    • $ make install
    • That's it. Nifti has been built.
  • Build libLAS [optional]:
    • Download libLAS
      • Go to http://www.liblas.org/download.html
      • Choose the latest source release (not the binaries)
      • Download and place the archive to c:\ow_workspace
    • $ cd /c/ow_workspace
    • Extract archive: $ tar xjf libLAS-1.8.1.tar.bz2
    • $ cd libLAS-1.8.1
    • WARNING: the next step involve some manual work. Unfortunately, libLAS works only with OSGeo4W, which is not working with MSYS2. Their CMake build setup does not allow disabling it.
    • Open the CMakeLists.txt file with your favorite text editor.
      • At the end of the file, you will find a line include(BuildOSGeo4W). Remove it.
      • Save and close.
    • $ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/c/ow_workspace/libLAS-1.8.0/build -DWITH_TESTS=false -DWITH_GDAL=false -DGDAL_LIBRARY="" -DGDAL_INCLUDE_DIR="" .
      • Note: Although WITH_GDAL is set to false, the CMake script fails when not finding GDAL_LIBRARY. Hence, we set it explicitly.
    • $ make
    • $ make install

Build OpenWalnut

  • Get the code. Use the mercurial version control system or download an archive from openwalnut.org. When downloading an archive, extract like described above. When using mercurial to access the source repository:
    • $ cd /c/ow_workspace
    • $ git clone http://source.openwalnut.org OpenWalnut
    • $ cd OpenWalnut
    • This loads the development code. To change to a release, query available releases and development branches first:
      • $ git tag
    • Switch to the desired tag:
      • $ git checkout TAGNAME
      • Mostly, you will type something like $ git checkout Release_latest
    • Keep in mind: this is written against OpenWalnut 1.4.0rc2. We cannot guarantee older versions work.
  • Let us build OpenWalnut
    • $ cd /c/ow_workspace/OpenWalnut/build
    • First, we need to tell cmake, where to find our self-made nifti library:
    • $ export NIFTILIB_INCLUDE_DIR=/c/ow_workspace/nifticlib-2.0.0/build/include
    • $ export NIFTILIB_LIBRARY_DIR=/c/ow_workspace/nifticlib-2.0.0/build/bin
    • Optional - the following need to be done if you installed the optional libraries above.
      • $ export LIBLAS_INCLUDE_DIR=/c/ow_workspace/libLAS-1.8.1/build/include/
      • $ export LIBLAS_LIBRARY_DIR=/c/ow_workspace/libLAS-1.8.1/build
    • This sets environment variables that can be used by cmake to find nifti:
    • $ cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/c/ow_workspace/OpenWalnut_Packaged ../src
    • Optional: use $ cmake-gui -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/c/ow_workspace/OpenWalnut_Packaged ../src for a graphical representation of all settings and found libraries.
    • CMake should have found everything. We can now build:
    • $ make
      • Speed up build? Yes. If you have a multi-core CPU, you can tell the make program to do multiple jobs in parallel: $ make -jN, where N is the number of parallel jobs.
    • Getting errors during build? You can always check the FIX options we provide. Use cmake-gui and have a look at the options named "OW_FIX_....". Sometimes, we have issues building features on Windows. A typical example is the winnt.h error when building the LibEEP Reader.
      • Turn off LibEEP by issuing $ cmake -DOW_FIX_EEP_WINDOWS_ERROR=ON ../src
      • Run $ make again.

Run OpenWalnut

Now, you have built OpenWalnut. Before you can run it, you have to do something once. We have build Nifti and LibLAS previously. To allow OpenWalnut finding them, you have to copy the DLL files to your build/bin/ directory.

  • DO ONCE:
    • $ cd /c/ow_workspace/OpenWalnut/build
    • $ cp /c/ow_workspace/nifticlib-2.0.0/build/bin/*.dll bin
    • $ cp /c/ow_workspace/libLAS-1.8.0/build/libliblas* bin/
  • You have built OpenWalnut. Time to run.
  • As long as you work in MSYS2, just switch to your build directory and run Openwalnut:
    • $ cd /c/ow_workspace/OpenWalnut/build
    • $ bin/openwalnut-qt

Deploy Windows Package

  • For users, we strictly recommend to stop reading here. Installing OpenWalnut to some location outside the MSYS2 root directory involves some work, since the needed libraries (Qt, OpenSceneGraph and so on) need to be deployed to the target directory too.
  • We prepared a deployment script to cope with DLLs properly. But it will work only if you exactly followed the above tutorial.
  • Go to the BUILD directory
    • $ cd /c/ow_workspace/OpenWalnut/build
  • Copy the deployment script
    • $ cp ../tools/release/packaging/windows/deploy.sh .
  • Let the script do the magic
    • $ ./deploy.sh
  • If there is an error, please report this to the mailing list
  • After running the script, you can compress and distribute the install directory (/c/ow_workspace/OpenWalnut_Packaged in our case)
  • IMPORTANT: you NEED to run OpenWalnut via the "bat" file in the directory.
Clone repository
  • DeveloperTools
  • DiffusionIndices
  • Documentation
  • Downloads
  • EditorConfiguration
  • FAQ
  • FiberSimilarityMetrics
  • FirstSteps
  • Getting_OpenWalnut
  • Glossary
  • HowtoDocumentCode
  • IllustrativeConnectivityVisualization
  • InstallMSYS2
  • InstallMinGW
  • InstallVisualStudio
View All Pages