Rhapsody Simulink Integration
Currently, we are in the process of integrating Simulink with Rhapsody to facilitate Model-Based Development (MBD) in our projects. As part of this effort, I have been working on importing Simulink models into Rhapsody to ensure seamless integration between the two tools.
However, I have encountered some challenges along the way that I am unable to resolve independently. Initially, I encountered an issue related to 'No rule to make target,' which I managed to address temporarily by manually modifying the .mak file. Despite this workaround, I am now facing a different issue that is preventing me from proceeding further with the integration process.
The specific error message I am encountering is as follows:
Building ------------ DefaultComponent.exe ------------
Executing: ""C:\Program Files\IBM\Rhapsody\9.0.1\Share"\etc\cygwinmake.bat DefaultComponent.mak build "CPU=x64" "
"Setting environment for Cygwin x64"
"make.exe all -f DefaultComponent.mak "CPU=x64" "
Linking DefaultComponent.exe
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::SL_Gain(IOxfActive*)':
/cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:100:(.text+0x2fb): undefined reference to `OMSimulinkBlock::OMSimulinkBlock(IOxfActive*)'
/cygdrive/c/Cygwin/bin/ld: /cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:106:(.text+0x548): undefined reference to `OMSimulinkBlock::~OMSimulinkBlock()'
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::~SL_Gain()':
/cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:111:(.text+0x670): undefined reference to `OMSimulinkBlock::~OMSimulinkBlock()'
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::startBehavior()':
/cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:172:(.text+0xa6c): undefined reference to `OMSimulinkBlock::startBehavior()'
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0x30): undefined reference to `OMSimulinkBlock::cancelTimeout(IOxfTimeout const*)'
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0xb0): undefined reference to `OMSimulinkBlock::rootState_entDef()'
/cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0xb8): undefined reference to `OMSimulinkBlock::rootState_processEvent()'
collect2: error: ld returned 1 exit status
make: *** [DefaultComponent.mak:198: DefaultComponent.exe] Error 1.
I have thoroughly reviewed my project setup and configurations but have been unable to pinpoint the source of the issue. Any advice or assistance you can provide would be immensely valuable to our project.
Rhapsody Version details:
IBM Engineering Systems Design Rhapsody® 9.0.1
Build No. 9.0.1.R00_202301021733 64bit SR1 iFix004
Simulink version details:
<o:p> </o:p> |
12 answers
Can you try this . Open C:\Program Files\IBM\Rhapsody\9.0.2\Share\LangCpp\mingwbuild.mak file and do the below modification .
1:Add this line at the end:
simulinklib : @if not exist "$(DOSDIR)$(PATH_SEP)LangCpp$(PATH_SEP)SimulinkIntegration" mkdir "$(DOSDIR)$(PATH_SEP)LangCpp$(PATH_SEP)SimulinkIntegration" $(MAKE) -C SimulinkIntegration -f mingwSimulinkIntegration.mak CFG=SimulinkIntegration
2: Add this at line number 22: simulinklib
3: Add this under RemoveObjs
@if exist "$(DOSDIR)$(PATH_SEP)LangCpp$(PATH_SEP)SimulinkIntegration" erase /F /Q /S "$(DOSDIR)$(PATH_SEP)LangCpp$(PATH_SEP)SimulinkIntegration"*.o >nul 2>&1
Change the below property : CPP_CG::MinGW::MakeFileContent
SHELL=cmd ############# Target type (Debug/Release) ################## ############################################################ CPPCompileDebug=$OMCPPCompileDebug CPPCompileRelease=$OMCPPCompileRelease LinkDebug=$OMLinkDebug LinkRelease=$OMLinkRelease CleanupFlagForSimulink= SIMULINK_CONFIG=$SimulinkConfig ifeq ($(SIMULINK_CONFIG),True) CleanupFlagForSimulink=-DOM_WITH_CLEANUP endif ConfigurationCPPCompileSwitches=$OMReusableStatechartSwitches $OMConfigurationCPPCompileSwitches $OMSDLCompileSwitches $(CleanupFlagForSimulink) ######################################### ###### Predefined macros ################ INCLUDE_QUALIFIER=-I DEFINE_QUALIFIER=-D CC=g++ LIB_CMD=ar LINK_CMD=$LinkCommand LIB_FLAGS=rvu LINK_FLAGS= $OMConfigurationLinkSwitches ######################################### ####### Context macros ################## $OMContextMacros ######################################### ####### Predefined macros ############### $(OBJS) : $(INST_LIBS) $(OXF_LIBS) ifeq ($(INSTRUMENTATION),Animation) INST_FLAGS=$AnimPreprocessor INST_INCLUDES=$AnimIncludeDirectories INST_LIBS=$AnimInstLibs OXF_LIBS=$AnimOxfLibs SOCK_LIB=$SockLib else ifeq ($(INSTRUMENTATION),Tracing) INST_FLAGS=$TracePreprocessor INST_INCLUDES=$TraceIncludeDirectories INST_LIBS=$TraceInstLibs OXF_LIBS=$TraceOxfLibs SOCK_LIB=$SockLib else ifeq ($(INSTRUMENTATION),None) INST_FLAGS=$NonePreprocessor INST_INCLUDES=$NoneIncludeDirectories INST_LIBS=$NoneInstLibs OXF_LIBS=$NoneOxfLibs SOCK_LIB=$SockLib else @echo An invalid Instrumentation $(INSTRUMENTATION) is specified. exit endif endif endif .SUFFIXES: $(CPP_EXT) ##################################################################### ##################### Context dependencies and commands ############# $OMContextDependencies $(TARGET_MAIN)$(OBJ_EXT) : $(TARGET_MAIN)$(CPP_EXT) $(OBJS) @echo Compiling $(TARGET_MAIN)$(CPP_EXT) @$(CC) $(ConfigurationCPPCompileSwitches) -o $(TARGET_MAIN)$(OBJ_EXT) $(TARGET_MAIN)$(CPP_EXT) #################################################################### ############## Predefined Instructions ############################# $(TARGET_NAME)$(EXE_EXT): $(OBJS) $(ADDITIONAL_OBJS) $(TARGET_MAIN)$(OBJ_EXT) $OMMakefileName @echo Linking $(TARGET_NAME)$(EXE_EXT) @$(LINK_CMD) $(TARGET_MAIN)$(OBJ_EXT) $(OBJS) $(ADDITIONAL_OBJS) \ $(LIBS) \ $(OXF_LIBS) \ $(INST_LIBS) \ $(OXF_LIBS) \ $(INST_LIBS) \ $(SOCK_LIB) \ $(LINK_FLAGS) -o $(TARGET_NAME)$(EXE_EXT) $(TARGET_NAME)$(LIB_EXT) : $(OBJS) $(ADDITIONAL_OBJS) $OMMakefileName @echo Building library $@ @$(LIB_CMD) $(LIB_FLAGS) $(TARGET_NAME)$(LIB_EXT) $(OBJS) $(ADDITIONAL_OBJS) clean: @echo Cleanup $OMCleanOBJS if exist $(TARGET_MAIN)$(OBJ_EXT) erase $(TARGET_MAIN)$(OBJ_EXT) if exist $(TARGET_NAME)$(LIB_EXT) erase $(TARGET_NAME)$(LIB_EXT) if exist $(TARGET_NAME)$(EXE_EXT) erase $(TARGET_NAME)$(EXE_EXT) With this changes please do a build framework.
|
Hello Arta,
Thank you for your response. I have tried the modifications above, but it didn't work. I am still encountering the same error.
Comments Consider to open a case with support. Another thing to mention: Although Microsoft forced the default install folder always to Program Files, in my experience it is a really bad idea in a lot of cases, especially development.
babu p
commented Mar 13, 1:39 a.m.
This also I tried but getting same error. |
Hi Babu ,Could you please try the below with the changes you made last:Right click on the configuration and check for the below properties:CPP_CG::MinGW::AnimInstLibsCPP_CG::MinGW::AnimOxfLibsCPP_CG::MinGW::NoneInstLibsCPP_CG::MinGW::NoneOxfLibsCPP_CG::MinGW::TraceInstLibsCPP_CG::MinGW::TraceOxfLibsFor all these properties ,add $(SimulinkLibName) at the end.In CPP_CG::MinGW::MakeFileContent add the below in the value.LinkDebug=$OMLinkDebugLinkRelease=$OMLinkReleaseSimulinkLibName=$SimulinkLibNameCleanupFlagForSimulink=SIMULINK_CONFIG=$SimulinkConfigifeq ($(SIMULINK_CONFIG),True)CleanupFlagForSimulink=-DOM_WITH_CLEANUPendifConfigurationCPPCompileSwitches=$OMReusableStatechartSwitches $OMConfigurationCPPCompileSwitches $OMSDLCompileSwitches $(CleanupFlagForSimulink)Do a code->build framework Comments
babu p
commented Mar 13, 1:37 a.m.
Hi Arta ,
I am getting below errors now.
"........
Code Generation Done
0 Error(s), 0 Warning(s), 0 Message(s)
Building ------------ DefaultComponent.exe ------------
Executing: ""C:\Program Files\IBM\Rhapsody\9.0.1\Share"\etc\MinGWmake.bat DefaultComponent.mak build x64 "
Setting environment for MinGW x64
mingw32-make.exe all -f DefaultComponent.mak CPU=x64
Compiling BuildSys.cpp
g++: warning: SIMULINK_CONFIG=False: linker input file unused because linking not done
g++: error: SIMULINK_CONFIG=False: linker input file not found: No such file or directory
mingw32-make: *** [DefaultComponent.mak:140: BuildSys.o] Error 1
Build Done"
|
Before generating the code . Could you please do
Code->Build Framework .
Once it is completed then to generate and build .
Comments
babu p
commented Mar 13, 11:22 a.m.
Executing: ""C:\Rhap_SW\901\Share"\etc\mingwmake.bat mingwbuild.mak buildLibs x64 "C:\Rhap_SW\901\UserShare" "BUILD_SET=Debug" "
Setting environment for MinGW x64
mingw32-make PATH_SEP=/ DEFAULT_CPP_FLAGS="-g -DOM_NO_RCS_ID" CPU=x64 OBJDIR="C\:\Rhap_SW\901\UserShare" DOSDIR="C:\Rhap_SW\901\UserShare" all -C SimulinkIntegration -f mingwSimulinkIntegration.mak CFG=SimulinkIntegration
mingw32-make[1]: Entering directory 'C:/Rhap_SW/901/Share/LangCpp/SimulinkIntegration'
mingw32-make[1]: Leaving directory 'C:/Rhap_SW/901/Share/LangCpp/SimulinkIntegration'
mingw32-make[1]: *** No rule to make target 'C\:\Rhap_SW\901\UserShare/LangCpp/lib/mingwSimulinkIntegrationx64.a', needed by 'all'. Stop.
mingwbuild.mak:76: recipe for target 'simulinklib' failed
mingw32-make: *** [simulinklib] Error 2
Build Done
babu p
commented Mar 13, 11:23 a.m.
I am getting above error when I build framework. |
Hi Babu ,
Could you please check if you have
C\:\Rhap_SW\901\UserShare/LangCpp/lib/mingwSimulinkIntegrationx64.a this file present with you .
If this is not there , then the there is some problem in the settings.
Try review the mingwbuild.mak file again as per my last post and check all the changes. .
Please consider creating a case beyond this . We can connect and work on this .
|
Hi Babu ,
Could you please check if you have
C\:\Rhap_SW\901\UserShare/LangCpp/lib/mingwSimulinkIntegrationx64.a this file present with you .
If this is not there , then the there is some problem in the settings.
Try review the mingwbuild.mak file again as per my last post and check all the changes. .
Please consider creating a case beyond this . We can connect and work on this .
|
HI Babu ,
I think this is happening due to the path mismatch .
Your compiler is searching for
C\:\Rhap_SW\901\UserShare/LangCpp/lib/mingwSimulinkIntegrationx64.a but this is not created .
This could happen because of case sensitive.
Try this .
Open mingwSimulinkIntegration.mak file from installation folder
Exp: C:\Program Files\IBM\Rhapsody\9.0.2\Share\LangCpp\SimulinkIntegration\mingwSimulinkIntegration.mak
then check for the line number 33 and 55 .
You will see "simulinkIntegration" but Your compiler is searching for SimulinkIntegration
So change simulinkIntegration to SimulinkIntegration.
This might be due to the compiler also .
You can try downloading the MIngw from the below link
Extract in C:/MinGW : This is not case sensitive.
|
Hi Arta,
Yes, C\:\Rhap_SW\901\UserShare/LangCpp/lib/mingwSimulinkIntegrationx64.a is not created .
I changed simulinkIntegration to SimulinkIntegration.
now I am able to build frame work. and now I am getting below error
Building ------------ DefaultComponent.exe ------------
Executing: ""C:\Program Files\IBM\Rhapsody\9.0.1\Share"\etc\MinGWmake.bat DefaultComponent.mak build x64 "
Setting environment for MinGW x64
mingw32-make.exe all -f DefaultComponent.mak CPU=x64
Compiling BuildSys.cpp
g++: warning: SIMULINK_CONFIG=False: linker input file unused because linking not done
g++: error: SIMULINK_CONFIG=False: linker input file not found: No such file or directory
mingw32-make: *** [DefaultComponent.mak:140: BuildSys.o] Error 1
Build Done"
I got one response from IBM community forum and that solution is working for me with Cygwin compiler.
But I want to clear this with MingW compiler as well. If you are Ok to connect to clear, I will be happy to schedule discussion.
Thanks a lot for your support.
|
Now we have all library needed for simulink project .
This problem could be one issue with your MINGW compiler path .
Try this .
Add the below bold line to your MinGWmake.bat .
@echo off
@rem ************ @rem Licensed Materials - Property of IBM @rem (c) Copyright IBM Corporation 2008, 2019. All Rights Reserved. @rem Note to U.S. Government Users Restricted Rights: @rem Use, duplication or disclosure restricted by GSA ADP Schedule @rem Contract with IBM Corp. @rem *********** set LANG=en_US if "%3"=="x64" set MINGW_ROOT=%MINGW_HOME%\mingw64 if "%3"=="x86" set MINGW_ROOT=%MINGW_HOME%\mingw32if "%3"=="x64" set MINGW_INCLUDE=x86_64-w64-mingw32 if "%3"=="x86" set MINGW_INCLUDE=i686-w64-mingw32
This should work otherwise share me the MinGWmake.bat file .
|
@echo off
set LANG=en_US
set MINGW_ROOT=C:\MinGW\
if "%3"=="x64" set MINGW_ROOT=%MINGW_HOME%\mingw64
if "%3"=="x86" set MINGW_ROOT=%MINGW_HOME%\mingw32
if "%3"=="x64" set MINGW_INCLUDE=x86_64-w64-mingw32
if "%3"=="x86" set MINGW_INCLUDE=i686-w64-mingw32
set PATH=%MINGW_ROOT%\bin;%MINGW_ROOT%\%MINGW_INCLUDE%\include;C:\WINDOWS\system32;%PATH%
set target=all
if "%2"=="" set target=all
if "%2"=="build" set target=all
if "%2"=="rebuild" set target=clean all
if "%2"=="clean" set target=clean
echo Setting environment for MinGW %3
if "%2"=="buildLibs" goto buildLibs
echo mingw32-make.exe %target% -f %1 CPU=%3 %4 %5 %6 %7 %8 %9
mingw32-make -s %target% -f %1 CPU=%3 %4 %5 %6 %7 %8 %9
EXIT /B %ERRORLEVEL%
:buildLibs
set FF=%4
set FRMDIR=%FF: =\ %
set FRMDIR=%FRMDIR::=\:%
mingw32-make %target% -f %1 CPU=%3 OBJDIR=%FRMDIR% DOSDIR=%4 SHELL=cmd %5 %6 %7 %8 %9
EXIT /B %ERRORLEVEL%
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.