From 27583533805dde8fd5e4514d25531b8347fd985b Mon Sep 17 00:00:00 2001 From: Nathan Luehr Date: Thu, 21 Jan 2016 16:30:05 -0800 Subject: Added NCCL error checking to tests. Also cleaned up makefile so that tests and lib are not built unnecessarily. Change-Id: Ia0c596cc2213628de2f066be97615c09bb1bb262 Reviewed-on: http://git-master/r/999627 Reviewed-by: Przemek Tredak Tested-by: Przemek Tredak --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5f93ecb..9afde64 100644 --- a/Makefile +++ b/Makefile @@ -78,14 +78,14 @@ TESTBINS := $(patsubst %, $(TSTDIR)/%, $(TESTS)) MPITESTBINS:= $(patsubst %, $(MPITSTDIR)/%, $(MPITESTS)) DEPFILES := $(patsubst %.o, %.d, $(LIBOBJ)) $(patsubst %, %.d, $(TESTBINS)) $(patsubst %, %.d, $(MPITESTBINS)) -lib : $(INCTARGETS) $(LIBTARGET) +lib : $(INCTARGETS) $(LIBDIR)/$(LIBTARGET) -include $(DEPFILES) -$(LIBTARGET) : $(LIBOBJ) +$(LIBDIR)/$(LIBTARGET) : $(LIBOBJ) @printf "Linking %-25s\n" $@ @mkdir -p $(LIBDIR) - @$(GPP) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(LIBSONAME) -o $(LIBDIR)/$@ $(LDFLAGS) $(LIBOBJ) + @$(GPP) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(LIBSONAME) -o $@ $(LDFLAGS) $(LIBOBJ) @ln -sf $(LIBSONAME) $(LIBDIR)/$(LIBNAME) @ln -sf $(LIBTARGET) $(LIBDIR)/$(LIBSONAME) @@ -109,7 +109,7 @@ clean : test : lib $(TESTBINS) -$(TSTDIR)/% : test/single/%.cu lib +$(TSTDIR)/% : test/single/%.cu $(LIBDIR)/$(LIBTARGET) @printf "Building %-25s > %-24s\n" $< $@ @mkdir -p $(TSTDIR) @$(NVCC) $(TSTINC) $(CPPFLAGS) $(NVCUFLAGS) --compiler-options "$(CXXFLAGS)" -o $@ $< -Lbuild/lib $(LIBLINK) $(LDFLAGS) -lcuda -lcurand -lnvToolsExt @@ -121,11 +121,11 @@ $(TSTDIR)/% : test/single/%.cu lib mpitest : lib $(MPITESTBINS) -$(MPITSTDIR)/% : test/mpi/%.cu lib +$(MPITSTDIR)/% : test/mpi/%.cu $(LIBDIR)/$(LIBTARGET) @printf "Building %-25s > %-24s\n" $< $@ @mkdir -p $(MPITSTDIR) - @$(NVCC) $(MPIFLAGS) $(TSTINC) $(CPPFLAGS) $(NVCUFLAGS) --compiler-options "$(CXXFLAGS)" -o $@ $< -Lbuild/lib $(LIBLINK) $(LDFLAGS) - @$(NVCC) $(MPIFLAGS) -M $(TSTINC) $(CPPFLAGS) $(NVCUFLAGS) --compiler-options "$(CXXFLAGS)" $< -Lbuild/lib $(LIBLINK) $(LDFLAGS) > $(@:%=%.d.tmp) + @$(NVCC) $(MPIFLAGS) $(TSTINC) $(CPPFLAGS) $(NVCUFLAGS) --compiler-options "$(CXXFLAGS)" -o $@ $< -Lbuild/lib $(LIBLINK) $(LDFLAGS) -lcurand + @$(NVCC) $(MPIFLAGS) -M $(TSTINC) $(CPPFLAGS) $(NVCUFLAGS) --compiler-options "$(CXXFLAGS)" $< -Lbuild/lib $(LIBLINK) $(LDFLAGS) -lcurand > $(@:%=%.d.tmp) @sed "0,/^.*:/s//$(subst /,\/,$@):/" $(@:%=%.d.tmp) > $(@:%=%.d) @sed -e 's/.*://' -e 's/\\$$//' < $(@:%=%.d.tmp) | fmt -1 | \ sed -e 's/^ *//' -e 's/$$/:/' >> $(@:%=%.d) -- cgit v1.2.3