Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building a development environment for Windows [updated 04/15/16]
06-19-2014, 02:55 PM (This post was last modified: 08-13-2016 09:15 AM by micheus.)
Post: #1
Information Building a development environment for Windows [updated 04/15/16]
We need the git tools installed in order to prepare the wings3d's development environment and to pull requests to the main developers.
There is an all-in-one dev "pack" MSYS2 and I'm going to use it in this tutorial.

Before start
  • we are building a 64bits environment;
  • the MSYS2 and GNU Emacs will be installed under c:\wingsdev\ directory;
  • the sources codes we need will be put/unpacked under c:\wingsdev\src\ directory.

Let's start downloading and installing some programs/libraries...
  • First of all, if we still don't have a GitHub account, we will need to create one: link;
  • After we've created our account, fork the dgud/wings project, don't forget to Generating SSH Keys (help in case of any issue about it) - we do that in the MSys prompt. It's necessary if we want push changes to our remote repository (on gitHub) as well pull requests to the main project;
  • Download MSYS2 (the "x86_64") and run the installer - by default the installer uses the path C:\msys64, so we need to change it to C:\wingsdev\msys64. Follow all the instructions in the download page (seven steps) and after that we need to install the make and git packages. So, in the prompt run the follow commands:
    $ pacman -S make
    $ pacman -S git
    $ pacman -S mingw-w64-x86_64-gcc

    At the end exit the MSYS2 console window. You can start it at any time by running the msys2_shell.bat.
  • Download and install the Erlang (OTP xx.x Windows 64-bit Binary File).
    After installed it would be find under a folder like this C:\Program Files\erl7.3 (for OTP 18.0);
  • OpenCL - if the video card installed is a little old and doesn't have support to OpenCL then we'll need to install drivers based on CPU. For that you can check this thread: Making OpenCL features available.
    For video card with OpenCL support we can check these links in accord with its manufacturer: For both cases - after installed - have to look for the include and lib files and copy them respectively to C:\wingsdev\msys64\usr\include and C:\wingsdev\msys64\usr\lib
    for example, in NVidia we can find them under these folders:
    ..\NVIDIA GPU Computing SDK 3.2\OpenCL\common\inc\CL\*
    ..\NVIDIA GPU Computing SDK 3.2\OpenCL\common\lib\Win32\OpenCL.lib
  • Download GNU Emacs editor - it will be used by git to enable us to add comments/text to our commits;
  • vcredist - Microsoft Visual C++ 2013 Redistributable Package (x64) [optional*]
  • NSIS - Installer builder [optional*]
* These programs are necessary in case we intend to create an installer

Before continue, let's setup the MSYS2' environments variables, alias, etc...
To do that we open our favourite text editor and load the file current .bashrc we can find under C:\wingsdev\msys64\home\<user_name> folder. We append the commands to the end of the file and we'll set the paths in accord which we already establish before and it should looks like this:
###  Additions to support Wings3d development  ###
# --show-control-chars: help showing Korean or accented characters
alias ls='ls -F --color=auto --show-control-chars'
alias ll='ls -l'

## The changes for Wings3d development environment starts here

alias cds="cd /$ROOT_SRC/"
alias cdw="cd /$ROOT_SRC/wings"
alias cdws="cd /$ROOT_SRC/wings/src"
alias cdwp="cd /$ROOT_SRC/plugin_src"

## For start Wings3d from the shell during test/debug process
# Start and run wings
alias w1="werl +S1 -pa $ROOT_SRC/wings/ebin -run wings_start start -extra $WDIR"

export PAGER=less
export EDITOR=emacs

PATH="/f/Program Files/erl7.3/bin":$PATH
# PATH="/f/Program Files (x86)/NSIS":$PATH    ## remove the '#' if NSIS installed
export PATH=$PATH

export WINGS_SRC_PATH=/$ROOT_SRC/wings
# export WINGS_VCREDIST=/$ROOT/vcredist_x64.exe    ## remove the '#' if VCRedist_x64.exe is available
export OPENCL_DIR="/$ROOT/msys64/usr"

if [ -f /usr/share/git/completion/git-completion.bash ]; then
    . /usr/share/git/completion/git-completion.bash
    . /usr/share/git/completion/
    PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@ \[\e[33m\]\w\[\e[1;31m\]''`__git_ps1`''\[\e[0m\]\n\$ '

* These new parameters will be available after we restart the MSYS2 console.

Now, we'll start download the sources code we need and build them...
If there isn't a \src folder under C:\wingsdev it's time to create it - you can use the Windows Explorer for that.
  • Time to access the MSYS2 console - we must run the file mingw64_shell.bat and we should see something like this:
    Quote:micheus@ /C/wingsdev/src
    $ _
    if was all fine with our changes to .bashrc we should be into the src folder. Also, we can get into it by using the alias we defined: cds

    1. cloning and building rebar (needed to build cl module)
      $ cds
      $ git clone git:// rebar
      $ cd rebar
      $ ./bootstrap
    2. cloning and building cl
      $ cds
      $ git clone git://
      $ cd cl
      $ rebar compile
    3. cloning and building wings
      $ cds
      $ git clone git://
      $ cd wings
      $ make
* The git clone command will be used once (at the first time we "download" the sources codes)

We can notice that by get into the cloned folder - in the last case c:\wingsdev\src\wings - the console prompt have a new information: it's the branch name in use
Quote:micheus@ /c/wingsdev/src/wings (master)
$ _
Now we can test Wings3d just using the alias w1 in the prompt and hitting ENTER.

My Wings3D Collection at G+

Forum Jump:

User(s) browsing this thread: 1 Guest(s)