From a9ea6bc13bfae7bb5f945c986a8c3cad8a39b7fa Mon Sep 17 00:00:00 2001
From: galperti <cristian.galperti@epfl.ch>
Date: Tue, 21 Jun 2022 10:12:17 +0200
Subject: [PATCH] environmental setup files added

---
 matlab960.sh       |  5 +++++
 scdds_core_paths.m |  4 ++++
 scdds_env.sh       | 20 ++++++++++++++++++++
 setup_icc          |  8 ++++++++
 4 files changed, 37 insertions(+)
 create mode 100755 matlab960.sh
 create mode 100755 scdds_env.sh
 create mode 100644 setup_icc

diff --git a/matlab960.sh b/matlab960.sh
new file mode 100755
index 0000000..ea0e671
--- /dev/null
+++ b/matlab960.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source scdds_env.sh
+
+LIBGL_ALWAYS_SOFTWARE=1 /usr/local/MATLAB/R2019a/bin/matlab -c /etc/network.lic -nodesktop -softwareopengl -nosplash -r 'scdds_core_paths;'
diff --git a/scdds_core_paths.m b/scdds_core_paths.m
index 29b30f2..6612a0c 100644
--- a/scdds_core_paths.m
+++ b/scdds_core_paths.m
@@ -28,6 +28,10 @@ scdds_core_folder = fileparts(mfilename('fullpath')); % folder containing this s
 addpath(genpath(fullfile(scdds_core_folder,'classes')));
 addpath(genpath(fullfile(scdds_core_folder,'functions')));
 addpath(genpath(fullfile(scdds_core_folder,'configurations')));
+addpath(genpath(fullfile(scdds_core_folder,'codegen')));
+
+% Algos path
+addpath(genpath(fullfile(scdds_core_folder,'algos')));
 
 % set code generation and cache file location
 fprintf('setting Simulink Cache and CodeGen folders for SCDDS\n')
diff --git a/scdds_env.sh b/scdds_env.sh
new file mode 100755
index 0000000..67bf580
--- /dev/null
+++ b/scdds_env.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [[ "$(hostname)" == "spcpc478.epfl.ch" ]] || [[ "$(hostname)" == "crpppc171" ]]
+then
+  echo "Setting up icc"
+  source setup_icc
+fi
+
+echo "Defining environment variables"
+declare -x SCDDS_PATH=$(pwd)
+echo SCDDS_PATH=$SCDDS_PATH
+
+if [[ "$(uname -s)" == "linux" ]] && [[ -z $MATLAB ]]
+then
+ declare -x MATLAB=/usr/local/MATLAB/R2019a
+ echo MATLAB=$MATLAB
+else
+ echo MATLAB=$MATLAB
+ echo please check or declare MATLAB environment variable before compiling meq/genlib
+fi
diff --git a/setup_icc b/setup_icc
new file mode 100644
index 0000000..fef3db6
--- /dev/null
+++ b/setup_icc
@@ -0,0 +1,8 @@
+#2018
+#declare -x INTEL_LICENSE_FILE=/opt/intel2018/license
+#source /opt/intel2018/compilers_and_libraries/linux/bin/compilervars.sh intel64
+#2021
+source /opt/intel/oneapi/compiler/2021.1.1/env/vars.sh
+source /opt/intel/oneapi/mkl/2021.1.1/env/vars.sh
+echo "current icc version: $(icc --version)"
+#echo "Note that icc command now has become icx"
-- 
GitLab