-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.m
37 lines (31 loc) · 1.43 KB
/
make.m
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
%=================================================================
%
% make.m
% Author: Andrew Magis
% Makefile for the MATLAB installation of tsp_cuda
%=================================================================
% Check the locations below to ensure they match your system configuration!
% This portion taken from nvmex.m from 2009 The MathWorks, Inc.
if ispc % Windows
CUDA_LIB_Location = 'C:\CUDA\lib';
Host_Compiler_Location = '-ccbin "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin"';
PIC_Option = '';
else % Mac and Linux (assuming gcc is on the path)
CUDA_LIB_Location = '/usr/local/cuda/lib64/';
Host_Compiler_Location = '';
PIC_Option = ' --compiler-options -fPIC';
end
% End MathWorks code
% Build the c++ codes first
fprintf('Building the *.cpp files\n');
mex tiedrankmex.cpp
mex ranksummex.cpp
fprintf('Building the CUDA *.cu files\n')
fprintf('If this does not work, ensure the paths to the CUDA libraries \nand NVCC compiler are correct in make.m!\n\n\n');
nvmex('nvtspmex.cu', CUDA_LIB_Location, Host_Compiler_Location, PIC_Option);
nvmex('nvtstmex.cu', CUDA_LIB_Location, Host_Compiler_Location, PIC_Option);
nvmex('nvdisjointpairmex.cu', CUDA_LIB_Location, Host_Compiler_Location, PIC_Option);
fprintf('Deleting object files\n');
delete *.o
fprintf('Finished building tsp_cuda\n')
fprintf('Above MATLAB warnings about source files and 32-bit compatibility are typical\n');