Moved no-as-needed flag to link rule.

Avoids link errors for tests linked with nvcc.
This commit is contained in:
Nathan Luehr 2016-04-19 14:51:03 -07:00
parent 0d4f8f4e95
commit 03df4c7759
2 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra
CXXFLAGS += -Wall -Wextra
endif
LDFLAGS := -Wl,--no-as-needed -L$(CUDA_HOME)/lib64 -lcudart
LDFLAGS := -L$(CUDA_HOME)/lib64 -lcudart
MPIFLAGS := -I$(MPI_HOME)/include -L$(MPI_HOME)/lib -lmpi
TSTINC := -Ibuild/include -Itest/include
@ -88,7 +88,7 @@ lib : $(INCTARGETS) $(LIBDIR)/$(LIBTARGET)
$(LIBDIR)/$(LIBTARGET) : $(LIBOBJ)
@printf "Linking %-25s\n" $@
@mkdir -p $(LIBDIR)
@$(GPP) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(LIBSONAME) -o $@ $(LDFLAGS) $(LIBOBJ)
@$(GPP) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,--no-as-needed -Wl,-soname,$(LIBSONAME) -o $@ $(LDFLAGS) $(LIBOBJ)
@ln -sf $(LIBSONAME) $(LIBDIR)/$(LIBNAME)
@ln -sf $(LIBTARGET) $(LIBDIR)/$(LIBSONAME)

View File

@ -31,6 +31,7 @@
#define SRC_TEST_UTILITIES_H_
#include <curand.h>
#include <string>
#define CUDACHECK(cmd) do { \
cudaError_t e = cmd; \