I was trying to compile mpi_prime.c with openmpi on windows. I tried it with the 32bit and 64bit version of OpenMPI_v1.6.2. I got these outputs.
Microsoft (R) C/C++-Optimierungscompiler Version 17.00.61030 für x86 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. mpi_prime.c Microsoft (R) Incremental Linker Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:mpi_prime.exe /LIBPATH:C:\Entwicklung\OpenMPI_v1.6.2-x64/lib libmpi_cxx.lib libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib mpicxx mpi_prime.c Microsoft (R) C/C++-Optimierungscompiler Version 17.00.61030 für x86 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. mpi_prime.c Microsoft (R) Incremental Linker Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:mpi_prime.exe /LIBPATH:C:\Entwicklung\OpenMPI_v1.6.2-x64/lib libmpi_cxx.lib libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib mpi_prime.obj mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Comm_rank" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Comm_size" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Finalize" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Init" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Reduce" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_MPI_Wtime" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_comm_world" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_op_max" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_op_sum" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_int" in Funktion "_main". mpi_prime.exe : fatal error LNK1120: 10 nicht aufgelöste Externe Microsoft (R) C/C++-Optimierungscompiler Version 17.00.61030 für x86 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. mpi_prime.c Microsoft (R) Incremental Linker Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:mpi_prime.exe /LIBPATH:C:\Entwicklung\OpenMPI_v1.6.2-win32/lib libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib Ws2_32.lib shlwapi.lib mpi_prime.obj mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_comm_world" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_op_max" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_op_sum" in Funktion "_main". mpi_prime.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ompi_mpi_int" in Funktion "_main". mpi_prime.exe : fatal error LNK1120: 4 nicht aufgelöste Externe
EDIT : Verweis auf nicht aufgelöstes externes Symbol means of course "unresolved reference to external symbol"
So I guess it had something to do with a 32bit vs. 64bit library problem using the wrong .dll as the 32bit version seems to produce less conflicts.
My plan looks like:
- get it running on 32bit -> here I'm right now
- get it running on 64bit
- get it running with another compiler, eg gcc
- get it running with my IDE codeblocks