Skip to content

LuxCoreRender/LinuxCompile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuxCoreRender Static Compilation Environment
============================================

This collection of scripts is intended for automatic creation of build
environment and Lux compilation with statically linked dependency libs.

First Run:
---------
On a recent Ubuntu (e.g. 19.10), you can compile LuxCore with one command:
./first_run.sh

Updating:
--------
To update to the latest sources, use standard git commands:

cd LuxCore
git pull
# Go back to LinuxCompile folder and recompile the last stage (5)
cd ..
./build-64-sse2 LuxCore 5

Recompiling after Code Modifications:
------------------------------------

In case you edit any source files and want to recompile quickly, go to 
the LuxCore sources directory and run make:

cd LuxCore
make -j 8
(-j <n> specifies number of threads for the compilation process)

The compiled binaries are in LuxCore/bin/, the compiled libraries 
(e.g. pyluxcore.so) are in LuxCore/lib/

Further Details
===============

Layout:
------
 - build
   The main routine.
   
 - build-64-sse2
   Wrapper script for compiling on the most common platforms.
   
 - distfiles
   Directory for the downloaded dependencies sources.
   
 - distfiles/files
   Dependencies manifest.
   
 - utils
   Directory containing a few helper scripts.

Requirements:
------------
Some dependencies aren't addressed by the script, and must be resolved
by the user prior to compilation. Among them are:
 - Python 3 (3.7 for use with Blender 2.80 and above)
 - OpenGL Graphics Library (MESA)
 - PyInstaller, it can usually be installed with a "sudo pip3 install pyinstaller"
   or "sudo pip install pyinstaller"
 - PySide, it can usually be installed with a "sudo pip3 install PySide"
   or "sudo pip install PySide". Ubuntu may require a
   "sudo apt-get install python3-pyside"
 - Python NumPy, it can usually be installed with on Ubuntu with a
   "sudo pip3 install python3-numpy"

Running build script for the first time will download dependencies
sources into the distfiles dir, taking about 300 MB of disk space.
Complete environment requires additional 300-400 MB for each architecture.
You also need enough space in your tmp directory to allow unpacking and
compilation of the largest deps -- Boost and Qt.

OpenCL & CUDA
-------------
You don't need to install OpenCL or CUDA SDK anymore. The binaries will check at
run time if OpenCL and/or CUDA are available and enable/disable the support
accordingly.

Usage:
-----
When build script is envoked, it will check for the main prereqisites,
try to figure out what's missing, and prepare the compilation environment
below the 'root' directory -- the dir where the script resides (although
paths are configurable in build-* wrapper scripts).

The easiest way to start compilation is by using the wrapper scripts
which have all the variables preconfigured for the most common platforms.
Here is how you can do this:

 1. Unpack LuxCoreRender sources into the subdirectory below 'root' directory
    (where scripts are located). The subdir with Lux sources may have
    any name, however
	if it contains 'dll' then the DLL version of LuxCore library is compiled;
	if it contains 'sdk' then the SDK version of LuxCore library is compiled;
	if it contains 'pyluxcore' then only pyluxcore target will be compiled.
    
    NOTE: you need git LFS extension (https://git-lfs.github.com) to clone
    LinuxCompileDeps repository. Or you can install and use
    https://desktop.github.com to clone the repositories;
    
 2. Run the wrapper script passing it the name of LuxCoreRender sources dir
    and optionally the stage number:
    ./build-64-sse2 <lux sources> [stage]
    
    To see a list of valid stage numbers run the script without any
    parameters. Specifying a stage allows you to recompile any deps if
    needed (however in such a case it's usually better to delete
    target-* dir altogether and start from scratch).
    
    If stage number is omitted the script will continue from where it
    was previously terminated, i.e. resume compilation of unfinished
    deps, or begin compiling LuxCoreRender if all dependencies are in place.
    
 3. Once the compilation is complete, Lux binaries and shared libs are
    packed in tar.bz2 archive and saved below the platform-specific
    'target' subdirectory.

 4. This step is optional. You can compile LuxMark too if you unpack the sources
    into the subdirectory below 'root' directory named "LuxMark".

Clang:
-----
The compilation environment supports Clang for compiling both LuxCoreRender
dependencies and LuxCoreRender itself. In order to enable it, create an empty
file named "use_clang" in compilation environment root directory. Make sure
you have the following components properly installed in your system:
 - Clang compiler (with executable under PATH env var)
 - libomp (OMP library for Clang)
 - LLVM with Clang support and Gold linker

Support:
-------
If you have any questions and suggestions regarding these tools, 
feel free to open a topic in http://forums.luxcorerender.org/viewforum.php?f=5
(or create an issue in this repository)