Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-01-10 12:01:07 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-10 12:01:07 +0400
commit35d0e99299cc653c9064026ccbb2b2453483c515 (patch)
tree3916695e2c58afbd7dd2cc93fa254ebec347441d /SConstruct
parentce4116c35c6d36bc147b8e96377bc895555dbf92 (diff)
Added new scons target: cudakernels
It's intended to perform compilation of CUDA kernels only, without doing anything with other sources/resources and main purpose of this target is to be able to compile cuda kernels in completely different environment than the rest of blender was compiled. This is needed for linux build environment, where sm_13 compilation fails dramatically in 32bit chroot but could be compiled in 64bit environment.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct24
1 files changed, 21 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 90c3c45b302..c50240b85e0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -275,6 +275,9 @@ if 'blenderlite' in B.targets:
if k not in B.arguments:
env[k] = v
+if 'cudakernels' in B.targets:
+ env['WITH_BF_CYCLES_CUDA_BINARIES'] = True
+
# Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX
if env['OURPLATFORM']=='darwin':
print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'] + " --"
@@ -651,6 +654,7 @@ datafileslist = []
datafilestargetlist = []
dottargetlist = []
scriptinstall = []
+cubininstall = []
if env['OURPLATFORM']!='darwin':
dotblenderinstall = []
@@ -746,7 +750,7 @@ if env['OURPLATFORM']!='darwin':
for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
- scriptinstall.append(env.Install(dir=dir,source=cubin_file))
+ cubininstall.append(env.Install(dir=dir,source=cubin_file))
# osl shaders
if env['WITH_BF_CYCLES_OSL']:
@@ -857,9 +861,9 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
if env['OURPLATFORM']=='darwin':
allinstall = [blenderinstall, textinstall]
elif env['OURPLATFORM']=='linux':
- allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall]
+ allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall, cubininstall]
else:
- allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall]
+ allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, cubininstall]
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
dllsources = []
@@ -989,6 +993,20 @@ buildslave_alias = env.Alias('buildslave', buildslave_cmd)
Depends(buildslave_cmd, allinstall)
+cudakernels_action = env.Action(btools.cudakernels, btools.cudakernels_print)
+cudakernels_cmd = env.Command('cudakernels_exec', None, cudakernels_action)
+cudakernels_alias = env.Alias('cudakernels', cudakernels_cmd)
+
+cudakernel_dir = os.path.join(os.path.abspath(os.path.normpath(B.root_build_dir)), 'intern/cycles/kernel')
+cuda_kernels = []
+
+for x in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
+ cubin = os.path.join(cudakernel_dir, 'kernel_' + x + '.cubin')
+ cuda_kernels.append(cubin)
+
+Depends(cudakernels_cmd, cuda_kernels)
+Depends(cudakernels_cmd, cubininstall)
+
Default(B.program_list)
if not env['WITHOUT_BF_INSTALL']: