[petsc-users] custom compiler flags on Windows

Dominik Szczerba dominik at itis.ethz.ch
Fri Feb 18 09:43:56 CST 2011


I have manage to smuggle my options along with COPTFLAGS, but not
CFLAGS. The latter seems ignored (cygwin + windows). I tried exporting
them as shell variables as well as attaching them to the command line
before ./configure - in either case they are not to be found in
configure.log. Minor issue (just multiple compiler warnings about
overwritten switches), but if you still have a clean solution I would
be glad to learn it for future.

Many thanks and regards,
Dominik

> On Thu, Feb 17, 2011 at 7:00 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>> On Thu, 17 Feb 2011, Matthew Knepley wrote:
>>
>>> On Thu, Feb 17, 2011 at 10:37 AM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:
>>>
>>> > I need to use some special compile flags when compiling with 'cl' on
>>> > Windows.
>>> > While configuring I currently use --with-cxx='win32fe cl', which works
>>> > fine, but if I add some flags after cl the configure brakes,
>>> > complaining that the compiler does not work.
>>> > I also tried using --with-cxx='cl /MY /OPTIONS' but the result is the
>>> > same as before.
>>> > Is there a way to specify my own flags with Petsc (or add to them)?
>>> >
>>>
>>> --COPTFLAGS="<flags>" --FOPTFLAGS="" --CXXOPTFLAGS=""
>>
>> Generally CFLAGS should work. However with MS compilers - we have some
>> defaults without which the compilers might not work. [esp with mpi].
>> So when changing CFLAGS one might have to include the defaults plus
>> the additional flags.
>>
>> However COPTFLAGS migh be easier to add to CFLAGS - and provided to
>> primarily specify optimization flags - but can be used for for other
>> flags aswell..
>>
>> Satish
>>
>>
>


More information about the petsc-users mailing list