https://github.com/kul-forbes/ForBES
Raw File
Tip revision: 44e002c1d0940beacc69a5531830e50bf84b77d5 authored by Willem Melis on 09 May 2018, 14:44:22 UTC
removed c++ style comment
Tip revision: 44e002c
forbes_setup.m
% Add ForBES directory to MATLAB's path
forbes_path = fileparts(mfilename('fullpath'));
library_path = fullfile(forbes_path, 'library');
private_path = fullfile(forbes_path, 'private');
utils_path = fullfile(forbes_path, 'utils');
cones_path = fullfile(forbes_path, 'cones');
disp(['Adding ForBES directory to MATLAB path: ', forbes_path]);
addpath(forbes_path);
disp(['Adding ForBES library to MATLAB path: ', library_path]);
addpath(library_path);
disp(['Adding ForBES utils to MATLAB path: ', library_path]);
addpath(utils_path);
addpath(cones_path);
savepath;

% Compile necessary C source files
LBFGS_path = fullfile(forbes_path, 'private', 'lbfgs.c');
Riccati_path = fullfile(forbes_path, 'library', 'RiccatiSolve.c');
error_msg = 'The C compiler could not succesfully compile ';
if mex('-outdir', private_path,'-lmwblas', LBFGS_path), error([error_msg, LBFGS_path]); end
if mex('-outdir', library_path, Riccati_path), error([error_msg, Riccati_path]); end
disp('ForBES was succesfully configured and installed');
disp('Type ''help forbes'' to access the help file');

% Clear variables
clear forbes_path library_path cones_path private_path LBFGS_path Riccati_path error_msg;
back to top