Linking problems with ifort and visual studio 2003
Satish Balay
balay at mcs.anl.gov
Sun Mar 23 09:11:54 CDT 2008
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