Kusari Licence Management FAQ
- Do I need to run a licence server for my Kusari key? [answer]
- How do I install a key on Windows? [answer]
- How do I create my licence file? [answer]
- How do you set the NAG_KUSARI_FILE environment variable on Unix? [answer]
- How do you set the NAG_KUSARI_FILE environment variable on Microsoft Windows? [answer]
- Which part of the key should I paste into my licence file? [answer]
- Why is my licence rejected with "Format error in licence file"? [answer]
- On Unix, why is my licence rejected with "No licence found for this product" even though the product appears correctly in the licence file? [answer]
- Can I have multiple keys in one file? [answer]
- Can I put a node-locked key in my server control file? [answer]
- How do I specify more than one licence file and/or server? [answer]
- Why does the khostid change between consecutive runs? [answer]
- How do I find the Kusari licence server's version number? [answer]
- Do I need to tell NAG if I'm running the licence server on a non-default port? [answer]
- I have put my NAG Fortran key in the default place, but it's not found? [answer]
- My perpetual FLOATING or SITE key is rejected by the licence server with a syntax error logged and a "Cannot read licence file" error? [answer]
- My trial or node-locked key does not work. What can I do to check what is wrong? [answer]
- What do I do when all else fails? [answer]
- Do I need to run a licence server for my Kusari key?
You only need to run a licence server for FLOATING and SITE keys. All other keys are simply placed in a file and the environment variable NAG_KUSARI_FILE set to the name of this file.
- How do I install a key on Windows?
A GUI is supplied to generate a licence request and install a licence key. Please use this GUI to install all key types except SITE and FLOATING.
Use the "Check accessibility program", which is installed in Start/All Programs/NAG, to check the correct installation of the key.
There is no need to set the environment variable if the GUI is used.
- How do I create my licence file?
If you have been sent, for example, a trial key for a NAG product, please follow the procedure detailed below
- Choose a name for your licence file
- Open a text editor to create this file, e.g. on Windows use Notepad (not Microsoft Word) and on Unix use vi or emacs (and not a word processor)
- Cut and paste the key from the email message, ensuring that a new line is added at the end of the last (or only) line
- Ensure that the entire line or lines of the key are copied
- Feel free to copy any comments surrounding your key (these are lines beginning with an exclamation mark)
- Save this file
- On Unix, ensure the file permissions allow all users read access
- Set the environment variable NAG_KUSARI_FILE to the name of this file
- How do you set the NAG_KUSARI_FILE environment variable on Unix?
If you have your Fortran Library key in /etc/fl.licence.
With Bourne shell -
NAG_KUSARI_FILE=/etc/fl.licence export NAG_KUSARI_FILEWith bash -
export NAG_KUSARI_FILE=/etc/fl.licenceWith csh or similar shells like tcsh -
setenv NAG_KUSARI_FILE /etc/fl.licenceYou are recommended to add this command to your shell start-up script. The name of this varies depending on the type of shell; please see your system's documentation for the name of this file.
- How do you set the NAG_KUSARI_FILE environment variable on Microsoft Windows?
E.g. to set NAG_KUSARI_FILE to "c:\nag\fl.licence,myserver:" Under Microsoft Windows XP, right click "My computer" then select
Properties -> Advanced tab -> Environment variable buttonUnder Microsoft Vista, find "Computer" on the Start menu, and right click it, choosing "Properties" from the pop-up menu. On the left-hand side of the resulting window you should see "Advanced System Settings". Clicking that will bring up the "Advanced" tab of "System Properties", and once again you should see a button labelled "Environment Variables". On Microsoft Windows 10, Click on Start, then Settings, then search for “environment variables”. Click on “Edit the system environment variables” in the search results. Click "New" (under user variables), set the variable name to NAG_KUSARI_FILE and value to c:\nag\fl.licence,myserver:
N.B. Even if the licence file name contains spaces you should not surround the name in quotes.
- Which part of the key should I paste into my licence file?
Here are three typical examples of licence keys.
NPXYZ61NA NODE 2020/12/31 "l5jaTklTpIjckYA61dQ7on=hj5" NPABC61NA FULL "tehwmfuznCPfp3ggjb4xjqtdXg" "bDhQtaXeoCcaazoUkaYNiNybIh" FLXYZ26DA FULL "tggGVadsbHWaT8kLknaFdBngLN" "2pmHEgligk7aUdnZgAJEmd3nvB" & & "IRez6kNCjjhpadmInh7Sn5wVmv"You need to paste all of the text you are sent including the NAG product code, licence type, expiry date (if applicable), etc, and the long strings in quotes. Note that some keys, like the third example above consist of more than one line.
- Why is my licence rejected with "Format error in licence file"?
This may be because the last line in the file is not terminated by a carriage return. Please add a carriage return to the last line of your licence file or server control file. Kusari 2.2 fixes this problem.
- On Unix, why is my licence rejected with "No licence found for this product" even though the product appears correctly in the licence file?
This may be because you have saved the key in a DOS format file. Unix versions of Kusari cannot read this file format. If in doubt use the "dos2unix" command to convert the file to Unix format. Alternatively, use an editor like emacs to remove the "^M" characters. Kusari 2.2 fixes this problem.
- Can I have multiple keys in one file?
Yes, say you have node-locked and trial keys for different NAG products you can put one key per line into the licence file. Comments can be added with an exclamation mark in the first character position of the line and blank lines may be used to make the file easier to read. E.g.
! Licence file for NAG products. ! A full licence for the NAG Fortran Compiler, Release 6.1 NPABC61NA FULL "qfrdwhyMoQFkfpm5e6ESprJmtE" ! A trial licence for the NAG Fortran Compiler, Release 6.1 NPXYZ61NA TRIAL 2020/04/10 "EMnxidA3oeojOFlYvi5ibxPjB7" ! A licence for the NAG C Library on this machine, Mark 26: CLABC26NA NODE 2020/12/31 "xhhhTkzEiUPgdIpwIbCHgrBjjv" ! End
- Can I put a node-locked key in my server control file?
No. The licence server only handles FLOATING and SITE keys. No other type of licence should be put into the server control file.
- How do I specify more than one licence file and/or server?
Set the NAG_KUSARI_FILE environment variable to a comma separated list of files and servers. E.g, if you have your Fortran Library key in /etc/fl.licence and your NAG Fortran Compiler licences are on the server called myserver.
With Bourne shell -
NAG_KUSARI_FILE=/etc/fl.licence,myserver: export NAG_KUSARI_FILEWith bash -
export NAG_KUSARI_FILE=/etc/fl.licence,myserver:With csh or similar shells like tcsh -
setenv NAG_KUSARI_FILE /etc/fl.licence,myserver:For Microsoft Windows, please see Question 5 for how to do this and set the environment variable to, say, "C:\ETC\FL.LICENCE,myserver:"
- Why does the khostid change between consecutive runs?
The generation date and time is encoded into the host ID, hence khostid returns a different string with consecutive runs.
- How do I find the Kusari licence server's version number?
To obtain this information, execute the licence server with the '-V' option, for example: ./naglmd -V.
- Do I need to tell NAG if I'm running the licence server on a non-default port?
Yes. When you request a server key, we will assume the default port number 7733 is being used. If you use another port, the key is different.
- I have put my NAG Fortran key in the default place, but it's not found?
NAG Fortran allows you to put the licence key in a file called "nag.licence" in the compiler "lib" directory. If you do this you do not need to set the NAG_KUSARI_FILE environment variable. Please ensure that licence is spelt exactly as above (i.e. with two letters "c", and no "s"). NAG Fortran implementations licensed with Kusari 2.2 look for the file "nag.key" followed by the above names.
- My perpetual FLOATING or SITE key is rejected by the licence server with a syntax error logged and a "Cannot read licence file" error?
These perpetual licences need version 2.2 of naglmd which can be downloaded from here. See Q12 for how to check the version of naglmd.
- My trial or node-locked key does not work. What can I do to check what is wrong?
Under Unix (including Linux)
At a command prompt or shell window issue the following commands.
echo $NAG_KUSARI_FILE cat $NAG_KUSARI_FILE On Windows set NAG_KUSARI_FILE type "%NAG_KUSARI_FILE%"Ensure that the file name reported by the first command is correct and that the second command prints out the file that you created with the key. If not, go back to Question 3 or 4 and review what you've done.
Under Microsoft Windows (licence installed in a file)
The first thing to check is that you set the environment variable NAG_KUSARI_FILE correctly. One way to find out is to start a DOS command prompt window. You can get a command prompt window from the Windows Start Menu by choosing Programs/Accessories/Command Prompt. Once the command prompt is open, type this:
echo %NAG_KUSARI_FILE% type "%NAG_KUSARI_FILE%"If the environment variable is set correctly you should see the licence key or keys that you put into the file, for example:
FLABC264M TRIAL 2020/03/21 "5VnUdiR+burfp+nxUlxvkPxiMW"If it becomes clear that the file that you thought existed does not, it could be that the editor you used named the file something other than what you thought. For example, some editors will save your file as licence.lic.txt instead of licence.lic. If that is the case, you need to rename it.
You should also make sure that
- there is a newline character on the end of the last or only line in the file (some editors do not insert a newline by default)
- in the environment variable NAG_KUSARI_FILE, you do NOT put quotation marks around the name of the file. e.g. use C:\Program Files\... and not "C:\Program Files\..."
- What do I do when all else fails?
If after following the advice above your licence key still does not work, please contact NAG by email. Your message should contain the output of the commands described in the section above (i.e. the echo and cat or type commands and, if relevant, any messages from the licence server log) - this should help us to diagnose the problem.