Knowledge Base‎ > ‎

Building from Source on Linux

Preparation

Packages listed here may be needed to compile Singularity, they are more geared toward 32-bit compiles, but don't let that discourage you, there should be 64-bit packages of these available, perhaps even under the same name.  Flex and Bison are no longer necessary.  You'll need to have git and mercurial(hg).  For Arch Linux, you'll need to get python2, python3 will not work.
GCC version 4(minimum 4.9) is required as GCC version 5 will not work.

git clone git://github.com/singularity-viewer/SingularityViewer.git singularity
cd singularity/
sudo pip install "hg+https://bitbucket.org/alchemyviewer/autobuild-alchemy"
autobuild configure -cConfiguration -pPlatform -- -DFMODSTUDIO:BOOL=ON
Platform can be either linux32 (will make archtype i686) or linux64 (will make archtype x86_64).
Configuration can be either Release (equivalent to our releases) or RelWithDebInfo (if you'd like assist us with resolving crash bugs).
Arch Linux users, and developers who wish their systems to have default versions of programs other than our requisites, may need to
  • Specify python2 for pip like so sudo python2 `which pip` install... to have the right python used
  • Append -DCMAKE_C_COMPILE=gcc-4.9 -DCMAKE_CXX_COMPILER=g++-4.9 to ensure use of GCC 4.

Compiling

cd build-linux-archtype-Configuration
make -j#
Note: Replace # with the number of processor cores you wish to dedicate to compiling.

This is pretty much it. The viewer will be in the newview/packaged subdirectory.

Known issues and how to handle them
If you use an Ubuntu/Debian based distribution and get a linker error: /usr/bin/ld: error: cannot find -lfoo
It may be solved by running: locate libfoo.so
If the output shows nothing, you're missing a package, ask your package manager for it.
If it shows something like /usr/lib/[arch]/libfoo.so.b.a.r or /usr/lib/[arch]/libfoo.so.b but not /usr/lib/[arch]/libfoo.so, you'll need to create a link, run sudo ln -s /usr/lib/[arch]/libfoo.so.b /usr/lib/[arch]/libfoo.so and your problem shall be solved.

The make command may error out the first time, just run it again. If this still doesn't quite work, file a JIRA.

Running the debugger

If you run singularity as ASCENDED_DEVELOPER=1 ./singularity it will start in debugger. The debugger will take a few seconds to load and present you with a command prompt. Enter run or short r to start Singularity Viewer. If there is an error, the debugger will stop Singularity Viewer and require entry. Examine the situation quickly. If the program was stopped because of SIGPIPE, you can simply continue execution by entering cont. If it was stopped because of SIGSEGV, we have a genuine crash on our hands! First thing that you will be able to see is which module we have crashed in. If it's in your graphics card driver, such as libnvidia-glcore.so, there is probably not much information you can gain this way, and can quit or kill and run again.

If the crash was elsewhere, preferably in our code or libc, more information can get gained from it! You can do the following to produce a bunch of output which will hopefully make sense to me:
set pagination 0
set log on
info registers
where
where full
thread apply all where full
After you quit, you will find gdb.txt containing all output. Please send that to me :)

Updating

Open a terminal to the repository you cloned and check if there's an update by running:
git fetch
If there is an update, there will be output from the command as it receives changesets.
To receive the update run:
git pull
To have the build number change for certain:
touch indra/newview/CMakeLists.txt
Finally, repeat the Compiling step to update your build.