Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LEVER
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
LEVER
Commits
9212fd9b
Commit
9212fd9b
authored
Aug 4, 2016
by
Mark Winter
Browse files
Options
Downloads
Patches
Plain Diff
Updated LEVER compile script moving cpp compiler setup to utility function.
parent
98989e39
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MATLAB/+Dev/CompileLEVer.m
+21
-44
21 additions, 44 deletions
src/MATLAB/+Dev/CompileLEVer.m
with
21 additions
and
44 deletions
src/MATLAB/+Dev/CompileLEVer.m
+
21
−
44
View file @
9212fd9b
...
@@ -41,7 +41,8 @@ function CompileLEVer(forceVersion)
...
@@ -41,7 +41,8 @@ function CompileLEVer(forceVersion)
Dev
.
MakeSegHelp
();
Dev
.
MakeSegHelp
();
%% Setup visual studio for MEX compilation
%% Setup visual studio for MEX compilation
[
vsStruct
,
comparch
]
=
setupCompileTools
();
setenv
(
'MATLAB_DIR'
,
matlabroot
());
[
compStruct
,
comparch
]
=
Dev
.
SetupCPPCompiler
(
'vs2015'
);
bindir
=
'..\..\bin'
;
bindir
=
'..\..\bin'
;
if
(
strcmpi
(
comparch
,
'win64'
)
)
if
(
strcmpi
(
comparch
,
'win64'
)
)
...
@@ -55,36 +56,37 @@ function CompileLEVer(forceVersion)
...
@@ -55,36 +56,37 @@ function CompileLEVer(forceVersion)
%% Compile all MEX files
%% Compile all MEX files
outputFiles
=
{};
outputFiles
=
{};
newOutput
=
compileMEX
(
'mexMAT'
,
vs
Struct
);
newOutput
=
compileMEX
(
'mexMAT'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMEX
(
'Tracker'
,
vs
Struct
);
newOutput
=
compileMEX
(
'Tracker'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMEX
(
'mexDijkstra'
,
vs
Struct
);
newOutput
=
compileMEX
(
'mexDijkstra'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMEX
(
'mexGraph'
,
vs
Struct
);
newOutput
=
compileMEX
(
'mexGraph'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMEX
(
'mexIntegrityCheck'
,
vs
Struct
);
newOutput
=
compileMEX
(
'mexIntegrityCheck'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMEX
(
'mexHashData'
,
vs
Struct
);
newOutput
=
compileMEX
(
'mexHashData'
,
comp
Struct
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
%% Compile LEVER, Segmentor, and batch LEVER_SegAndTrackFolders.
%% Compile LEVER, Segmentor, and batch LEVER_SegAndTrackFolders.
javaDeps
=
initStruct
.
javaList
;
javaDeps
=
initStruct
.
javaList
;
addFiles
=
{
'LEVER_logo.tif'
;
'+Segmentation\FrameSegmentor_*.m'
;
'+Dev\GetVersion.m'
;
'+Dev\VersionInfo.m'
};
addImgs
=
{
'+UI\backFrame.png'
;
'+UI\forwardFrame.png'
;
'+UI\pause.png'
;
'+UI\play.png'
;
'+UI\stop.png'
};
addImgs
=
{
'+UI\backFrame.png'
;
'+UI\forwardFrame.png'
;
'+UI\pause.png'
;
'+UI\play.png'
;
'+UI\stop.png'
};
newOutput
=
compileMATLAB
(
'LEVer'
,
bindir
,
[
javaDeps
;
addImgs
],
initStruct
.
toolboxList
);
newOutput
=
compileMATLAB
(
'LEVer'
,
bindir
,
[
addFiles
;
javaDeps
;
addImgs
],
initStruct
.
toolboxList
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMATLAB
(
'LEVER_SegAndTrackFolders'
,
bindir
,
javaDeps
,
initStruct
.
toolboxList
);
newOutput
=
compileMATLAB
(
'LEVER_SegAndTrackFolders'
,
bindir
,
[
addFiles
;
javaDeps
]
,
initStruct
.
toolboxList
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
newOutput
=
compileMATLAB
(
'Segmentor'
,
bindir
,
javaDeps
,
initStruct
.
toolboxList
);
newOutput
=
compileMATLAB
(
'Segmentor'
,
bindir
,
[
addFiles
;
javaDeps
]
,
initStruct
.
toolboxList
);
outputFiles
=
[
outputFiles
;
{
newOutput
}];
outputFiles
=
[
outputFiles
;
{
newOutput
}];
fprintf
(
'\n'
);
fprintf
(
'\n'
);
...
@@ -101,57 +103,36 @@ function CompileLEVer(forceVersion)
...
@@ -101,57 +103,36 @@ function CompileLEVer(forceVersion)
toc
(
totalTime
)
toc
(
totalTime
)
end
end
function
[
vsStruct
,
comparch
]
=
setupCompileTools
()
function
outputFile
=
compileMEX
(
projectName
,
compStruct
)
vsStruct
.
vstoolroot
=
getenv
(
'VS140COMNTOOLS'
);
if
(
isempty
(
vsStruct
.
vstoolroot
)
)
error
(
'Cannot compile MEX files without Visual Studio 2015'
);
end
setenv
(
'MATLAB_DIR'
,
matlabroot
());
comparch
=
computer
(
'arch'
);
if
(
strcmpi
(
comparch
,
'win64'
)
)
vsStruct
.
buildbits
=
'64'
;
vsStruct
.
buildenv
=
fullfile
(
vsStruct
.
vstoolroot
,
'..'
,
'..'
,
'vc'
,
'bin'
,
'amd64'
,
'vcvars64.bat'
);
vsStruct
.
buildplatform
=
'x64'
;
else
error
(
'Only windows 64-bit builds are currently supported'
);
end
system
([
'"'
vsStruct
.
buildenv
'"'
]);
clear
mex
;
end
function
outputFile
=
compileMEX
(
projectName
,
vsStruct
)
compileTime
=
tic
();
compileTime
=
tic
();
outputFile
=
[
projectName
'.mexw'
vs
Struct
.
buildbits
];
outputFile
=
[
projectName
'.mexw'
comp
Struct
.
buildbits
];
fprintf
(
'\nVisual Studio Compiling: %s...\n'
,
outputFile
);
fprintf
(
'\nVisual Studio Compiling: %s...\n'
,
outputFile
);
projectRoot
=
fullfile
(
'..'
,
'c'
,
projectName
);
projectRoot
=
fullfile
(
'..'
,
'c'
,
projectName
);
result
=
system
([
'"'
fullfile
(
vs
Struct
.
vs
toolroot
,
'..'
,
'IDE'
,
'devenv.com'
)
'"'
' /build "Release|'
vs
Struct
.
buildplatform
'" "'
projectRoot
'.sln"'
]);
result
=
system
([
'"'
fullfile
(
comp
Struct
.
toolroot
,
'..'
,
'IDE'
,
'devenv.com'
)
'"'
' /build "Release|'
comp
Struct
.
buildplatform
'" "'
projectRoot
'.sln"'
]);
if
(
result
~=
0
)
if
(
result
~=
0
)
error
([
projectName
': MEX compile failed.'
]);
error
([
projectName
': MEX compile failed.'
]);
end
end
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
vs
Struct
.
buildplatform
],
[
projectName
'.dll'
])
' '
fullfile
(
'.'
,
[
projectName
'.mexw'
vs
Struct
.
buildbits
])]);
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
comp
Struct
.
buildplatform
],
[
projectName
'.dll'
])
' '
fullfile
(
'.'
,
[
projectName
'.mexw'
comp
Struct
.
buildbits
])]);
fprintf
(
'Done (%f sec)\n\n'
,
toc
(
compileTime
));
fprintf
(
'Done (%f sec)\n\n'
,
toc
(
compileTime
));
end
end
function
outputFile
=
compileEXE
(
projectName
,
vs
Struct
,
bindir
)
function
outputFile
=
compileEXE
(
projectName
,
comp
Struct
,
bindir
)
compileTime
=
tic
();
compileTime
=
tic
();
outputFile
=
[
projectName
'.exe'
];
outputFile
=
[
projectName
'.exe'
];
fprintf
(
'\nVisual Studio Compiling: %s...\n'
,
outputFile
);
fprintf
(
'\nVisual Studio Compiling: %s...\n'
,
outputFile
);
projectRoot
=
fullfile
(
'..'
,
'c'
,
projectName
);
projectRoot
=
fullfile
(
'..'
,
'c'
,
projectName
);
result
=
system
([
'"'
fullfile
(
vs
Struct
.
vstoolroot
,
'..'
,
'IDE'
,
'devenv.com'
)
'"'
' /build "Release|'
vs
Struct
.
buildplatform
'" "'
projectRoot
'.sln"'
]);
result
=
system
([
'"'
fullfile
(
comp
Struct
.
vstoolroot
,
'..'
,
'IDE'
,
'devenv.com'
)
'"'
' /build "Release|'
comp
Struct
.
buildplatform
'" "'
projectRoot
'.sln"'
]);
if
(
result
~=
0
)
if
(
result
~=
0
)
error
([
projectName
': EXE compile failed.'
]);
error
([
projectName
': EXE compile failed.'
]);
end
end
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
vs
Struct
.
buildplatform
],
[
projectName
'.exe'
])
' '
fullfile
(
'.'
,
[
projectName
'.exe'
])]);
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
comp
Struct
.
buildplatform
],
[
projectName
'.exe'
])
' '
fullfile
(
'.'
,
[
projectName
'.exe'
])]);
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
vs
Struct
.
buildplatform
],
[
projectName
'.exe'
])
' '
fullfile
(
bindir
,
'.'
)]);
system
([
'copy '
fullfile
(
projectRoot
,
[
'Release_'
comp
Struct
.
buildplatform
],
[
projectName
'.exe'
])
' '
fullfile
(
bindir
,
'.'
)]);
fprintf
(
'Done (%f sec)\n\n'
,
toc
(
compileTime
));
fprintf
(
'Done (%f sec)\n\n'
,
toc
(
compileTime
));
end
end
...
@@ -164,10 +145,6 @@ function outputFile = compileMATLAB(projectName, bindir, extrasList, toolboxList
...
@@ -164,10 +145,6 @@ function outputFile = compileMATLAB(projectName, bindir, extrasList, toolboxList
if
(
~
exist
(
'extrasList'
,
'var'
)
)
if
(
~
exist
(
'extrasList'
,
'var'
)
)
extrasList
=
{};
extrasList
=
{};
end
end
extrasList
=
vertcat
({
'LEVER_logo.tif'
;
'+Segmentation\FrameSegmentor_*.m'
;
'+Dev\GetVersion.m'
;
'+Dev\VersionInfo.m'
},
extrasList
);
extraCommand
=
''
;
extraCommand
=
''
;
if
(
~
isempty
(
extrasList
)
)
if
(
~
isempty
(
extrasList
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment