Supported platforms
-------------------
SimDiff Automation Linux is supported on CentOS, RedHat, and Ubuntu.

If you require SimDiff Automation to run on an platform or architecture that is
not listed above, please contact support@ensoftcorp.com for assistance.


Prerequisites
-------------
The required, recommended, and optional prerequisites for SimDiff Automation are 
listed here, along with an explanation of how SimDiff Automation uses each one.  
Except for MATLAB + Simulink, all prerequisites are free and open source.

[Required]
* GLIBC:  SimDiff Automation includes some native code (.so libraries) that 
  require a GLIBC version of 2.12 or higher
  
* Shell:  SimDiff Automation is launched using a shell script.  'bash' is 
  recommended, but any shell compatible with '/bin/sh' should work

[Recommended]
* MATLAB + Simulink:  A basic model comparison can be done without Simulink,
  but it is required for some of the more advanced operations.  SimDiff Automation
  Linux supports MATLAB R2008a and higher.
  
* csh:  Required for SimDiff Automation to be able to connect to MATLAB.  Must 
  be located at '/bin/csh'.  See Mathworks documentation for details:
  
      https://www.mathworks.com/help/matlab/matlab_external/introducing-matlab-engine.html

[Recommended for headless installations (e.g. Docker containers)]

* Xvfb:  Provides an X virtual framebuffer that enables inclusion of screenshots in
  reports. 



Installation
------------
1. Unpacking

To install SimDiff Automation, simply change to the directory in which you want 
to install SimDiff Automation, then execute the following command below, 
where "/path/to/" is the path to the .tar.gz installation file.  For example, 
for 2024a:

	tar xzf /path/to/SimDiffAutomation-2024a-install-linux64.tar.gz

This will create a "simdiff-automation" subdirectory containing the complete 
SimDiff Automation installation.


2. Environment

It is recommended to add the 'simdiff-automation' directory to your system PATH.
Otherwise, it is possible for the integration with MATLAB/Simulink to fail.

The instructions for adding a program to the system path varies by shell.  For
the 'bash' shell, it is done by editing the file '.bash_profile' in your home
directory, as shown below.  Note that the line starting with "PATH=" has been
modified to include the full path to SimDiff Automation.

Original .bash_profile:

		...
		# User specific environment and startup programs
		
		PATH=$PATH:$HOME/bin
		
		export PATH
		...

After installing SimDiff Automation:

		...
		# User specific environment and startup programs
		
		PATH=/path/to/simdiff-automation:$PATH:$HOME/bin
		
		export PATH
		...

If you have a windowed environment (X), you may configure licensing and
set the path to MATLAB installations using the -license and -matlabSetup
options, respectively.  Otherwise, proceed to the next section.


3. Configuration in scripted and/or headless environments

To configure SimDiff Automation in a headless environment, template files are 
provided in the configuration-templates directory.

License Setup:

For a Named-User Workgroup Float: 
$ cp configuration-templates/license-wgf-named-user/license.ini ~/.simdiff-automation/license.ini

For a Node-Locked Workgroup Float: 
$ cp configuration-templates/license-wgf-node-locked/license.ini ~/.simdiff-automation/license.ini

Edit license.ini - set the following keys to the server and port for your
OLicense server.  If you selected a Named-User license, also set your email.

license.email=
license.serveraddress=10.0.0.1
license.serverport=8080

MATLAB Setup:

To configure paths to MATLAB installations, copy mi_v2_x64.xml:
$ cp configuration-templates/matlab/mi_v2_x64.xml ~/.simdiff-automation/mi_v2_x64.xml

Edit mi_v2_x64.xml - remove any MATLAB releases that are not installed, and change the
path to match any that are installed.  

Each MATLAB release is represented by a <matlabinstalldata> tag.  For example, 
if R2024a is installed, find the <version name="Simulink" release="(R2024a)"/> tag
and update the corresponding path in the <matlabroot> tag.

     <matlabinstalldata isAvailable="true">
          <matlabroot path="/opt/matlab/R2024a"/>
          <version date="19-Nov-2023" name="MATLAB" number="24.1" release="(R2024a)"/>
          <version date="19-Nov-2023" name="Simulink" number="24.1" release="(R2024a)"/>
     </matlabinstalldata>


Disable SELinux
---------------
To run SimDiff Automation, you may need to disable SELinux.  To disable SELinux 
for the current session, execute the following command with root permissions:
	/usr/sbin/setenforce

To disable SELinux permanently for all login sessions, edit /etc/selinux/config
with root permissions, changing the "SELINUX=enforcing" line to 
"SELINUX=disabled"
