diff options
author | Andrzej Janik <[email protected]> | 2020-11-11 22:35:34 +0100 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2020-11-12 20:12:14 +0100 |
commit | a2e77fe961fb543370261e844d6cd79e0269e877 (patch) | |
tree | dea4c9c506c73941403de8ab46560bd569b4a7e7 /notcuda/build.rs | |
parent | 7c93997cc9b90886b6371ca3b93e21e7e6ae073d (diff) | |
download | ZLUDA-a2e77fe961fb543370261e844d6cd79e0269e877.tar.gz ZLUDA-a2e77fe961fb543370261e844d6cd79e0269e877.zip |
Refactor host code to use one big lock
Diffstat (limited to 'notcuda/build.rs')
-rw-r--r-- | notcuda/build.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/notcuda/build.rs b/notcuda/build.rs new file mode 100644 index 0000000..3b8999f --- /dev/null +++ b/notcuda/build.rs @@ -0,0 +1,27 @@ +// HACK ALERT
+// This buidl script has been copy-pasted from cl-sys to avoid CUDA libraries
+// overriding path to OpenCL
+
+ fn main() {
+ if cfg!(windows) {
+ let known_sdk = [
+ // E.g. "c:\Program Files (x86)\Intel\OpenCL SDK\lib\x86\"
+ ("INTELOCLSDKROOT", "x64", "x86"),
+ // E.g. "c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\Win32\"
+ ("CUDA_PATH", "x64", "Win32"),
+ // E.g. "C:\Program Files (x86)\AMD APP SDK\3.0\lib\x86\"
+ ("AMDAPPSDKROOT", "x86_64", "x86"),
+ ];
+
+ for info in known_sdk.iter() {
+ if let Ok(sdk) = std::env::var(info.0) {
+ let mut path = std::path::PathBuf::from(sdk);
+ path.push("lib");
+ path.push(if cfg!(target_arch="x86_64") { info.1 } else { info.2 });
+ println!("cargo:rustc-link-search=native={}", path.display());
+ }
+ }
+
+ println!("cargo:rustc-link-search=native=C:\\Program Files (x86)\\OCL_SDK_Light\\lib\\x86_64");
+ }
+}
\ No newline at end of file |