title: Makefile Compiling Issues
body: <p>This is my makefile </p>
  
  <pre><code>   FC=gfortran
  CC=gcc 
  CPC=g++ 
  FFLAGS = -O3 
  LINK=g++
  BLASF=dgemmf.o dgemmkernel2.o mult.o
  BLASFSRC=dgemmf.f
  TIMER=mytimer.o
  
  TGEMM=tgemm
  ALL= $(TGEMM)
  
  LIBS = -lblas 
  
  all: $(ALL)
  mult.o: 
      $(CPC) -O3 -fopenmp -c mult.cpp
  
  $(TGEMM): tgemm.o mult.o $(TIMER) $(BLASF)
      $(FC) $(FFLAGS) -o $(TGEMM) tgemm.o $(TIMER) $(BLASF) $(LIBS)
  
  dgemmkernel2.o: dgemmkernel2.cpp 
      $(CPC) -O3 -c -fopenmp dgemmkernel2.cpp 
  tgemm.o: tgemm.f $(INCLUDE)
      $(FC) $(FFLAGS) -c tgemm.f
  
  clean:
      rm -rf *.o $(ALL)
  </code></pre>
  
  <p>This is what I get for errors:</p>
  
  <pre><code>     make -f makefile_gcc2
  gfortran -O3  -c tgemm.f
  g++  -O3 -fopenmp -c mult.cpp
  gcc     -c -o mytimer.o mytimer.c
  gfortran -O3   -c -o dgemmf.o dgemmf.f
  g++  -O3 -c -fopenmp dgemmkernel2.cpp 
  gfortran -O3  -o tgemm tgemm.o mytimer.o dgemmf.o dgemmkernel2.o mult.o -lblas 
  dgemmkernel2.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
  mult.o: In function `global constructors keyed to main':
  mult.cpp:(.text+0x1a): undefined reference to `std::ios_base::Init::Init()'
  mult.cpp:(.text+0x29): undefined reference to `std::ios_base::Init::~Init()'
  mult.o: In function `_Z4multPdS_iS_iii.omp_fn.0':
  mult.cpp:(.text+0x4f): undefined reference to `omp_get_num_threads'
  mult.cpp:(.text+0x57): undefined reference to `omp_get_thread_num'
  mult.o: In function `mult(double*, double*, int, double*, int, int, int)':
  mult.cpp:(.text+0x175): undefined reference to `omp_get_num_threads'
  mult.cpp:(.text+0x1b9): undefined reference to `GOMP_parallel_start'
  mult.cpp:(.text+0x1c6): undefined reference to `GOMP_parallel_end'
  mult.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
  collect2: ld returned 1 exit status
  make: *** [tgemm] Error 1
  </code></pre>
  
  <p>I understand from my research that these are likely linker issues, but I cannot for the life of me figure out what the problem is.  Is there anyone out there who might have some insight into what the issue is?</p>