ug4
How to build UG for VRL for Windows

These pages give instructions and help in setting up and compiling ug4 for VRL. simple and special usage as well for development.

Note
This page is at the moment a copy of some private notes that were made during the try to build ug4 for VRL at a windows pc.
there may are some bugs in displaying some path like
  • C: instead of
  • C: \ Path \ to \ somewhere (without whitespaces)
  • if you have already downloaded ug4 you can find this page under
    docs/ug4/additional_pages/setup/ug_vrl/compilingForVRL.doxygen
    at the end of the file are the german original notes
An instruction for compiling ug4 for VRL under mac os x, linux x86 and x64 can be found at Build UG for VRL for Linux and Mac with a script.
Todo:
Make this instructions more readable / structured

BUILDING NATIV ug4 UNDER WINDOWS 7
Effective 2012-06-27

Preparations

Installing Java (JDK) and NetBeans:

To build VRL it is necessary to install JDK >= 6.0 and NetBeans >= 7.4. For further instructions on how to compile VRL see https://github.com/VRL-Studio/VRL

You need the following programs:

  • git or svn
  • MSYS
  • Mingw64
  • Cmake
  • Boost
  • DependencyWalker
  • ug4 (from repository: fuji.gcsc.uni-frankfurt.de/ug4/trunk)

Installation hints:

  • 1.) ug4
    • create a folder ug
    • open a terminal (cmd)
      • in the terminal go into the new created folder ug
    • if svn in folder ug: (creates a folder release) (stabil version)
      svn co svn://fuji.gcsc.uni-frankfurt.de/ug4/tags/releases
    • if git in folder ug: (creates a folder trunk) (current developer version) (only example , check correct command) (replace USER through your own username)
      git svn clone USER@fuji.gcsc.uni-frankfurt.de/ug4/trunk
      static vector2 trunk(const vector2 &v, number smallestVal)
      Definition: file_io_tikz.cpp:59
    • create in the folder ( ug or releases) 2 new folders.
      builds64 for the 64-bit-compilation builds32 for the 32-bit-compilation
  • 2.) MSYS-Mingw (32bit) / Mingw64 (as far as remembered)
    • install first the 32bit version of MSYS - MinGW -Bundle into C:/MinGW
    • install MinGW64 into C:/MinGW64
    • copy mingw32-make into folder C:/MinGW64/bin and rename it into make

Building ug4 for windows

APPROACH: BUILDING NATIV ug4 UNDER WINDOWS 7 64bit
(for 32bit = x86 and 64bit = x64) &&& APPROACH: CREATING VRL-UG.jar
Effective 2012-06-27 , VRL=0.4.1

update ug4

  • open git-bash
  • cd /C/Apps/ug/trunk
    the ug namespace
  • git svn rebase

configure ug4

configure ug4 32bit

  • changing into folder with the cmake config files
    cd ../builds32/

  • shows current configuration
    cmake
    Definition: unit_tests.doxygen:198

  • generate makefile
    cmake ../trunk/ -G"MinGW Makefiles" -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--kill-at -DTARGET=vrl -DDEBUG=OFF -DLAPACK=OFF -DBLAS=OFF -DINTERNAL_BOOST=OFF -DEMBEDDED_PLUGINS=ON -Dd3f=OFF -DEMBED_SVN_REV=OFF -DReceptorKinetic=ON -DLinearElastoPlasticity=OFF

configure ug4 64bit

  • changing into folder with the cmake config files
    cd ../builds64/
  • shows current configuration
  • generate makefile
    cmake ../trunk/ -G"MSYS Makefiles" -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--kill-at -DTARGET=vrl -DDEBUG=OFF -DLAPACK=OFF -DBLAS=OFF -DINTERNAL_BOOST=OFF -DEMBEDDED_PLUGINS=ON -Dd3f=OFF -DEMBED_SVN_REV=OFF -DReceptorKinetic=ON -DLinearElastoPlasticity=OFF

compile ug4

compile ug4 32bit

  • set environment variable MINGW to
    C:\MinGW
  • change temporal the environment variable MSYS that way that sh.exe is NO LONGER in the PATH
    e.g: add "-pp" at the back. The result is that there is no real path to sh.exe
  • open a new terminal (cmd)
    • cd\
    • cd Apps/ug/builds32/
      ( resp. e.g.
      cd ../../Apps/ug-svn/releases/build-4-0-2--32
      )
    • mingw32-make

compile ug4 64bit

  • set the environment variable MINGW to
    C:\mingw64
  • change the environment variable MSYS that way that sh.exe is in PATH (e.g: delete "-pp")
  • open new terminal (cmd)
    • cd\
    • cd Apps/ug/builds64/
    • make

zip ug4

  • create a folder windows
  • create in windows 2 folders x64 and x86

zip ug 32bit

  • copy the content (libug.dll and folder plugins) from ug/trunk/bin to windows/x86
  • open in the programm DependencyWalker the file libug.dll from windows/x86
  • copy all additional needed .dll files (which were shown by DependencyWalker) into windows/x86
  • zip the content (not the folder) of windows/x86 including the plugins folders to natives.zip in the folder windows/x86
  • make a copy of the folder windows e.g. with the name windows-libs
  • delete all inside of windows/x86 except natives.zip

zip ug 64bit

  • copy the content (libug.dll and folder plugins) from ug/trunk/bin to windows/x64
  • open in the programm DependencyWalker the file libug.dll from windows/x64
  • copy all additional needed .dll files (which were shown by DependencyWalker) into windows/x64
  • zip the content (not the folder) of windows/x64 including the plugins folders to natives.zip in the folder windows/x64
  • make a copy of the folder windows e.g. with the name windows-libs
  • delete all inside of windows/x64 except natives.zip

Building VRL-UG

Building VRL-UG for windows

  • copy the folder windows into VRL-UG-JAVA-PROJECT into the folder
    VRL-UG/src/eu/mihosoft/vrl/plugin/content/natives


Building VRL-UG for other OS

  • ... (repeat the above steps, modified for other OS)

Compiling VRL-UG

  • open VRL-UG-JAVA-PROJECT with an IDE (like Netbeans or Eclipse)
  • compile the project (e.g. via Clean & Build)
  • the generated file VRL-UG.jar can be found under VRL-UG/dist

Creating VRL-Studio-Bundle for windows

APPROACH: CREATING A WINDOWS VRL-STUDIO-BUNDLE for 32bit = x86 and 64bit = x64 Effective 2012-06-27 , VRL=0.4.1

Create VRL-Studio

  • open VRL-UG-JAVA-PROJECT with an IDE (like Netbeans or Eclipse)
  • compile the project (e.g. via Clean & Build)
  • the final file "VRL-UG.jar" for windows can be found under "VRL-Studio/dist-final/windows"
  • copy the content of "VRL-Studio/dist-final/windows" (folder VRL-Studio) in a folder e.g. "Documents/stable-versions/EVENT/windows"
    • whereby EVENT should be replaced via e.g. "2012-06-27" or an other distinctive identifier

Coping Java (JRE) into the bundle

  • download from the java site the current JRE version for 32bit (i586) and for 64bit (x64)
    • (notice: currentlly we use JRE 7)
  • install the JRE temporally into a folder e.g. "C:/temp/jre/xYY" whereby YY = 86 or 64 depending the JRE version
  • copy the folder "jre" into "Documents/stable-versions/EVENT/windows/VRL-Studio/.application"
    • whereby EVENT should be replaced via e.g. "2012-06-27" or an other distinctive identifier

Supply plugins

  • create a folder "plugin-updates" under
    VRL-Studio/.application/resources/studio-resources/property-folder-template
  • copy all supplied plugins in the new created folder "plugin-updates"

HELP-HTML-SITES for VRL-Studio (additional informations to check)

  • if help sites should be added there need to be folder named "help" under
    VRL-Studio/.application/resources/studio-resources/
    where the help sites need to be copied into

Zip VRL-Studio

  • zip the VRL-Studio folder under "Documents/stable-versions/EVENT/windows"
  • rename the zip file into "VRL-Studio-windows.zip" to prevent confuisions with other studio bundles for mac and linux

How to share and execute the VRL-Studio-Bundle

  • copy / download the zip file "VRL-Studio-windows.zip" to (almost) any place at your computer e.g. a download folder
  • unzip the file "VRL-Studio-windows.zip" (and don't open it only !)
  • open the extracted folder and start run.bat (via double clicking on it or calling it from a terminal)

Older and other informations / hints / tips

to create a deliverable version of vrl studio, use the following instruction:

update

  • checkout from the repositories the stable versions / tags of
    • the plugins
    • vrl
    • vrl studio
  • build the files "project".jar
    • Remarks
      normally you can find the jars under "project-folder"/dist or "project-folder"/dist-final

VRL-UG

Warning
vrl-ug has native dependencies. This is why need to compile native ug4 at each OS (operating system) and OS-bit version we want to support. For the moment these are:
  • mac os x
  • linux x64 + x86
  • windows x64 + x86

VRL-UG for windows

Approach:

  • a) add a jre7-32bit for x86 and a jre7-64bit for x64 into the vrl-studio.
    • these folders can be find as templates under
      • C:\Apps\VRL-Studio\VRL-Studio\resources\application-template\windows\VRL-Studio.application
    • and are build under

      • C:\Apps\VRL-Studio\VRL-Studio\dist-final\windows\VRL-Studio.application
      Remarks
      • corresponding to that the starting script need to point at these java version
      • instead of the java version that may be installed on that OS
        • instead of "java" (System Java Version) there need to be "jre/xYY/bin/java" written
  • b) the complied version of native ug4 need to be examined with the programm dependencywalker
    • copy the needed .dll files into the corresponding folder
      "path/to/repo"\VRL-UG4\VRL-UG\src\eu\mihosoft\vrl\natives\windows"bitVERSION"

      EXAMPLE I) 32bit:

      • needed .dll files:
        libgcc_s_dw2-1.dll libstdc++6.dll
      • can be found under:
        C:\MinGW\bin
      • copy into:
        C:\Apps\VRL-UG4\VRL-UG\src\eu\mihosoft\vrl\natives\windows\x86

      EXAMPLE II) 64bit:

      • needed .dll files:
        "NONE"
      • can be found under:
        ""
      • copy into:
        C:\Apps\VRL-UG4\VRL-UG\src\eu\mihosoft\vrl\natives\windows\x64
  • c) after that copy libug4.dll and the foder plugins
  • EXAMPLE 64bit:
    • from:
      C:\Apps\ug\releases\bin64-backup
    • to:
      C:\Apps\VRL-UG4\VRL-UG\src\eu\mihosoft\vrl\natives\windows\x64

VRL-UG-API <br>

Can be created on any OS with a stable versions of VRL-UG and VRL-Studio. After installing VRL-UG as plugin in VRL-Studio restart the studio and the VRL-UG-API will be automatically generated.

VRL-USERDATA

The plugin VRL-USERDATA needs for compiling (in an IDE) the stable versions of VRL-UG and VRL-UG-API.

Structuring the plugins

After creating the "plugin".jar files they need to be copied into:

  • "OS"/plugin-updates
  • example: linux/plugin-updates

Coping plugin-updates into VRL-Studio

copy the folder "OS"/plugin-updates into:

"pfad/zum/repo"/VRL-Studio/VRL-Studio/dist-final/"OS"/VRL-Studio/.application/resources/studio-resources/property-folder-template

Example:

/Users/christianpoliwoda/Apps/VRL-Studio/VRL-Studio/dist-final/linux/VRL-Studio/.application/resources/studio-resources/property-folder-template
Warning
MAC
"path/to/repo"/VRL-Studio/VRL-Studio/dist-final/osx/
  • in folder osx right click VRL-Studio and choose in the context / popup menu "show package content"
  • navigate to:

    /Contents/Resources/Java/resources/studio-resources/property-folder-template

    Example on MAC: complete path

    /Users/christianpoliwoda/Apps/VRL-Studio/VRL-Studio/dist-final/osx/VRL-Studio.app/Contents/Resources/Java/resources/studio-resources/property-folder-template

Zip VRL-Studio

  • create for each OS a zip file under:
    "pfad/zum/repo"/VRL-Studio/VRL-Studio/dist-final/"OS"/
  • rename the zip files into:
    VRL-Studio-"OS".zip

Example:

/Users/christianpoliwoda/Apps/VRL-Studio/VRL-Studio/dist-final/linux/VRL-Studio-linux.zip

notice

folder stucture:

  • ug/builds
  • ug/builds32
  • ug/releases
  • ug/trunk

in builds:

cmake ../trunk/ -G"MinGW Makefiles" -DTARGET=vrl -DLAPACK=OFF -DBLAS=OFF -DINTERNAL_BOOST=OFF -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--kill-at

this command sets (my) needed compiling options. -DCMAKE_SHARED_LINKER_FLAGS=-Wl,–kill-at removes all @("at") signs which where added at native methods of ug4.

the following programms need to be

\notice java needs to be entered before the windows system variables in the path variable. otherwise you get a message JNI couldn't be found.

to start the compilation:

mingw32-make

notice

in VRL-UG4/VRL-UG/src/eu/mihosoft/vrl/natives /windows/x64 and or /windows/x68 additional libs should be added in above named folders.

which libs these are you can find out with the programm dependencywalker, http://www.dependencywalker.com/ if you open libug4.dll in it.

e.g. you find libgcc_s_dw2-1.dll and libstdc++-6.dll under MinGW/bin

if you want to deliver the vrl-studio with your version of java jre you need to copy your jre7 folder of your java installation into:

\VRL-Studio\VRL-Studio\resources\application-template\windows\VRL-Studio\.application

after that you need to change the starting scripts (run.bat and run-no3d.bat) in:

\VRL-Studio\VRL-Studio\resources\application-template\windows\VRL-Studio

from:

start /realtime java ......(additional entries)

to:

start /realtime jre7/bin/java ......(additional entries)

notice

cmake ../trunk -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--kill-at

to solve a problem that can occur at starting vrl-studio with vrl-ug plugin on windows 32bit. you need to use above command for native ug (c++)

notice

alternative makefile under windos with internal boost if directly checkout with svn

cmake ../ug4.0.0/ -G"MSYS Makefiles" -DLAPACK=OFF -DBLAS=OFF -DTARGET=vrl -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--kill-at

in folder ug: (creates a folder releases)

svn co svn://fuji.gcsc.uni-frankfurt.de/ug4/tags/releases