4. Custom Standalone Build (Optional)

Compile your own standalone version of RESCU using the Matlab Compiler. This is only needed if you want a personalized build or to run RESCU without a Matlab installation (e.g., on systems without Matlab runtime or for distribution to others).

Note

You do not need to do this if you’re using the provided precompiled package. This option is for advanced users with specific deployment needs.

4.1. Installation

We assume that you have already downloaded, extracted, and installed RESCU using either the Single-Node Single-Node Setup or Cluster Cluster Installation setup, and that your src directory is available.

If you wish to compile RESCU into a standalone version, follow the step below:

  1. Build the Standalone Executable

    • While in the src directory, use the compileRESCU function in MATLAB’s command window to compile RESCU.

      matlab -r "compileRESCU('$HOME/rescu/src','$HOME/rescu/bin')"
      

    Note

    The compileRESCU function takes two arguments: the first specifies the path to the src directory (e.g., $HOME/rescu/src), while the second specifies the path to the bin directory where the compiled file will be stored (e.g., $HOME/rescu/bin).

  2. Add the License File

    Download the license.lic file from the Nanoacademic Portal.

    • On Linux, save it in:

      $HOME/.nanoacademic/RESCU

    • On Windows, place it in:

      C:\Users\<YourUsername>

    Warning

    If the license is placed in a different location, the user have to specify the RESCU_LICENSE_PATH variable.

  3. Matlab Compiler Runtime (MCR)

    Please download the appropriate MATLAB Compiler Runtime that matches the version of MATLAB used to compile RESCU.

    If you are unsure which version to download, refer to the official compatibility guide: Supported Compilers and Runtimes by MATLAB Release

    Once downloaded, follow the installation instructions included in the package. By default, the location of the MATLAB Runtime should be /usr/local/MATLAB/MATLAB_Runtime/vXX. Make sure to include the following paths in your environment variable $LD_LIBRARY_PATH, as follows:

    MCRROOT=/usr/local/MATLAB/MATLAB_Runtime/vXX
    export LD_LIBRARY_PATH=$MCRROOT/runtime/glnxa64:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$MCRROOT/bin/glnxa64:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$MCRROOT/sys/os/glnxa64:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=$MCRROOT/extern/bin/glnxa64:$LD_LIBRARY_PATH
    

    Note

    On a Windows machine, the MCR is usually installed at C:\Program Files\MATLAB\MATLAB Runtime\vXX. The MATLAB Runtime installer for Windows typically sets the library path automatically. If not, consult the Help Center for instructions on setting the PATH environment variable permanently.

  4. Verifying Installation

    Navigate to the folder where the RESCU binary is located, open a terminal (or Command Prompt on Windows), and run the program. If the installation is successful, you will see the following message:

    **********************************************************************
    Some on-line help information
    **********************************************************************
    For information about the command line flags, type
       "rescu --flag"
    For information about all input parameters (including command-line
       flags), type
       "rescu --parameter"
    To check the meaning of a given parameter, or search for a parameter
       whose name contains a given string, e.g., 'control', type
       "rescu --parameter ? atom"
    For information about all available atomic orbital basis, type
       "rescu --basis"
    
  5. Adding rescu binary to System PATH for Easy Access

    Please, follow this process to ensure that the rescu binary can be executed from anywhere in your system.

    • Linux: add the binary directory path ($HOME/rescu/bin) to the PATH variable. Open the shell configuration file (e.g. ~/.bashrc) in a text editor and add the line export PATH="$HOME/rescu/bin:$PATH"; save the file, then apply the changes by running source ~/.bashrc. Finally, verify by typing rescu to check if the command is recognized.

    • Windows: navigate to “Edit environment variables of your account” from the Start menu and click “Environment Variables.” Under “System Variables,” find and edit the Path variable. Add the full directory path to rescu/bin (e.g., C:\Users\<YourUsername>\rescu\bin) by clicking “Edit.” Save the changes, restart your Command Prompt and type rescu to verify if the command is recognized

4.2. Test Examples

Navigate to the examples directory inside the extracted folder of RESCU and run the code with one of the avaiable input files, for example:

rescu -i si_lcao_scf.input

The results from the test calculation should appears in the prompt if your package is adequately configured.

4.3. TroubleShooting

Here are some common errors that you may encounter while running the calculation:

20 - expired license

60 - Activation limit reached (installed the license on too many computers)

146 - license not found

48 - Network issues

If you encounter any of these issues, please make sure that the license path specified in the scripts corresponds to a valid license. Expiration dates or Activation limit can cause these errors. Network connectivity may also be a reason for failure.