Software Archive
Read-only legacy content
17061 Discussions

Integration of Open Watcom C++ compiler - details, performance evaluation, etc

SergeyKostrov
Valued Contributor II
3,605 Views
*** Integration of Open Watcom C++ compiler - details, performance evaluation, etc *** Welcome Back, Open Watcom C++ compiler! At the end of 2015 a decision was made to integrate Open Watcom C++ compiler v1.9 with a project I've been working on since 2009. I used Watcom C++ compiler in the middle of 90th ( last century! ) and I know how superior it is when it comes to optimization of C and C++ codes. Honestly, I was concerned about timing of the integration, that is end of the year, Christmas almost "knocks" to the door ( just two weeks before December 24th ), however a significant portion of the integration was completed in about 6 hours and I managed to compile C/C++ sources and executed some test-cases. Even if the work is still in progress on stabilizing codes and solving some little technical problems I could say that The Legendary Watcom C++ compiler is Not at the top of a list of the Modern optimizing C/C++ compilers. First of all, because version 1.9 is 32-bit only and does Not fully support, or does Not support At All, some Hot-Modern technologies. There is No support of SSE 2.x, SSE 4.x, AVX, AVX2, FMA instructions, OpenMP, Intel intrinsic functions, etc. But, don't be too frustrated because Open Watcom C++ compiler team is working, this is an Open Source Project now, and I hope that a new version of Open Watcom C++ compiler will be released in the future. I will follow up with more technical details and performance evaluation numbers on a set of scientific algorithms later. I will demonstrate how good Open Watcom C++ compiler is compared to Borland, MinGW, Microsoft, Intel and Turbo C++ compilers.
0 Kudos
90 Replies
zalia64
New Contributor I
1,586 Views

I wait with anticipation: Have free-thinkers with innovation any chance against a MegaBuck giant?

0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Legacy of Watcom C++ compiler ] I used a couple of versions of Watcom C++ compiler released between 1994 and 1998 in order to compile server-side NLM-modules for a Novel Netware v3.x network operating system when working as a Software Engineer on a financial project. NLM stands for a Netware Loadable Module and NLMs are very similar to DLLs in Windows however they different when it comes to NLM's run-time management. In other words, NLMs could be easily loaded and unloaded using a server-side command line interface of a Novell Netware. Take into account that All next posts are related to version 1.9 of Open Watcom C++ compiler. Also, in all the rest posts I'd like use term Watcom C++ compiler, or WCC, instead of Open Watcom C++ v1.9 compiler.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler installation ] No Any problems detected on Windows 2000 SP5, Windows XP SP3 and Windows 7 SP1 operating systems. I didn't try to install Watcom C++ compiler v1.9 on any Microsoft Windows operating systems released after Windows 7.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Integration of Watcom C++ compiler with Microsoft Visual Studio ( VS ) IDEs ] Easily integrated by creating a Makefile project in VS 2005 Professional Edition ( PE ) first, using some standard template, and then converting one to a next version of VS. That is, always one step up, for example: 2005 -> 2008 -> 2010 -> 2012 and never like: 2005 -> 2008, 2005 -> 2010, 2005 -> 2012 In overall, in current software development environment WCC was integrated with the following Microsoft Visual Studios: 2005 Professional Edition ( PE ) 2008 Professional Edition ( PE ) 2008 Express Edition ( EE ) 2010 Express Edition ( EE ) 2012 Express Edition ( EE ) That procedure was a very time consuming since some additional work was needed to delete all Mobile, Windows CE and 64-bit Configurations from VS 2005/2008 PE solution/project files before converting to VS 2008/2010 EE. In VS 2012 EE all 64-bit Configurations were re-created in order to provide support for a future 64-bit version of Watcom C++ compiler.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler Help ] There are eleven Microsoft Windows help files and they could be used to get some answers if something is unclear. Here is a list of Watcom C++ compiler help files: C Language Reference C Library Reference C++ Library Reference IDE Help Linker Guide Profiler Help Programmer's Guide Resource Compiler Help Source Browser Help Tools Guide User's Guide
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler sources of C Run-Time ( CRT ) functions ] Source codes of all CRT functions are provided and this is an invaluable source of information on how Watcom Software Engineers designed and implemented these functions more then 20 years ago. One of the most interesting things that I found in Watcom C++ compiler headers is a concept of using a prefix '__builtin_' for some CRT functions, like: [ malloc.h ] ... extern void * __builtin_alloca( _w_size_t __size ); ... It means that designers of GNU C++ compiler can Not claim that they "invented" it.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler C and C++ Examples ] There are Lots of examples for many operating systems, like MS-DOS, OS/2, Windows v3.x 16-bit, Windows 32-bit, etc.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Startup message and some generic information ] Open Watcom C/C++32 Compile and Link Utility Version 1.9 Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved. Source code is available under the Sybase Open Watcom Public License. See http://www.openwatcom.org/ for details. Usage: wcl386 [options] file(s) Options: ( /option is also accepted ) -c compile only, no link -cc treat source files as C code -cc++ treat source files as C++ code -y ignore the WCL386 environment variable
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Processor options ] -3r 386 register calling conventions -5r Pentium register calling conv. -3s 386 stack calling conventions -5s Pentium stack calling conventions -4r 486 register calling conventions -6r Pentium Pro register call conven. -4s 486 stack calling conventions -6s Pentium Pro stack call conven.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Floating-point processor options ] -fpc calls to floating-point library -fp2 generate 287 floating-point code -fpd enable Pentium FDIV check -fp3 generate 387 floating-point code -fpi inline 80x87 with emulation -fp5 optimize f-p for Pentium -fpi87 inline 80x87 -fp6 optimize f-p for Pentium Pro -fpr use old floating-point conventions
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Compiler options ] -bcl= compile and link for OS. -nm= set module name -bt= compile for target OS. -nt= set text segment name -db generate browsing information -q operate quietly -e= set error limit number -r save/restore segregs across calls -ecc set calling conv. to __cdecl -ri promote function args/rets to int -ecd set calling conv. to __stdcall -s remove stack overflow checks -ecf set calling conv. to __fastcall -sg generate calls to grow the stack -ecp set calling conv. to __pascal -st touch stack through SS first -ecr set calling conv. to __fortran -v output func declarations to .def -ecs set calling conv. to __syscall -vcap VC++ compat: alloca in arg lists -ecw set calling conv. to __watcall -w= set warning level number -ee call epilogue hook routine -wcd= disable warning message -ef full paths in messages -wce= enable warning message -ei force enums to be type int -we treat all warnings as errors -em minimum base type for enum is int -wx set warning level to max -en emit routine names in the code -xr (C++) enable RTTI -ep[=] call prologue hook routine -z{a,e} disable/enable extensions -eq do not display error messages -zc place strings in CODE segment -et P5 profiling -zd{f,p} DS floats vs DS pegged to DGROUP -ez generate PharLap EZ-OMF object -zdl load DS directly from DGROUP -fh= pre-compiled headers -zf{f,p} FS floats vs FS pegged to seg -fhq[=] fh without warnings -zg{f,p} GS floats vs GS pegged to seg -fhr (C++) only read PCH -zg function prototype using base type -fhw (C++) only write PCH -zk{0,0u,1,2,3,l} double-byte support -fhwe (C++) don't count PCH warnings -zku= UNICODE support -fi= force include of file -zl remove default library information -fo= set object file name -zld remove file dependency information -fr= set error file name -zm place functions in separate segments -ft (C++) check for 8.3 file names -zmf (C++) zm with near calls allowed -fx (C++) no check for 8.3 file names -zp{1,2,4,8,16} struct packing align. -g= set code group name -zpw warning when padding a struct -hc codeview debug format -zq operate quietly -hd dwarf debug format -zs check syntax only -hw watcom debug format -zt set data threshold -j change char default to signed -zu SS != DGROUP -m{f,s,m,c,l} memory model -zv (C++) enable virt. fun. removal opt -nc= set CODE class name -zw generate code for MS Windows -nd= set data segment name -zz remove @size from __stdcall func.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Debugging options ] -d0 no debugging information -d2t (C++) d2 but without type names -d1{+} line number debugging info. -d3 debug info with unref'd type names -d2 full symbolic debugging info. -d3i (C++) d3 + inlines as COMDATs -d2i (C++) d2 + inlines as COMDATs -d3s (C++) d3 + inlines as statics -d2s (C++) d2 + inlines as statics
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Optimization options ] -oa relax alias checking -ol+ ol with loop unrolling -ob branch prediction -om generate inline math functions -oc disable call/ret optimization -on numerically unstable floating-point -od disable optimizations -oo continue compile when low on memory -oe[=num] expand functions inline -op improve floating-point consistency -of[+] generate traceable stack frames -or re-order instructions to avoid stalls -oh enable repeated optimizations -os optimize for space -oi inline intrinsic functions -ot optimize for time -oi+ (C++) oi with max inlining depth -ou ensure unique addresses for functions -ok control flow entry/exit seq. -ox maximum optimization (-obmiler -s) -ol perform loop optimizations
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ C++ exception handling options ] -xd no exception handling -xs exception handling: balanced -xds no exception handling: space -xss exception handling: space -xdt no exception handling -xst exception handling: time
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Preprocessor options ] -d[=text] define a macro -u undefine macro name -d+ extend syntax of -d option -pil ignore #line directives -fo= set object file name -p{c,l,w=} preprocess source file -i= include directory c -> preserve comments -t= (C++) # of spaces in tab stop l -> insert #line directives -tp= (C) set #pragma on( w= -> wrap output at column n
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler command line options ] [ Linker options ] -bd build Dynamic link library -fm[=] generate map file -bm build Multi-thread application -k set stack size -br build with dll run-time library -l= link for the specified OS -bw build default Windowing app. -x make names case sensitive -bcl= compile and link for OS. @ additional directive file -fd[=[.lnk]] write directives -"" -fe= name executable file
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler - Is it compatible with modern C++ compilers? ] Yes. I would rephrase the question as follows: Modern C++ compilers are still compatible with Watcom C++ compiler when it comes to legacy C and C++ Standards. During last a couple of years I've integrated six major versions of different C++ compilers and every integration could be described as a "fight" with deviations from legacy C and C++ Standards due to some "questionable innovations", errors, inconsistencies, deliberately created dependencies to some proprietary non-portable technologies ( in most cases it applies to Microsoft, first of all ), undervaluing Open Standards, like OpenMP, etc.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler - C Run-Time ( CRT ) functions support ] Supported in full with some extensions and I didn't have any major problems during integration.
0 Kudos
SergeyKostrov
Valued Contributor II
1,586 Views
[ Watcom C++ compiler - Win32 API support ] Supported but I wouldn't call that support as a Full support. However, No problems detected with the most commonly used Win32 API functions. I don't think there is a support for Win32 API functions created after release of Windows 7 operating system.
0 Kudos
SergeyKostrov
Valued Contributor II
1,332 Views
[ Watcom C++ compiler - Win32 API support - Additional Comments ] >>Supported but I wouldn't call that support as a Full support... I don't consider it as a major problem because a 'LoadLibrary' based solution with Run-Time binding to a pointer, that declares a signature of unsupported Win32 API function, would allow to execute any Win32 API functions undeclared in Watcom C++ compiler headers.
0 Kudos
Reply