[petsc-dev] __SDIR__ as string or not
Barry Smith
bsmith at mcs.anl.gov
Wed Feb 24 16:24:43 CST 2010
This should be ok. LOCDIR is relative to the PETSC_DIR root and
always in the petsc tree. So long as a PETSc developer doesn't make a
new subdirectory with a space in it we should be all set.
You are right if someone sets their own LOCDIR for their own source
tree in a crazy manner but that is there problem.
Barry
On Feb 24, 2010, at 4:21 PM, Satish Balay wrote:
> One potential issue is - if the dir has spaces - as on windows..
> Hence the need for quotes for -D__INSDIR__='directory'
>
> satish
>
>
> On Wed, 24 Feb 2010, Barry Smith wrote:
>
>>
>> Currently the macro variable __SDIR__ is defined in conf/variables
>> with
>> quotes around it, passed to the compiler as -D__SDIR__="directory"
>> and then
>> used in PETSc source code as a string. This works but is fragile to
>> shells
>> removing various quotes before passing to the compiler.
>>
>> Lisandro suggested changing the model to use -D__INSDIR__=directory
>> with no
>> quotes and then in petscerror.h have
>> #define PetscStringize(a) #a
>> #define __SDIR__ PetscStringize(__INSDIR__)
>>
>> Seems to work on my machine for C and C++ compilers so I am pushing
>> to
>> petsc-dev. Please report problems ASAP.
>>
>> Barry
>>
>
More information about the petsc-dev
mailing list