https://github.com/kul-forbes/ForBES
Revision c0e7d71620d70220990388f7c698ff9eaca354b9 authored by Lorenzo Stella on 15 May 2016, 16:58:16 UTC, committed by Lorenzo Stella on 15 May 2016, 16:58:16 UTC
1 parent 5b94a9d
Raw File
Tip revision: c0e7d71620d70220990388f7c698ff9eaca354b9 authored by Lorenzo Stella on 15 May 2016, 16:58:16 UTC
reorganized code
Tip revision: c0e7d71
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');
display(['Adding ForBES directory to MATLAB path: ', forbes_path]);
addpath(forbes_path);
display(['Adding ForBES library to MATLAB path: ', library_path]);
addpath(library_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, LBFGS_path), error([error_msg, LBFGS_path]); end
if mex('-outdir', library_path, Riccati_path), error([error_msg, Riccati_path]); end
display('ForBES was succesfully configured and installed');
display('Type ''help forbes'' to access the help file');
back to top