File: makememcpyCudaOpenGL.m

package info (click to toggle)
psychtoolbox-3 3.0.17.9.dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 84,408 kB
  • sloc: ansic: 171,572; cpp: 20,885; objc: 5,164; sh: 1,878; python: 1,366; php: 384; makefile: 193; java: 113
file content (36 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (6)
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
function makememcpyCudaOpenGL
% makememcpyCudaOpenGL - Build CUDA<->OpenGL interop helper mex file.
%
% This needs the NVidia CUDA-5.0 SDK or later installed.
%

if exist(['memcpyCudaOpenGL.' mexext], 'file');
    delete(['memcpyCudaOpenGL.' mexext]);
end

if IsOSX
	% -lcuda is optional at the moment. -framework CUDA is optional as well.
	mex -v -g -largeArrayDims memcpyCudaOpenGL.cpp -I/usr/include/ -I"/Developer/NVIDIA/CUDA-5.0/include" CXXFLAGS="\$CXXFLAGS -F/System/Library/Frameworks" -L"/Developer/NVIDIA/CUDA-5.0/lib" -L/usr/local/cuda/lib LDFLAGS="\$LDFLAGS -Xlinker -rpath -Xlinker /usr/local/cuda/lib " -lcudart
end

if IsLinux(1)
	% 64-Bit Linux build needs lib64 folder instead of lib folder:
	mex -v -g -largeArrayDims memcpyCudaOpenGL.cpp -I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lcudart
end

if IsLinux(0)
	% 32-Bit Linux build needs lib folder:
	mex -v -g -largeArrayDims memcpyCudaOpenGL.cpp -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcudart
end

if IsWin(1)
	% 64-Bit Windows build needs x64 folder instead of Win32 folder:
	mex -v -largeArrayDims memcpyCudaOpenGL.cpp -I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" -I"T:\projects\CUDA\v5.0\include" -LT:\projects\CUDA\v5.0\lib\x64 -lcudart
end

if IsWin(0)
	% 32-Bit Windows build needs Win32 folder:
	mex -v -largeArrayDims memcpyCudaOpenGL.cpp -I"T:\projects\CUDA\v5.0\include" -LT:\projects\CUDA\v5.0\lib\Win32 -lcudart
end

delete *.o