I have different fortran source files which i want to link with my CUDA C code.The makefile is as follows:
GOP = nvcc
COP = mpif90 -O3 -axW -ipo
COP = mpif90 -fast -r8
COP = mpif90 -O3 -tpp6 -r8 -static
PROG = ptee.out
DOTO = mod.o
create.o
displace.o
coulomb.o
lj.o
ee.o
erf.o
erfc.o
fourier.o
lrc.o
main.o
newmaxima.o
outfold.o
ran2.o
read.o
real.o
self.o
size.o
store.o
surf.o
weights.o
writedata.o
writehist.o
writeresults.o
$(PROG): $(DOTO) host.o
$(COP) -o $(PROG) $(DOTO) host.o -L/usr/local/cuda-2.2/cuda/lib -lcudart
host.o: host.cu
$(GOP) -c -O3 host.cu -l cutil -I/u/ac/vkumar/nvidia_samples/NVIDIA_CUDA-2.2_SDK/common/inc -L /u/ac/vkumar/nvidia_samples/NVIDIA_CUDA-2.2_SDK/lib -lcutil
mod.o: mod.f90
$(COP) -c mod.f90
coulomb.o: coulomb.f90
$(COP) -c coulomb.f90
create.o: create.f90
$(COP) -c create.f90
displace.o: displace.f90
$(COP) -c displace.f90
ee.o: ee.f90
$(COP) -c ee.f90
erf.o: erf.f90
$(COP) -c erf.f90
erfc.o: erfc.f90
$(COP) -c erfc.f90
fourier.o: fourier.f90
$(COP) -c fourier.f90
lj.o: lj.f90
$(COP) -c lj.f90
lrc.o: lrc.f90
$(COP) -c lrc.f90
main.o: main.f90
$(COP) -c main.f90
newmaxima.o: newmaxima.f90
$(COP) -c newmaxima.f90
outfold.o: outfold.f90
$(COP) -c outfold.f90
ran2.o: ran2.f90
$(COP) -c ran2.f90
read.o: read.f90
$(COP) -c read.f90
real.o: real.f90
$(COP) -c real.f90
self.o: self.f90
$(COP) -c self.f90
size.o: size.f90
$(COP) -c size.f90
store.o: store.f90
$(COP) -c store.f90
surf.o: surf.f90
$(COP) -c surf.f90
weights.o: weights.f90
$(COP) -c weights.f90
writedata.o: writedata.f90
$(COP) -c writedata.f90
writehist.o: writehist.f90
$(COP) -c writehist.f90
writeresults.o: writeresults.f90
$(COP) -c writeresults.f90
But when i make this,I get errors like:
host.cu(94): error: this declaration has no storage class or type specifier
host.cu(94): error: declaration is incompatible with “CUTBoolean cutDeleteTimer(unsigned
int)”
/u/ac/vkumar/nvidia_samples/NVIDIA_CUDA-2.2_SDK/common/inc/cutil.h(694): here
host.cu(110): error: this declaration has no storage class or type specifier
host.cu(110): error: declaration is incompatible with “cudaError_t cudaFree(void *)”
/usr/local/cuda-2.2/cuda/bin/…/include/cuda_runtime_api.h(106): here
host.cu(111): error: this declaration has no storage class or type specifier
host.cu(111): error: variable “cudaFree” has already been defined
host.cu(112): error: this declaration has no storage class or type specifier
host.cu(112): error: variable “cudaFree” has already been defined
host.cu(113): error: this declaration has no storage class or type specifier
host.cu(113): error: variable “cudaFree” has already been defined
host.cu(115): error: expected a declaration