Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02085 // Views: 1 // Created: 2022-08-09 09:56:53 // Last Updated: 2022-08-09 10:01:43
Problem & Solution
HYPERSIM - Code Generation not Working Catastrophic Error: Cannot Open Source File "rpc/rpc.h"

Problem:

When trying to compile any model on a target, it gives the following error:


 

Error during generated code compilation.Cause:

[...]

/export/local/ssr/hypersim-target_2022.1.0.o268/linux-oprtlinux3-64/HyServer/include/ompconst.h(37): catastrophic error: cannot open source file "rpc/rpc.h"
  #    include <rpc/rpc.h>
                          ^
compilation aborted for <Name of Model>.c (code 4)


Furthermore, the model runs fine on localhost.

The target has an OPAL-RTLinux3 operating system.


Solution:

With the OPAL-RTLinux3 operating system, an extra C-flag command is required in the Target Manager.

To confirm that the C-flag is missing, simply check the log of the code generation (before the error message) and check if the -I/usr/include/tirpc is included in the code generation command.



If it is not present, then:

1- go to the Target Manager> the target > Advanced tab.

2- Press the 'Default' button. It should make the line '-I/usr/include/tirpc' appear in the C Flags.





If the Default button does not do anything, please try to delete the target and add it again or to write the line manually.


3- Go to Settings and change the code directory to something new. Save the model and close HYPERSIM completely.

 4- Reopen HYPERSIM and try again. It should work now.



If it does not work, verify that the file 'rpc.h' is present in the folder  /usr/include/tirpc/rpc on the target, by using MobaXterm.



If the file is not present, try to reinstall HYPERSIM on the target.