about PETSC run time lib

Satish Balay balay at mcs.anl.gov
Sat Nov 4 08:54:12 CST 2006


On Sat, 4 Nov 2006, Yixun Liu wrote:

> Hi,
> I config PETSC with,
> $ ./config/configure.py --with-mpi-dir=/cygdrive/d/MPICH2 --with-cc='win32fe cl' --with-fc=0 --with-cxx='win32fe cl' --with-clanguage=cxx --with-blas-lapack-dir=$PETSC_DIR/externalpackages/w_mkl_serial_p_8.1.001/mkl_serial_8.1/mkl_8.1_serial/ia32/lib COPTFLAGS='-MD -Z7' CXXOPTFLAGS='-MD -Z7'
> 
> In my applicaton I use another lib, which use Debug multithread DLL run time lib. When I use this two libs together I alwayse receive the warning :
> "LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library".
>  I think this is because PETSC use MSVCRT run time lib and the other lib use MSVCRTD run time lib. If I ignore this warning the application will run into exception. So I need to config the PETSC to let it use the same run time lib. Should I use COPTFLAGS='-MDd -Z7' CXXOPTFLAGS='-MDd -Z7'?


I think both options are the same - and PETSc is attempting to use
MSVCRTD.lib. You can verify with:

cd lib/$PETSC_ARCH/
strings *.lib |grep defaultlib | sort | uniq


If you think there is a difference - rebuild with the appropriate
compiler options you need.

Satish




More information about the petsc-users mailing list