Makefile editando makefile

I have the following makefile

PDP1 Makefile

FILE_EXT =

EXEC = …/xpdp1_Serial_semXG

CC = nvcc

CFLAGS= -O2 -DPDP1PATH="$(HOME)/versoes/

xpdp1_Serial_semXG/src"

LIBS = -L/usr/local/lib

PDP1OBJ= fft.o field.o move.o gather.o pdp1.o start.o load.o prest.o \

 padjus.o initwin.o maxwellv.o xgreadrit.o xsect.o \

 argonmcc.o heliummcc.o neonmcc.o oxygenmcc.o mcc.o

all: $(PDP1OBJ) $(EXEC)

.c.o: pdp1.h xsect.h xgscalar.h xgrafix.h

$(CC) -c $(CFLAGS) $*.c

$(EXEC): $(PDP1OBJ)

    $(CC) -o $(EXEC) $(PDP1OBJ)

$(CC) -o $(EXEC) $(PDP1OBJ) $(LIBS)

clean:

@rm *.o

[b]

It is used to compile the following files:

[/b]

cotrim@optimus:~/versoes/

xpdp1_Serial_semXG1/src$ ls

argonmcc.c fft.o field.o heliummcc.c initwin.c load.c makefile~ makefile.linux mcc.c move.cu neon.tbl oxygenmcc.c pdp11.c pdp1.h prest.c start.c xgrafixint.h xgscalar.h xsect.h

fft.c field.c gather.c initwin11.c load(1).c makefile makefile11 maxwellv.c mccdiaginit.c neonmcc.c outtemp.dmp padjus.c pdp1.c piiia.inp start11.c xgrafix.h xgreadrit.c xsect.c

[b]

I have to use the language CUDA to parallelize one of them is that if move.cu and change this file for this extension. Cu the case the following error:[/b]

cotrim@optimus:~/versoes/xpdp1_Serial_semXG1/src$ make

nvcc -c -O2 -DPDP1PATH="/home/cotrim/versoes/xpdp1_Serial_semXG/src" fft.c

nvcc -c -O2 -DPDP1PATH="/home/cotrim/versoes/xpdp1_Serial_semXG/src" field.c

make: *** No rule to make target move.o ', needed by all’. Stop it.

someone might have a solution?

You need to add a rule for compiling CUDA files. Assuming you are using GNU make, something like

%.o : %.cu

             $(CC) -c $(CFLAGS) -o $@ $<

should do.

If you use an older make, you’ll need to use suffix rules (like your Makefile already suggests)

.cu.o:

             $(CC) -c $(CFLAGS) -o $@ $*.c

but then you’ll also have to change the name(s) of the object file(s) to use your rule instead of the built-in default rule:

PDP1OBJ= fft.o field.o move.cu.o gather.o pdp1.o start.o load.o prest.o \

padjus.o initwin.o maxwellv.o xgreadrit.o xsect.o \

argonmcc.o heliummcc.o neonmcc.o oxygenmcc.o mcc.o

I made the following change:

##

##	PDP1 Makefile 

##

FILE_EXT = 

##

##

EXEC = ../xpdp1_Serial_semXG

##

CC = nvcc

##

CFLAGS= -O2 -DPDP1PATH=\"$(HOME)/versoes/xpdp1_Serial_semXG/src\"

##

LIBS  =  -L/usr/local/lib

PDP1OBJ= fft.o field.o move.o gather.o pdp1.o start.o load.o prest.o \

	 padjus.o initwin.o maxwellv.o xgreadrit.o xsect.o \

	 argonmcc.o heliummcc.o neonmcc.o oxygenmcc.o mcc.o

all:	$(PDP1OBJ) $(EXEC)

%.o : %.cu

	$(CC) -c $(CFLAGS) -o $@ $<

$(EXEC):	$(PDP1OBJ)

		$(CC) -o $(EXEC) $(PDP1OBJ)

clean:

	@rm *.o

using the files

cotrim@optimus:~/versoes/

xpdp1_Serial_semXG1/src$ ls

argonmcc.c fft.o field.o heliummcc.c initwin.c load.c makefile~ makefile.linux mcc.c move.cu neon.tbl oxygenmcc.c pdp11.c pdp1.h prest.c start.c xgrafixint.h xgscalar.h xsect.h

fft.c field.c gather.c initwin11.c load(1).c makefile makefile11 maxwellv.c mccdiaginit.c neonmcc.c outtemp.dmp padjus.c pdp1.c piiia.inp start11.c xgrafix.h xgreadrit.c xsect.c

is now happening the following error:

cotrim@optimus:~/versoes/xpdp1_Serial_semXG/src$

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (ldl), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (lXpm), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (ltcl), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (ltk), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (TCLTK), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (lXGC250), this should not happen!

(gedit:15794): GtkSourceView-WARNING **: Could not find word to remove in buffer (X11R6), this should not happen!

Use a different editor. These messages have nothing to do with CUDA.

Sorry, this is not the error.

the message is:

cotrim@optimus:~/versoes/xpdp1_Serial_semXG/src$ make

nvcc -O2 -DPDP1PATH=\"/home/cotrim/versoes/xpdp1_Serial_semXG/src\"   -c -o fft.o fft.c

nvcc -O2 -DPDP1PATH=\"/home/cotrim/versoes/xpdp1_Serial_semXG/src\"   -c -o field.o field.c

nvcc -c -O2 -DPDP1PATH=\"/home/cotrim/versoes/xpdp1_Serial_semXG/src\" -o move.o move.cu

pdp1.h(169): error: variable "kes_x_hist" has already been defined

move.cu(10): warning: variable "ke_temp" was declared but never referenced

move.cu(63): warning: variable "vxtemp" was declared but never referenced

move.cu(63): warning: variable "vytemp" was declared but never referenced

move.cu(63): warning: variable "vztemp" was declared but never referenced

move.cu(63): warning: variable "ke_temp" was declared but never referenced

move.cu(64): warning: variable "TEp" was declared but never referenced

1 error detected in the compilation of "/tmp/tmpxft_00000d54_00000000-4_move.cpp1.ii".

What does line 169 of [font=“Courier New”]pdpl.h[/font] say, and where else is [font=“Courier New”]kes_x_hist[/font] defined? Shouldn’t be too difficult to sort that out.

thanks for the help.