|
|
Up |
|
|
  |
Author: tomguesttomguest Date: Aug 20, 2008 05:37
Hi
How can I make my code do something depending on my compiler flag?
For example, if I use the -openmp flag I want a loop to have a
different range.
i.e.
if (flag -openmp)
do i=1,10
else
do i=1,5
endif
do loop
enddo
Thanks
|
| |
|
| | 12 Comments |
|
  |
Author: Tim PrinceTim Prince Date: Aug 20, 2008 07:32
> Hi
>
> How can I make my code do something depending on my compiler flag?
> For example, if I use the -openmp flag I want a loop to have a
> different range.
>
> i.e.
>
> if (flag -openmp)
> do i=1,10
> else
> do i=1,5
> endif
>
> do loop
>
> enddo
|
| Show full article (0.38Kb) |
|
| | no comments |
|
  |
|
Author: tomguesttomguest Date: Aug 20, 2008 07:52
|
| |
| no comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Aug 20, 2008 13:42
> How can I make my code do something depending on my compiler flag?
> For example, if I use the -openmp flag I want a loop to have a
> different range.
> if (flag -openmp)
> do i=1,10
> else
> do i=1,5
> endif
You can't do that in Fortran, or pretty much any
compiled language. (I have seen it done in BASIC).
But you say compiler flag. If you use the C preprocessor,
you can do
#ifdef OPENMP
do i=1,10
#else
do i=1,5
#endif
|
| Show full article (0.66Kb) |
| no comments |
|
  |
|
|
  |
Author: tju329tju329 Date: Aug 20, 2008 21:15
> Hi
>
> How can I make my code do something depending on my compiler flag?
> For example, if I use the -openmp flag I want a loop to have a
> different range.
>
> i.e.
>
> if (flag -openmp)
> do i=1,10
> else
> do i=1,5
> endif
>
> do loop
>
> enddo
>
> Thanks ...
|
| Show full article (0.45Kb) |
| no comments |
|
  |
Author: Arjen MarkusArjen Markus Date: Aug 21, 2008 00:07
On 21 aug, 03:23, Ron Ford wrote:
> On Wed, 20 Aug 2008 12:42:03 -0800, glen herrmannsfeldt posted:
>
>
>
>
>
>
>>> How can I make my code do something depending on my compiler flag?
>>> For example, if I use the -openmp flag I want a loop to have a
>>> different range.
>
>>> if (flag -openmp)
>>> do i=1,10
>>> else
>>> do i=1,5
>>> endif
>
>> You can't do that in Fortran, or pretty much any ...
|
| Show full article (1.26Kb) |
| no comments |
|
  |
Author: Arjen MarkusArjen Markus Date: Aug 21, 2008 00:08
> Hi
>
> How can I make my code do something depending on my compiler flag?
> For example, if I use the -openmp flag I want a loop to have a
> different range.
>
> i.e.
>
> if (flag -openmp)
> do i=1,10
> else
> do i=1,5
> endif
>
> do loop
>
> enddo
>
> Thanks ...
|
| Show full article (0.51Kb) |
| no comments |
|
  |
|
|
  |
|
|
  |
Author: tomguesttomguest Date: Aug 21, 2008 02:59
I basically want to have different output to certain files depending
on how the user compiles the code.
I just gave the loop problem as an example. I'm also incorporating
some other features that I want to enable by compiler flags.
|
| |
| no comments |
|
RELATED THREADS |
  |
|
|
|
|
|