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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-21 14:27:35 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-21 14:27:35 +0400
commit5f4c7e5da48c488b807635dccee03e1476e2f0bc (patch)
tree1656d0825177470395722e1c6c47fd1fd5ac4001 /intern/cycles/util/util_cuda.cpp
parent12117a81878d2e6909b3f9e13eccdd31cedf8be9 (diff)
Cycles: add some extra CUDA nvcc paths for runtime compile, might help for #33622.
Diffstat (limited to 'intern/cycles/util/util_cuda.cpp')
-rw-r--r--intern/cycles/util/util_cuda.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/intern/cycles/util/util_cuda.cpp b/intern/cycles/util/util_cuda.cpp
index 2716f00e173..12cb0d3e254 100644
--- a/intern/cycles/util/util_cuda.cpp
+++ b/intern/cycles/util/util_cuda.cpp
@@ -394,10 +394,10 @@ bool cuLibraryInit()
string cuCompilerPath()
{
#ifdef _WIN32
- const char *defaultpath = "C:/CUDA/bin";
+ const char *defaultpaths[] = {"C:/CUDA/bin", NULL};
const char *executable = "nvcc.exe";
#else
- const char *defaultpath = "/usr/local/cuda/bin";
+ const char *defaultpaths[] = {"/Developer/NVIDIA/CUDA-4.2/bin", "/usr/local/cuda-4.2/bin", "/usr/local/cuda/bin", NULL};
const char *executable = "nvcc";
#endif
@@ -405,13 +405,17 @@ string cuCompilerPath()
string nvcc;
- if(binpath)
+ if(binpath) {
nvcc = path_join(binpath, executable);
- else
- nvcc = path_join(defaultpath, executable);
+ if(path_exists(nvcc))
+ return nvcc;
+ }
- if(path_exists(nvcc))
- return nvcc;
+ for(int i = 0; defaultpaths[i]; i++) {
+ nvcc = path_join(defaultpaths[i], executable);
+ if(path_exists(nvcc))
+ return nvcc;
+ }
#ifndef _WIN32
{