|
1 | 1 | check_location <- function(){ |
2 | | - if(Sys.info()['sysname'] == 'Windows'){ |
3 | | - if(!file.exists("../build/bin/Debug/thundersvm.dll")){ |
4 | | - print("Please build the library first!") |
5 | | - quit() |
6 | | - } |
7 | | - dyn.load("../build/bin/Debug/thundersvm.dll") |
8 | | - } else if(Sys.info()['sysname'] == 'Linux'){ |
9 | | - if(!file.exists("../build/lib/libthundersvm.so")){ |
10 | | - print("Please build the library first!") |
11 | | - quit() |
12 | | - } |
13 | | - dyn.load("../build/lib/libthundersvm.so") |
14 | | - } else if(Sys.info()['sysname'] == 'Darwin'){ |
15 | | - if(!file.exists("../build/lib/libthundersvm.dylib")){ |
16 | | - print("Please build the library first!") |
17 | | - quit() |
18 | | - } |
19 | | - dyn.load("../build/lib/libthundersvm.dylib") |
20 | | - } else{ |
21 | | - print("OS not supported!") |
22 | | - quit() |
23 | | - } |
| 2 | + if(Sys.info()['sysname'] == 'Windows'){ |
| 3 | + if(!file.exists("../build/bin/Debug/thundersvm.dll")){ |
| 4 | + stop("Please build the library first!") |
| 5 | + } |
| 6 | + dyn.load("../build/bin/Debug/thundersvm.dll") |
| 7 | + } else if(Sys.info()['sysname'] == 'Linux'){ |
| 8 | + if(!file.exists("../build/lib/libthundersvm.so")){ |
| 9 | + stop("Please build the library first!") |
| 10 | + } |
| 11 | + dyn.load("../build/lib/libthundersvm.so") |
| 12 | + } else if(Sys.info()['sysname'] == 'Darwin'){ |
| 13 | + if(!file.exists("../build/lib/libthundersvm.dylib")){ |
| 14 | + stop("Please build the library first!") |
| 15 | + } |
| 16 | + dyn.load("../build/lib/libthundersvm.dylib") |
| 17 | + } else{ |
| 18 | + stop("OS not supported!") |
| 19 | + } |
24 | 20 | } |
25 | 21 | check_location() # Run this when the file is sourced |
26 | 22 |
|
|
0 commit comments