[fpc-pascal] Common OpenMP syntax?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 21 11:21:34 CEST 2006


On Fri, 21 Jul 2006 09:28:17 +1000
Steve Williams <stevewilliams at kromestudios.com> wrote:

> Marc Weustink wrote:
> >> One of the pretexts behind OpenMP is that the code will still compile
if 
> >> OpenMP is not available or disabled on a particular compiler. 
> >>     
> >
> > Mwah... in that case you can still use the same keywords, only it won't 
> > be much parallel, since it's executed in one thread.
> > And beeing executed in one or more threads should not matter in parallel

> > blocks.
> >   
> 
> But then your code is locked to that version of FPC that supports those 
> new keywords.

Other compilers will give you warnings about illegal compiler directives.
Therefore if your code should work with multiple compilers, you will
probably enclose the omp additions with IFDEFs anyway.

{$IFDEF HasOMP}cobegin{$ENDIF}


OpenMP uses pragmas, because
- They didn't want to break ANSI C. FPC has its own mode and compatibility
modes for others.
- It takes time before all the C compilers support the OMP additions. 
  For example default gcc does not yet. 
  Do we plan a syntax for FPC or for pascal in general?
- C programmers are more used to macros and pragmas, than pascal programmers
to compiler directives. 
  IMO Directives are ugly.
- C programmers are more used to hints and notes, than pascal programmers. 
  Although recent fpc additions changed that (hints about
unused/uninitialised variables).
  IMO Noisy notes make it harder to find the relevant compiler messages.


Mattias




More information about the fpc-pascal mailing list