forked from codedreality/homebrew-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpyrit-cuda.rb
49 lines (37 loc) · 1.34 KB
/
cpyrit-cuda.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'formula'
class CudaRequirement < Requirement
build true
fatal true
satisfy { which 'nvcc' }
env do
# nVidia CUDA installs (externally) into this dir (hard-coded):
ENV.append 'CFLAGS', "-F/Library/Frameworks"
# because nvcc has to be used
ENV.append_path 'PATH', which('nvcc').dirname
ENV.append 'LDFLAGS', "-L/usr/local/cuda/lib"
end
def message
<<-EOS.undent
To use this formula with NVIDIA graphics cards you will need to
download and install the CUDA drivers and tools from nvidia.com.
https://developer.nvidia.com/cuda-downloads
Select "Mac OS" as the Operating System and then select the
'Developer Drivers for MacOS' package.
You will also need to download and install the 'CUDA Toolkit' package.
The `nvcc` has to be in your PATH then (which is normally the case).
If it's not there you can add by adding export PATH=$PATH:/usr/local/cuda/bin
EOS
end
end
class CpyritCuda < Formula
homepage 'https://code.google.com/p/pyrit/'
url 'https://pyrit.googlecode.com/files/cpyrit-cuda-0.4.0.tar.gz'
sha1 '6481b1d104fc8a1753d50d517b99638782171a08'
depends_on :python
depends_on 'pyrit'
depends_on CudaRequirement
def install
system "python", "setup.py", "build"
system "python", "setup.py", "install", "--prefix=#{prefix}"
end
end