Difference between revisions of "How to swap between versions of the TELEMAC system"

From SourceWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
It is rather common to have more than one version of the TELEMAC system installed at the same time. Most developers will have at least the current stable and development versions installed at the same time. This article gives some hints on how to set up a system with concurrent versions alongside each other.
 
It is rather common to have more than one version of the TELEMAC system installed at the same time. Most developers will have at least the current stable and development versions installed at the same time. This article gives some hints on how to set up a system with concurrent versions alongside each other.
 +
 +
= Using the steering file? '''NO!''' =
 +
In theory, the keyword <code>RELEASES</code> in the steering file can be used to swap between version of '''ESTEL'''. However, it is '''a very bad idea''' to do so. This is mainly because:
 +
* the script that lauches'''ESTEL''' needs a dictionnary and it will use the dictionnary of the version set by default in systel.ini, regardless of what you have used for <code>RELEASES</code>
 +
* '''ESTEL''' needs to be used with a particular set of libraries and this cannot be ensured if you change the <code>RELEASES</code> string. This is why it is recommended to '''not''' put the <code>RELEASES</code> keyword into your steering files, the default release numbers selected by the developers will be used instead... and they work.
 +
 +
The rest of this article shows how to ''reliably'' switch very quickly between version of '''ESTEL'''. The setup is a bit time consuming but after that, a single command is enough to switch (no messy editing of files etc...).
  
 
= SYSTELCFG =
 
= SYSTELCFG =
The TELEMAC system allows several configuration directories. By default, it looks for <code>/path/to/systel90/config/</code>. However, if the environment variable <code>SYSTELCFG</code> it will use its value as the location of the configuration directory.  
+
The TELEMAC system allows several configuration directories. By default, it looks for <code>/path/to/systel90/config/</code>. However, if the environment variable <code>SYSTELCFG</code>is set, it will use its value as the location of the configuration directory.
 +
 
 +
The method described in this article to swap between versions consists of creating a seperate configuration folder for each version of the code. The <code>systel.ini</code> and <code>cfgmak.mak</code> files in each folder will point to a specific version of the code. For instance create a folder called <code>/path/to/systel90/configv5p7</code>. Inside this folder, copy a <code>systel.ini</code> file where the [[Install_the_TELEMAC_system#The_.5BGENERAL.5D_section | [GENERAL] section ]] is tweaked for version v5p7 of the TELEMAC system. Then set the <code>SYSTELCFG</code> variable to point to this folder and run <code>cfgmak</code>:
 +
<code><pre>
 +
$ export SYSTELCFG=/path/to/systel90/configv5p7
 +
$ cfgmak
 +
File '/path/to/systel90/configv5p7/cfgmak.mak' updated.
 +
$ build_systel -v v5p7 -p -c
 +
</pre></code>
 +
 
 +
You will have version v5p7 of the TELEMAC system compiled and configured.
 +
 
 +
You can then create a <code>configv5p8</code> folder, edit the <code>systel.ini</code> file in this folder and do the same for v5p8:
 +
<code><pre>
 +
$ export SYSTELCFG=/path/to/systel90/configv5p8
 +
$ cfgmak
 +
File '/path/to/systel90/configv5p8/cfgmak.mak' updated.
 +
$ build_systel -v v5p8 -p -c
 +
</pre></code>
 +
 
 +
You will then have both v5p7 and v5p8 compiled and configure on your machine.
 +
 
 +
If you set SYSTELCFG to point to either configv5p7 or configv5p8, you will default to the relevant version.
  
 
= Switching between versions =
 
= Switching between versions =
Providing that the TELEMAC system is configured properly for each configuration directory (i.e. <code>cfgmak</code> has been run and all modules compiled with this setup), switching between versions is almost trivial:
+
Providing that the TELEMAC system is configured properly for each configuration directory, switching between versions is now trivial:
  
 
To switch to version v5p7:
 
To switch to version v5p7:
Line 17: Line 46:
 
</pre></code>
 
</pre></code>
  
To automate the process even more, it is possible to define bash function and load then in your <code>.bashrc</code> file. For instance you could add:
+
= Bash scripts =
<code><pre>
+
Actually, to automate the process even more, three scripts are provided in the <code>/path/to/systel90/bin/</code> which export <code>SYSTELCFG</code> to <code>$HOME/systel90/convigvxpt</code>. This way, you can simply switch between versions by typing v5p7 or v5p8 at the command line:
function v5p7 ()
 
# Use v5p7 configuration
 
{
 
export SYSTELCFG=/path/to/systel90/configv5p7
 
}
 
 
 
function v5p8 ()
 
# Use v5p8 configuration
 
{
 
export SYSTELCFG=/path/to/systel90/configv5p8
 
}
 
</pre></code>
 
 
 
Then, you could simply switch between version by typing v5p7 or v5p8 at the command line:
 
 
<code><pre>
 
<code><pre>
 
$ v5p7
 
$ v5p7
$ estel3d cas -> will use ESTEL-3D v5p7
+
$ estel3d cas (-> will use ESTEL-3D v5p7)
 
$ v5p8
 
$ v5p8
$ estel3d cas -> will use ESTEL-3D v5p8
+
$ estel3d cas (-> will use ESTEL-3D v5p8)
 
</pre></code>
 
</pre></code>
 +
 +
Note, you might need to customize these scripts though...
  
 
= Full .bashrc file =
 
= Full .bashrc file =
 +
The [[typical .bashrc for ESTEL]] contains some functions which provideextended functionality when used with the v5p7 and v5p7 scripts above, for instance to navigate quickly to the '''ESTEL''' folders.

Revision as of 16:31, 23 August 2007

It is rather common to have more than one version of the TELEMAC system installed at the same time. Most developers will have at least the current stable and development versions installed at the same time. This article gives some hints on how to set up a system with concurrent versions alongside each other.

Using the steering file? NO!

In theory, the keyword RELEASES in the steering file can be used to swap between version of ESTEL. However, it is a very bad idea to do so. This is mainly because:

  • the script that lauchesESTEL needs a dictionnary and it will use the dictionnary of the version set by default in systel.ini, regardless of what you have used for RELEASES
  • ESTEL needs to be used with a particular set of libraries and this cannot be ensured if you change the RELEASES string. This is why it is recommended to not put the RELEASES keyword into your steering files, the default release numbers selected by the developers will be used instead... and they work.

The rest of this article shows how to reliably switch very quickly between version of ESTEL. The setup is a bit time consuming but after that, a single command is enough to switch (no messy editing of files etc...).

SYSTELCFG

The TELEMAC system allows several configuration directories. By default, it looks for /path/to/systel90/config/. However, if the environment variable SYSTELCFGis set, it will use its value as the location of the configuration directory.

The method described in this article to swap between versions consists of creating a seperate configuration folder for each version of the code. The systel.ini and cfgmak.mak files in each folder will point to a specific version of the code. For instance create a folder called /path/to/systel90/configv5p7. Inside this folder, copy a systel.ini file where the [GENERAL] section is tweaked for version v5p7 of the TELEMAC system. Then set the SYSTELCFG variable to point to this folder and run cfgmak:

$ export SYSTELCFG=/path/to/systel90/configv5p7
$ cfgmak
File '/path/to/systel90/configv5p7/cfgmak.mak' updated.
$ build_systel -v v5p7 -p -c

You will have version v5p7 of the TELEMAC system compiled and configured.

You can then create a configv5p8 folder, edit the systel.ini file in this folder and do the same for v5p8:

$ export SYSTELCFG=/path/to/systel90/configv5p8
$ cfgmak
File '/path/to/systel90/configv5p8/cfgmak.mak' updated.
$ build_systel -v v5p8 -p -c

You will then have both v5p7 and v5p8 compiled and configure on your machine.

If you set SYSTELCFG to point to either configv5p7 or configv5p8, you will default to the relevant version.

Switching between versions

Providing that the TELEMAC system is configured properly for each configuration directory, switching between versions is now trivial:

To switch to version v5p7:

$ export SYSTELCFG=/path/to/systel90/configv5p7

To switch back to v5p8:

$ export SYSTELCFG=/path/to/systel90/configv5p7

Bash scripts

Actually, to automate the process even more, three scripts are provided in the /path/to/systel90/bin/ which export SYSTELCFG to $HOME/systel90/convigvxpt. This way, you can simply switch between versions by typing v5p7 or v5p8 at the command line:

$ v5p7
$ estel3d cas (-> will use ESTEL-3D v5p7)
$ v5p8
$ estel3d cas (-> will use ESTEL-3D v5p8)

Note, you might need to customize these scripts though...

Full .bashrc file

The typical .bashrc for ESTEL contains some functions which provideextended functionality when used with the v5p7 and v5p7 scripts above, for instance to navigate quickly to the ESTEL folders.