Commit 597bb696 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Adding custom compilation arguments

parent 39154ee9
import os
import sys
env = Environment()
## Import configuration from a config file
##
AddOption('--cfg', help='Specify a configuration file (see config.example')
configFile = GetOption('cfg')
if configFile == None:
configFile = 'config.example'
#end
if not os.path.exists(configFile):
print '<<ERROR>> the config file you specified does not exists'
Exit(1)
#end
vars = Variables(configFile)
vars.Add('CC', 'Compiler')
vars.Add('OPENEXR_INC', 'OpenEXR include directory')
vars.Add('OPENEXR_DIR', 'OpenEXR libraries directory')
vars.Add('OPENEXR_LIBS', 'OpenEXR libraries')
vars.Add('CERES_INC', 'CERES include directory')
vars.Add('CERES_DIR', 'CERES libraries directory')
vars.Add('CERES_LIBS', 'CERES libraries')
vars.Add('CERES_OPT_LIBS', 'CERES optional libraries')
env = Environment(variables = vars)
print(env['CC'])
## PLATFORM dependant section
##
if sys.platform == 'darwin':
# Adding the /usr/local/lib directory used to store libraries of
......@@ -20,7 +44,6 @@ if sys.platform == 'darwin':
## COMPILER dependant section
##
if env['CC'] in ['gcc', 'g++', 'clang']:
env.AppendUnique(CCFLAGS = '-fPIC')
#end
......@@ -30,7 +53,6 @@ if env['CC'] in ['gcc', 'g++', 'clang']:
## is a python script that updates the env variable with different
## paths.
##
env.AppendUnique(LIBPATH = ['#external/build/lib'])
env.AppendUnique(LIBPATH = ['#sources/build'])
env.AppendUnique(CPPPATH = ['#external/build/include'])
......@@ -40,7 +62,6 @@ env.AppendUnique(CPPPATH = ['#sources'])
## Launch the compilations
##
Export('env')
external = env.SConscript('external/SConscript')
......
import os, sys
##----------------------------------------------------------------##
## This file describes required and optional arguments to ALTA ##
## compilation. If you want to manualy tune the use of an already ##
## present library, uncomment the according lines. ##
##----------------------------------------------------------------##
## Compilators build flags
##
CC = 'g++'
CC_FLAGS = ['-O3', '-Wall']
## OpenMP flags
##
#OPENMP_FLAGS = ['-fopenmp']
#OPENMP_LIB = ['gomp']
## OpenEXR library
##
#OPENEXR_INC = ['/usr/include/OpenEXR']
#OPENEXR_DIR = ['/usr/lib']
#OPENEXR_LIB = ['Half', 'IlmImf', 'IlmThread']
## CERES library
##
## You have to specify both the directory of the CERES library
## and the glog library
##
CERES_INC = ['#external/build/include']
CERES_DIR = ['#external/build/lib']
CERES_LIBS = ['ceres', 'glog']
CERES_OPT_LIBS = ['gomp', 'lapack', 'blas']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment