-
Linkage error
Hi,
I am writing a C program using MPI for parallelization. Following is the script I use to compile and run the code:-
clear
make veryclean
mpicc -c -I ./include -O -o two.o ComputeFPE_QP_GQ.c
c++ -I ./include -O -L ./lib -o two.exe two.o -looqpgensparse -looqpsparse -looqpgendense -looqpdense -looqpgondzio -looqpbase -lm -llapack -lblas -lgsl -lgslcblas ./examples/QpGen/cinterface/libg2c.a ./extras/MA27/libMA27.a ./extras/blas/libblas.a
./two.exe
I get following error dhen I run the script:-
Undefined reference to MPI_Init.
As it is clear from the script, I am using C++ compiler after I compile my C code using mpicc. This is because many of the libraries I am trying to link require c++ compiler.
I have written another very simple C program using mpi. It compiles and runs smoothly.
Could anyone tell me what could be the problem with compiler in the given script??
Thanks
-
You're going to need to add the MPI libraries as options when you compile, I would suspect.