hi everyone,I've very basic knowledge about programming.
As a part of program, i had to implement parallel processing in one program file, and that needs to be compiled using a make file. when i was compiling with -fopenmp it is showing the following error
undefined reference to GOMP_parallel_start
undefined reference to GOMP_parallel_end
undefined reference to omp_get_num_threads
undefined reference to omp_get_thread_num
undefined reference to GOMP_barrier
in make file target was written as
problemdef.o: problemdef.cpp
$(CXX) -fopenmp $(CXXFLAGS) $<
and the program was as follows
#include <vector>
#include <complex.h>
#include <iostream>
#include <time.h>
#include <math.h>
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <omp.h>
#include <fstream>
#ifndef GLOBAL_H
#include "global.h"
#endif
#include "m_minrad.h"
#include "functs.h"
#define PAR // Comment out if not parallel version
using namespace std;
void test_problem(double* parameters)
{
int i;
#ifdef PAR
#pragma omp parallel for private(parameters,i)
#endif
for(i=0;i<3;i++)
{
obj[i]=function(parameters);
}
}
could anyone please find what's wrong with program or part of makefile,it would be of great help to me