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:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.