<div dir="ltr"><div>Hi Satish,<br><br></div>    I think this problem happens in the latest 3.5.1 version. On windows 7 with VS2012, I configured with (under Cygwin):<br><br><div><div><div class="gmail_extra">   ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl' --with-mpi=0 --with-debugging=1 --download-f2cblaslapack=/cygdrive/d/Library/PETSc/download/f2cblaslapack-3.4.2.q1.tar.gz --with-sowing=0 --with-c2html=0 -CFLAGS='-MDd -wd4996' -CXXFLAGS='-MDd -wd4996'<br>
<br></div><div class="gmail_extra">    After configure, in petsc-3.5.1\arch-mswin-c-debug\externalpackages\f2cblaslapack-3.4.2.q1<br>    CC = /cygdrive/d/Library/PETSc/petsc-3.5.1/bin/win32fe/win32fe cl<br>    COPTFLAGS  = -MDd -wd4996 -Z7 <br>
    CNOOPT =    -MD<br><br></div><div class="gmail_extra">    So CNOOPT does not get correct "-MDd", which causes the VC dll mismatch after compilation of Petsc debug. There was no problem with  petsc-3.4.3. I am trying to upgrade to 3.5.1 and the problem came out. Could you please take a look?<br>
<br></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">Mengda<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 18, 2011 at 2:14 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On Sun, 18 Dec 2011, Mengda Wu wrote:<br>
<br>
> Hi all,<br>
><br>
>    I am trying to compile with a debug version of Petsc with -MDd options<br>
> using visual studio c++ 2008. The following options are used.<br>
><br>
> ./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'<br>
> --with-mpi=0 --with-debugging=1<br>
> --download-f2cblaslapack=/path/to/f2cblaslapack-3.1.1.q.tar.gz<br>
> -CFLAGS='-MDd -wd4996' -CXXFLAGS='-MDd -wd4996'<br>
><br>
> But it seems that f2cblaslapack does not recognize "-MDd" completely. Some<br>
> files are still compiled with '-MD' instead of "-MDd". This will lead to a<br>
> problem that not all libraries are linked with the same MS C library. I<br>
> think it may be caused by the variable "CNOOPT" is not set properly in<br>
> config/BuildSystem/config/packages/f2cblaslapack.py and<br>
> config/BuildSystem/config/packages/BlasLapack.py. Only '-MD' is present<br>
> there. See<br>
><br>
>   def getWindowsNonOptFlags(self,cflags):<br>
>     for flag in ['-MT','-MTd','-MD','-threads']:<br>
>       if cflags.find(flag) >=0: return flag<br>
>     return ''<br>
><br>
> If I substitute '-MD' with '-MDd', then it works. But this will lead to<br>
> problem when '-MD' is preferred.<br>
><br>
<br>
</div></div>You can just add 'MDd' to that list.<br>
<br>
i.e<br>
<br>
    for flag in ['-MT','-MTd','-MD','-MDd','-threads']:<br>
<br>
Will add this for the next patch update to petsc-3.2<br>
<span class=""><font color="#888888"><br>
Satish<br>
</font></span><div class=""><div class="h5"><br>
> I am wondering if anyone can fix this problem.<br>
><br>
> Thanks,<br>
> Mengda<br>
><br>
<br>
</div></div></blockquote></div><br></div></div></div></div>