Linking problems with ifort and visual studio 2003

Ben Tay zonexo at gmail.com
Sun Mar 23 21:23:40 CDT 2008


Hi Satish,

I tried to change the compiler options to be as similar to that in the 
cygwin environment. Still can't manage to get it to work. The errors I 
copy n paste is directly from the IDE of studio 2003, so I'm sure it 
can't be from Compaq. Btw, here's the options:



For compiling (no prob)

/nologo /Zi /O3 /fpp /include:"Debug/" 
/include:"E:\cygwin\codes\petsc-2.3.3-p10" 
/include:"E:\cygwin\codes\petsc-2.3.3-p10\include" 
/include:"E:\cygwin\codes\petsc-2.3.3-p10\bmake\win32_ifort_nodebug" 
/include:"E:\cygwin\codes\petsc-2.3.3-p10\include\mpiuni" 
/include:"Debug/" /extend_source:132 /real_size:64 /Qsave /iface:cvf 
/module:"Debug/" /object:"Debug/" /traceback /check:bounds /c

Cygwin:

For compiling (no prob)

/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/bin/win32fe/win32fe ifort 
--nodetect -c
  -MT -O3 -QxW -fpp  -I/cygdrive/e/cygwin/codes/petsc-2.3.3-p10 
-I/cygdrive/e/cy
gwin/codes/petsc-2.3.3-p10/bmake/win32_ifort_nodebug 
-I/cygdrive/e/cygwin/codes/
petsc-2.3.3-p10/include 
-I/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/include/mpiun
i        -o ex1f.o ex1f.F

Visualstudio 2003:

For linker

/OUT:"Debug/ns2d_c.exe" /INCREMENTAL /NOLOGO 
/LIBPATH:"E:\cygwin\codes\petsc-2.3.3-p10\lib\win32_ifort_nodebug" 
/LIBPATH:"E:\cygwin\codes\petsc-2.3.3-p10\externalpackages\fblaslapack\win32_ifort_nodebug" 
/LIBPATH:"E:\cygwin\codes\petsc-2.3.3-p10\include\mpiuni" 
/LIBPATH:"C:\Program Files\Tecplot\Tec360\bin\\" /NODEFAULTLIB:"LIBCMT" 
/DEBUG /PDB:"Debug/ns2d_c.pdb" /SUBSYSTEM:CONSOLE tecio.lib ws2_32.lib 
kernel32.lib user32.lib gdi32.lib advapi32.lib libpetscts.lib 
libpetscsnes.lib libpetscksp.lib libpetscdm.lib libpetscmat.lib 
libpetscvec.lib libpetsc.lib libfblas.lib libflapack.lib libmpiuni.lib

Cygwin:

For linker

/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/bin/win32fe/win32fe ifort 
--nodetect -M
T -O3 -QxW -fpp  -o ex1f ex1f.o  
-L/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/lib/
win32_ifort_nodebug 
-L/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/lib/win32_ifort_n
odebug -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc    
-L/cygdrive/e/cygwi
n/codes/petsc-2.3.3-p10/lib/win32_ifort_nodebug 
-L/cygdrive/e/cygwin/codes/petsc
-2.3.3-p10/lib/win32_ifort_nodebug -lmpiuni 
-L/cygdrive/e/cygwin/codes/petsc-2.3
.3-p10/externalpackages/fblaslapack/win32_ifort_nodebug 
-L/cygdrive/e/cygwin/cod
es/petsc-2.3.3-p10/externalpackages/fblaslapack/win32_ifort_nodebug 
-lflapack -L
/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/externalpackages/fblaslapack/win32_ifor
t_nodebug 
-L/cygdrive/e/cygwin/codes/petsc-2.3.3-p10/externalpackages/fblaslapac
k/win32_ifort_nodebug -lfblas Gdi32.lib User32.lib Advapi32.lib 
Kernel32.lib Ws2
_32.lib

Did I missed out anything? I also tried to add /nodetect /MT /QxW /fpp 
but visualstudio 2003 says unrecognized options.

Thank you very much

Satish Balay wrote:
> Ok - you are using VisualStudio 2003 + IntelFortran compilers to build
> PETSc. A PETSc fortran example [ex1f] compiles from 'make' but not
> from IDE?
>
> Then some setting in the IDE does not match the compile option. Per
> installation instructions - you should make sure you have *all*
> compiler options you see from make [when compiling ex1f] are also
> specified in the IDE settings.
>
>   
>> global.obj  error LNK2019: unresolved external symbol _PETSCINITIALIZE at 12
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>>     
>
> Looks like this code is compiled by Compaq Fortran compiler - and not
> intel fortran. Can you verify?
>
> Satish
>
> On Sun, 23 Mar 2008, Ben Tay wrote:
>
>   
>> Hi,
>>
>> I've successfully compiled the library of PETSc. The examples also worked (I
>> tested ex1f). However in the IDE of visual studio 2003, I can't seem to link,
>> although compiling the individual files were fine. The errors are:
>>
>> global.obj  error LNK2019: unresolved external symbol _PETSCINITIALIZE at 12
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _MATCREATESEQAIJ at 28
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _VECCREATESEQ at 16
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _VECDUPLICATE at 12
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _KSPCREATE at 12 referenced
>> in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _VECASSEMBLYBEGIN at 8
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> global.obj  error LNK2019: unresolved external symbol _VECASSEMBLYEND at 8
>> referenced in function _GLOBAL_DATA_mp_ALLO_VAR
>> bc.obj  error LNK2019: unresolved external symbol _MATSETVALUES at 32 referenced
>> in function _BC_mp_BC_BIG_A_S
>> bc_impl.obj  error LNK2001: unresolved external symbol _MATSETVALUES at 32
>> set_matrix.obj  error LNK2001: unresolved external symbol _MATSETVALUES at 32
>> petsc_sub.obj  error LNK2001: unresolved external symbol _MATSETVALUES at 32
>> bc_impl.obj  error LNK2019: unresolved external symbol _VECSETVALUE at 20
>> referenced in function _BC_IMPL_mp_BC_Q_IMPL_S
>> set_matrix.obj  error LNK2001: unresolved external symbol _VECSETVALUE at 20
>> petsc_sub.obj  error LNK2001: unresolved external symbol _VECSETVALUE at 20
>> petsc_sub.obj  error LNK2019: unresolved external symbol _MATASSEMBLYBEGIN at 12
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _MATASSEMBLYEND at 12
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _MATSCALE at 12
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _KSPSETOPERATORS at 20
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _KSPGETPC at 12
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _KSPSETTYPE at 16
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>> petsc_sub.obj  error LNK2019: unresolved external symbol _PCSETTYPE at 16
>> referenced in function _PETSC_SUB_mp_PETSC_SOLVER_MOM
>>
>>
>> I was using Compaq visual fortran initially and I have converted the *.dsw
>> file to the visual studio 2003 format. Of cos, I have changed the locations to
>> the new PETSc directory. May I know what's happening? Is there anything I need
>> to set or changed in studio 2003?
>>
>> Thanks alot!
>>
>>
>>     
>
>
>   




More information about the petsc-users mailing list