Missing Symbols When Linking


Up: Frequently Asked Questions Next: Warning messages while building MPICH Previous: Fortran programs give errors about mismatched types

If you get errors about missing symbols, such as

mpicc  -o overtake overtake.o test.o  
ld: 0711-317 ERROR: Undefined symbol: MPIR_F_TRUE 
ld: 0711-317 ERROR: Undefined symbol: .MPIR_InitFortranDatatypes 
ld: 0711-317 ERROR: Undefined symbol: MPIR_F_FALSE 
ld: 0711-317 ERROR: Undefined symbol: .MPIR_InitFortran 
ld: 0711-317 ERROR: Undefined symbol: MPIR_I_DCOMPLEX 
ld: 0711-317 ERROR: Undefined symbol: .MPIR_Free_Fortran_dtes 
ld: 0711-317 ERROR: Undefined symbol: .MPIR_Free_Fortran_keyvals 
this usually indicates an error in the make process. For some reason, the Fortran part (which is where these symbols come from) is particularly fragile. To fix this, try the following steps:
    cd src/fortran/src 
    make clean 
    make 
    ar ../../../lib/libmpich.a *.o 
    ranlib ../../../lib/libmpich.a 
If weak symbols are not supported, then in addition, do these additional steps:
    make clean 
    make profile 
    ar ../../../lib/libpmpich.a *.o 
    ranlib ../../../lib/libpmpich.a 
The problem is that some versions of make have logic errors that cause them to create files but not to act on them; this causes make to build the object file but then fail to include it in the archive. The above steps should work around this problem.



Up: Frequently Asked Questions Next: Warning messages while building MPICH Previous: Fortran programs give errors about mismatched types