From af3d647e146ca025bb220db9cdecd984df7baf1e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 25 Apr 2017 10:53:50 +0200 Subject: [PATCH] Fix for update and init scripts --- .github/SOLVERS.md | 1 + initCobraToolbox.m | 13 ++++++++----- updateCobraToolbox.m | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/SOLVERS.md b/.github/SOLVERS.md index 4bc3e79380..a4142b0bcc 100644 --- a/.github/SOLVERS.md +++ b/.github/SOLVERS.md @@ -157,6 +157,7 @@ Platform-specific instructions are marked with ```` Windows Run `moseksetupwin64x86.msi` and select `Typical` installation. This will install `mosek` in `C:\Program Files\Mosek`. Linux Browse to `/Applications` and double-click the archive to uncompress. + :warning: It is important to run the script `python /Applications/mosek//tools/platform/osx64x86/bin/install.py`, which makes important updates to the installation. 5) macOS Linux Configure the `PATH` and `MOSEKLM_LICENSE_FILE` environment variables in `~/.bashrc` by editing your `bashrc` file ````bash diff --git a/initCobraToolbox.m b/initCobraToolbox.m index e9e4323226..23e1e34b9f 100644 --- a/initCobraToolbox.m +++ b/initCobraToolbox.m @@ -157,7 +157,7 @@ function initCobraToolbox() % add the folders of The COBRA Toolbox onPath = ~isempty(strfind(lower(path), lower(CBTDIR))); - folders = {'external', 'tutorials', 'papers', 'binary', 'deprecated', 'src', 'test'}; + folders = {'tutorials', 'papers', 'binary', 'deprecated', 'src', 'test'}; if ~onPath if ENV_VARS.printLevel @@ -167,14 +167,17 @@ function initCobraToolbox() % add the root folder addpath(CBTDIR); + % add the external folder first + addpath(genpath([CBTDIR, filesep, 'external'])); + + % remove the SBML Toolbox + rmpath(genpath([CBTDIR, filesep, 'external', filesep, 'SBMLToolbox'])); + % add specific subfolders for k = 1:length(folders) addpath(genpath([CBTDIR, filesep, folders{k}])); end - % remove the SBML Toolbox - rmpath(genpath([CBTDIR, filesep, 'external', filesep, 'SBMLToolbox'])); - % print a success message if ENV_VARS.printLevel fprintf(' Done.\n'); @@ -251,7 +254,7 @@ function initCobraToolbox() SOLVERS.glpk.type = {'LP', 'MILP'}; SOLVERS.gurobi.type = {'LP', 'MILP', 'QP', 'MIQP'}; SOLVERS.ibm_cplex.type = {'LP', 'MILP', 'QP', 'MIQP'}; - SOLVERS.matlab.type = {'NLP'}; + SOLVERS.matlab.type = {'LP', 'NLP'}; SOLVERS.mosek.type = {'LP', 'QP', 'MILP'}; SOLVERS.pdco.type = {'LP', 'QP', 'NLP'}; SOLVERS.quadMinos.type = {'LP', 'NLP'}; diff --git a/updateCobraToolbox.m b/updateCobraToolbox.m index c332bd3f27..b5f441e193 100644 --- a/updateCobraToolbox.m +++ b/updateCobraToolbox.m @@ -25,11 +25,11 @@ function updateCobraToolbox(fetchAndCheckOnly) end % determine the number of commits that the local master branch is behind - [status_gitCountMaster, result_gitCountMaster] = system('git rev-list --count origin/master...HEAD'); + [status_gitCountMaster, result_gitCountMaster] = system('git rev-list --no-merges --count origin/master...HEAD'); result_gitCountMaster = char(result_gitCountMaster); result_gitCountMaster = result_gitCountMaster(1:end-1); - [status_gitCountDevelop, result_gitCountDevelop] = system('git rev-list --count origin/develop...HEAD'); + [status_gitCountDevelop, result_gitCountDevelop] = system('git rev-list --no-merges --count origin/develop...HEAD'); result_gitCountDevelop = char(result_gitCountDevelop); result_gitCountDevelop = result_gitCountDevelop(1:end-1);