07-06-2014, 08:37 AM
This document is under update process
I prepared this script based on the steps I needed to build my Linux environment using a "fresh" install of Ubuntu 13.10 32bits (in a VirtualBox). I'm about to prepare two real install for Ubuntu 14.04 32bits and 64bits. If I found anything new I'll update this thread.
Before start
- we are building a 32bits environment, but we can use the proper libraries to build a 64bits version;
- the files are download in the Downloads folder under home directory;
- to install the build files we may need a root access. So, we need include the sudo word before the install command;
- the sources codes we need will be put/unpacked under ~\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 in order to make pushes to the main dev repository. * If we are only building Wings3d then this two initial items can be ignored;
- 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 shell prompt (Terminal). It's necessary if we want push changes to our remote repository (on gitHub) as well pull requests to the main project;
- Download, build and install the Erlang (OTP xx.x Source File). The full instructions to build Erlang can be found here: Building and Installing Erlang/OTP.
Some packages that are a possible prerequisites in order to build Erlang (they were for me):- OpenGL support (Mesa) - I found two links that help me with this: How to Install Mesa (OpenGL) on Linux Mint and How to install OpenGL version 2.0.
- Autotools
Code:
$ sudo apt-get install build-essential
$ sudo apt-get install autoconf
$ sudo apt-get install automake - wxWidgets - download the sources and extract them to ~/src and build and install it:
Code:
$ cd ~/src/wxWidgets-3.0.2
$ ./configure --enable-unicode
$ make
$ sudo make install - Java-SDK (by now,the minimum requirements is version 1.6, see the building Erlang doc)
Code:
$ sudo apt-get install openjdk-6-jre-headless
Now we should be able to build and install Erlang
Code:
$ cd ~/src/otp_src_18.3
$ ./otp_build autoconf
$ ./configure --enable-threads --disable-hipe --without-termcap
$ make
$ sudo make install
- 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:- Intel -Intel® SDK for OpenCL™ Applications
- AMD - AMD APP SDK
- NVidia - CUDA Toolkit (look for GPU Computing SDK code samples)
For this environment I needed to use it based on CPU, so I download, build and installed the AMD SDK (I build it from Downloads directory since I discarded it after install). We have instructions in the ReadMe.txt file:
Everything will be set and you will be informed about the lib location: 32-bit path is :/opt/AMDAPP/lib/x86 (we'll need that soon).Code:
$ cd ~/Downloads/AMD-APP-SDK-v2.9-lnx32
$ sudo ./Install-AMD-APP.sh - Makeself - Make self-extractable archives on Unix to create the installer [optional*]
Code:
$ sudo apt-get install makeself
Before continue, let's setup the environment variables, alias, etc...
So, we should edit the .bashrc file under home folder using root access:
Code:
$ sudo gedit ~/.bachrcCode:
...
## The changes for Wings3d development environment starts here
ROOT_SRC=~/src
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"
alias cls=clear ## For some shell it must be "clear screen"
## For start Wings3d from the shell during test/debug process
# Start and run wings with esdl
alias w1='exec erl -smp -pa ~/source/wings/ebin -run wings_start start_halt ${1+"$@"}'
export PAGER=less
export EDITOR=emacs
export PATH="$ROOT_SRC/rebar":$PATH
export PATH=/usr/local/lib/erlang/erts-7.3/bin/:$PATH
export WINGS_SRC_PATH="$ROOT_SRC/wings"
export ERL_LIBS=$ROOT_SRC
export OPENCL_DIR="/usr"
export LIBRARY_PATH= $LIBRARY_PATH:/opt/AMDAPP/lib/x86/Now, we'll start download the sources code we need and build them...
- cloning and building rebar (needed to build cl module)Code:
$ cds
$ git clone git://github.com/rebar/rebar.git rebar
$ cd rebar
$ make - cloning and building clCode:
$ cds
$ git clone git://github.com/dgud/cl
$ cd cl
$ rebar compile - cloning and building wingsCode:
$ cds
$ git clone git://github.com/dgud/wings
$ cd wings
$ make
If we want to see appended to the prompt the information about the current branch we are working when we are into a git repository we can add a new export line to the ~/.bashrc file. First of all we check the current string used by the system to build the prompt:
Code:
$ echo $PS1 [enter]\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
now we use the result to define the override instruction:
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$(__git_ps1 '(%s)')$ "
Quote:micheus@ubuntu-VirtualBox:~/src/wings(master)$ _* More information about this subject: Bash prompt basics and Display git branch
Now we can test Wings3d just using the alias w1 in the prompt and hitting ENTER.