IBM Support

Porting Rhapsody generated code from Windows to Linux

Question & Answer


Question

How to generate code on windows and port it to Linux?

Answer

During installation if you have selected Linux support for OS, then Linuxshare.tar is created in the Share\LangCpp directory.

1. Copy linuxshare.tar from <Rhapsody Installation>\Share\LangCpp to the target Linux machine and untar it

2. Modify linuxbuild.mak file to point to Share/LangCpp directories from the current Linux installation.

3. Build the libraries for linux using the following command:


    gmake -f linuxbuild.mak

    The following libraries will be created in Share/LangCpp/lib:

    linuxaomanim.a, linuxaomtrace.a, linuxomcoappl.a, linuxoxf.a, linuxoxfinst.a, linuxtomtrace.a


4. Generate code for Linux environment from Windows:

a. Open Rhapsody project in Windows Installation

b. Set the Environment to Linux

<Active Component>-><Active Configuration>-->Features-->Settings-->Environment

Select Linux

c. Generate the code

5. Modify the OMROOT path in <Active Component>.mak file to confide with Linux installation


    a. Browse to the directory containing the generated code

    Code Generation Directory can be identified using : Right click on the projectEdit Unit Path contains the where you have generated the code

    b. Open the make file generated (<Active Component>.mak) in the <Active Component> directory

    c. change OMROOT to the path where ever it confides with your linux installation.

    Ex: /root/usr/Rhapsody/Share/


6. Copy the entire generated code containing the modified files to a folder on Linux Machine

7. Create the executable using the following command

gmake -f <Active Component>.mak

Potential issues:

1. Compiler errors on include paths


    Fix:

    Edit the generated make file to have the paths to :


    \root\LangCPP\Share\LangCpp\oxf

    \root\LangCPP\Share\LangCpp

    \root\LangCPP\Share\


2. Linker error or gmake: *** [Filename.o] Error 1 [root@localhost Installeddir]#


    Fix:

    This error could be a result of upgrading a model which uses reusable

    statechart implementation and a customized

    CPP_CG.Microsoft.MakefileContent property.

    To resolve the problem, edit the MakefileContent property and modify the ConfigurationCPPCompileSwitches assignment from:

    ConfigurationCPPCompileSwitches=$OMConfigurationCPPCompileSwitches

    to:

    ConfigurationCPPCompileSwitches=$OMReusableStatechartSwitches

    $OMConfigurationCPPCompileSwitches

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21393384