I am trying to compare solvers with one of them being parallelized in OpenMP; Solvers are all running in parallel under OpenMPI using Fixed Form Fortran 77; mpif77 does not let me link the object files with the -fopenmp switch; Make does not create the executable. I tried to compile the OpenMP source files separately with gfortran and then tried to link them with mpif77 - does not work; When I do not use the switch it throws the common error:
Undefined symbols for architecture x86_64:
"_GOMP_parallel", referenced from:
_parmatdiff_ in matdiff.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [solvercomp] Error
1
My question is does OpenMPI support OpenMP and if yes, how do I ensure that 'make' links object files created to functions in OpenMP libraries?
Here is a copy of my makefile:
SOURCES = solvcomp.f matdiff.f seqjacobi.f seqconjgrad.f parsor.f
FCC = mpif77
MPIRUN = mpirun
OBJECTS = $(SOURCES:.f=.o)
TARGET = soln
FFLAGS = -o
CFLAGS = -c
NP = 4
all: $(TARGET) clean
$(TARGET): $(OBJECTS)
$(FCC) $(FFLAGS) $(TARGET) $(OBJECTS)
$(OBJECTS): $(SOURCES)
$(FCC) $(CFLAGS) $(SOURCES)
clean:
rm -rf *.o *.dSYM
mpif77 -fopenmp? - Gilles Gouaillardetmpif77 -vprint? How does the last command executed bymakelook like? How does the complete output ofmakelook like? - Vladimir Fmakeexecute? What was the complete output? Any error message? Where did you put the flag into the Makefile? - Vladimir Fmpif77 -fopenmp. The answer to your question is likely yes, it does support. You haven't show us what "does not work" but OpenMPI is likely not at fault, your Makefile probably is, so show the makefile and the complete output. We need the details. - Vladimir F