How to allow builds to utilize cl.exe /MP switch in Rhapsody - for multi-processor support

Technote (troubleshooting)


Problem(Abstract)

This technote provides instructions for creating a makefile through IBM Rational Rhapsody to take advantage of a system's multiple processors with Microsoft Visual Studio (cl.exe)

Symptom

By default, the makefiles generated by Rhapsody utilize only one compiler process. This does not take advantage of multi-core machines, which could allow builds to proceed faster.


Cause

By default, the makefiles generated by Rhapsody send each object to be built one by one to the compiler:


cl file1.cpp

cl file2.cpp

and so on, instead of calling the compiler once on all the files


cl file1.cpp file2.cpp ...

Calling the compiler once for all files would allow the /MP switch to be utilized to take advantage of multiple processors


Diagnosing the problem

Only one cl.exe process is seen in the Task Manager during builds

Resolving the problem

Rename the target in the msvc9make.bat (or msmake.bat) file to something different, like 'myAll'. The myAll will be used by the compiler and the 'all' at the end of the line will be used by the linker

if "%2"=="" set target=myAll all

if "%2"=="build" set target=myAll all

if "%2"=="rebuild" set target=clean myAll all

if "%2"=="clean" set target=clean

Then modify the MakeFileContent property for your component (CPP_CG::MSVC9::MakeFileContent) to add a new section after the "Generated macros" section:

######################## New Section ########################

##############################################################

myAll : $(OBJS)

.cpp.obj::

 cl $(ConfigurationCPPCompileSwitches) -Fd\ -c $<


Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Rhapsody
Rational Rhapsody Developer

Software version:

7.5, 7.5.0.1, 7.5.1, 7.5.1.1, 7.5.2, 7.5.2.1, 7.5.3

Operating system(s):

Windows

Reference #:

1469621

Modified date:

2012-11-15

Translate my page

Machine Translation

Content navigation