Kusari Licence Management FAQ
Questions
  1. Do I need to run a licence server for my Kusari key? [answer]
  2. How do I install a key on Windows? [answer]
  3. How do I create my licence file? [answer]
  4. How do you set the NAG_KUSARI_FILE environment variable on Unix? [answer]
  5. How do you set the NAG_KUSARI_FILE environment variable on Microsoft Windows? [answer]
  6. Which part of the key should I paste into my licence file? [answer]
  7. Why is my licence rejected with "Format error in licence file"? [answer]
  8. 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]
  9. Can I have multiple keys in one file? [answer]
  10. Can I put a node-locked key in my server control file? [answer]
  11. How do I specify more than one licence file and/or server? [answer]
  12. Why does the khostid change between consecutive runs? [answer]
  13. How do I find the Kusari licence server's version number? [answer]
  14. Do I need to tell NAG if I'm running the licence server on a non-default port? [answer]
  15. I have put my NAG Fortran key in the default place, but it's not found? [answer]
  16. 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]
  17. My trial or node-locked key does not work. What can I do to check what is wrong? [answer]
  18. What do I do when all else fails? [answer]
Answers
1

Q. Do I need to run a licence server for my Kusari key?

A. 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.

2

Q. How do I install a key on Windows?

A. 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.
 

3

Q. How do I create my licence file?

A. 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
4

Q. How do you set the NAG_KUSARI_FILE environment variable on Unix?

A. If you have your Fortran Library key in /etc/fl.licence.

With Bourne shell -

  NAG_KUSARI_FILE=/etc/fl.licence
  export NAG_KUSARI_FILE

With bash -

  export NAG_KUSARI_FILE=/etc/fl.licence

With csh or similar shells like tcsh -

  setenv NAG_KUSARI_FILE /etc/fl.licence

You 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.
 

5

Q. How do you set the NAG_KUSARI_FILE environment variable on Microsoft Windows?

A. 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 button

Under 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.
 

6

Q. Which part of the key should I paste into my licence file?

A. Here are three typical examples of licence keys.

NPW3271NA NODE 2020/12/31 "l5jaTklTpIjckYA61dQ7on=hj5"

NPL6A71NA FULL "tehwmfuznCPfp3ggjb4xjqtdXg" "bDhQtaXeoCcaazoUkaYNiNybIh"

NLL6I29XB 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.
 

7

Q. Why is my licence rejected with "Format error in licence file"?

A. 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.
 

8

Q. On Unix, why is my licence rejected with "No licence found for this product" even though the product appears correctly in the licence file?

A. 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.
 

9

Q. Can I have multiple keys in one file?

A. 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 7.1
NPW3271NA FULL "qfrdwhyMoQFkfpm5e6ESprJmtE"

! A trial licence for the NAG Fortran Compiler, Release 7.1
NPL6A71NA TRIAL 2023/07/30 "EMnxidA3oeojOFlYvi5ibxPjB7"

! A licence for the NAG Library on this machine, Mark 29:
NLL6I29XB NODE 2024/12/31 "xhhhTkzEiUPgdIpwIbCHgrBjjv"
! End
10

Q. Can I put a node-locked key in my server control file?

A. No. The licence server only handles FLOATING and SITE keys. No other type of licence should be put into the server control fil

11

Q. How do I specify more than one licence file and/or server?

A. 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_FILE

With 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:"
 

12

Q. Why does the khostid change between consecutive runs?

A. The generation date and time is encoded into the host ID, hence khostid returns a different string with consecutive runs.
 

13

Q. How do I find the Kusari licence server's version number?

A. To obtain this information, execute the licence server with the '-V' option, for example: ./naglmd -V.
 

14

Q. Do I need to tell NAG if I'm running the licence server on a non-default port?

A. 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.
 

15

Q. I have put my NAG Fortran key in the default place, but it's not found?

A. 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.
 

16

Q. My perpetual FLOATING or SITE key is rejected by the licence server with a syntax error logged and a "Cannot read licence file" error?

A. 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.

17

Q. My trial or node-locked key does not work. What can I do to check what is wrong?

A. 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:

NLW6I29XE TRIAL 2023/07/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 Sometimes it is easier to use a file name without spaces. If you have trouble with C:\Program Files\licence.lic, try using just C:\licence.lic instead.
 

  • 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\..."
     
18

Q. What do I do when all else fails?

A. 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.