Skip to content

Instantly share code, notes, and snippets.

@volks73
Last active May 8, 2019 16:01
Show Gist options
  • Save volks73/ef89a3caf020d89fc2ca89b053953c6d to your computer and use it in GitHub Desktop.
Save volks73/ef89a3caf020d89fc2ca89b053953c6d to your computer and use it in GitHub Desktop.
Deprecated procedure for building libssh2lv using NI Eclipse

Cross-Compiling libssh2lv with NI Eclipse (Deprecated)

This procedure does not actually yield a viable shared object. It is provided here only as a reference.

NI provides a cross-compiler for their Real-Time (RT) Linux distribution. Before proceeding, download and install the C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition 2017. It is also best to review the Getting Stared with C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition guide for more general information about configuring the internal builder.

  1. Start NI Eclipse. A Workspace Launcher dialog may appear. Use the default.
  2. A welcome screen may appear after the application has loaded. Close the welcome screen.
  3. Right-click in the Project Explorer on the left and select Import from the context menu that appears. A new dialog will appear.
  4. Select Git->Projects from Git from the dialog that appears. Click the Next > button. A new page will appear.
  5. Select the Clone URI from the list that appears in the new page of the dialog. Click the Next > button. A new page will appear.
  6. Enter the URI for the lv-libssh2-c git repository in the URI: field, i.e. https://github.com/fieldrndservices/lv-libssh2-c.git. The Host: and Repository path: fields will populate automatically. Click the Next > button. A new page will appear.
  7. Ensure only the master checkbox is checked in the Branch Selection page of the Import Projects from Git dialog. Click the Next > button. A new page will appear.
  8. Browse to the workspace directory for NI Eclipse to populate the Directory: field. Leave all other fields as the defaults. Click the Next > button. A new page will appear.
  9. Select the Import existing projects radio button from the options under the Wizard for project import section. Click the Next > button. A new page will appear.
  10. Click the Finish button. No changes are needed on the Import Projects page. A new lv-libssh2-c project should appear in the Project Explorer.
  11. Right-click in the Project Explorer on the left and select Import from the context menu that appears. A new dialog will appear.
  12. Select Git->Projects from Git from the dialog that appears. Click the Next > button. A new page will appear.
  13. Select the Clone URI from the list that appears in the new page of the dialog. Click the Next > button. A new page will appear.
  14. Enter the URI for the libssh2 git repository in the URI: field, i.e. https://github.com/libssh2/libssh2.git. The Host: and Repository path: fields will populate automatically. Click the Next > button. A new page will appear.
  15. Ensure only the master checkbox is checked in the Branch Selection page of the Import Projects from Git dialog. Click the Next > button. A new page will appear.
  16. Browse to the workspace directory for NI Eclipse to populate the Directory: field. Leave all other fields as the default. Click the Next > button. A new page will appear.
  17. Select the Use the New Project wizard radio button from the options under the Wizard for project import section. Click the Finish button. A new dialog will appear.
  18. Select C Project from the Wizards section in the dialog. Click the Next > button. A new page will appear.
  19. Enter libssh2 for the Project name:. Optionally, uncheck the Use default location checkbox and a path for the Location field. The default location should be NI Eclipse's workspace. Click the Next > button. A new page will appear.
  20. Click the Next > button. Do not change any of the defaults. A new page will appear.
  21. Click the Finish button. All dialogs will disappear and the libssh2 project should appear in the Project Explorer along with the lv-libssh2-c project.
  22. Click on the libssh2 project in the Project Explorer.
  23. Right-click on the libssh2 project and select Team->Switch To->Other. A new dialog will appear.
  24. Expand the Tags item in the tree that appears in the dialog.
  25. Highlight the libssh2-1.8.2 item and click the Checkout button. An information dialog will appear. Click the OK button. This ensures the correct version of the libssh2 dependency is used to build the lv-libssh2-c project.
  26. Click on the lv-libssh2-c project in the _Project Explorer.
  27. Click the Build toolbar button (icon is a small hammer) to build the NI Linux RT x86_64-based shared object (so).
  28. Click the drop-down menu next to the Build toolbar button and select the ARM build configuration. This will build the NI Linux RT ARM-based shared object (so).

Note, steps 3-25 only need to be done once to setup the project. A libssh2lv.so will be located in the x86_64 folder under the project's root folder inside the Eclipse workspace folder, and a similar libssh2lv.so for the ARM architecture will be located in the ARM folder under the project's root folder inside the Eclipse workspace folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment