[petsc-users] Petsc compilation with -MDd using visual studio c++ 2008

Mengda Wu wumengda at gmail.com
Sun Dec 18 13:08:29 CST 2011


Hi all,

   I am trying to compile with a debug version of Petsc with -MDd options
using visual studio c++ 2008. The following options are used.

./config/configure.py --with-cc='cl' --with-fc=0  --with-cxx='cl'
--with-mpi=0 --with-debugging=1
--download-f2cblaslapack=/path/to/f2cblaslapack-3.1.1.q.tar.gz
-CFLAGS='-MDd -wd4996' -CXXFLAGS='-MDd -wd4996'

But it seems that f2cblaslapack does not recognize "-MDd" completely. Some
files are still compiled with '-MD' instead of "-MDd". This will lead to a
problem that not all libraries are linked with the same MS C library. I
think it may be caused by the variable "CNOOPT" is not set properly in
config/BuildSystem/config/packages/f2cblaslapack.py and
config/BuildSystem/config/packages/BlasLapack.py. Only '-MD' is present
there. See

  def getWindowsNonOptFlags(self,cflags):
    for flag in ['-MT','-MTd','-MD','-threads']:
      if cflags.find(flag) >=0: return flag
    return ''

If I substitute '-MD' with '-MDd', then it works. But this will lead to
problem when '-MD' is preferred.

I am wondering if anyone can fix this problem.

Thanks,
Mengda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111218/0c8e8a08/attachment.htm>


More information about the petsc-users mailing list