Skip to content

Commit

Permalink
Add proposed linker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s-clerc committed Feb 23, 2022
1 parent 67e7b4a commit 373f903
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -64,7 +64,7 @@ $(test_build_root)/%.o: test/%.cpp

$(test_build_root)/test_main: test/test_main.cpp $(test_target) $(gnn_lib)
$(dir_guard)
$(CXX) $(CXXFLAGS) -MMD -o $@ $(filter %.o, $^) -L$(lib_dir) -lgnn $(LDFLAGS) -lpthread -lgtest
$(CXX) $(CXXFLAGS) -MMD -o $@ $(filter %.o, $^) $(LDFLAGS) -L$(lib_dir) -lgnn -lpthread -lgtest

clean:
rm -rf $(build_root)
Expand Down
4 changes: 2 additions & 2 deletions examples/mnist/Makefile
Expand Up @@ -12,14 +12,14 @@ endif

gnn_lib := $(lib_dir)/libgnn.a

include_dirs := $(CUDA_HOME)/include $(MKL_ROOT)/include $(GNN_HOME)/include include
include_dirs := $(CUDA_HOME)/include $(MKL_ROOT)/include $(TBB_ROOT)/include $(GNN_HOME)/include include
CXXFLAGS += $(addprefix -I,$(include_dirs))

all: build/mnist

build/mnist: mnist.cpp $(gnn_lib)
$(dir_guard)
$(CXX) $(CXXFLAGS) -o $@ $^ -L$(lib_dir) -lgnn $(LDFLAGS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) -L$(lib_dir) -lgnn

clean:
rm -rf build
20 changes: 20 additions & 0 deletions make_common
@@ -0,0 +1,20 @@
dir_guard = @mkdir -p $(@D)

INTEL_ROOT := ~/intel/oneapi
MKL_ROOT = $(INTEL_ROOT)/mkl/latest
TBB_ROOT = $(INTEL_ROOT)/tbb/latest
USE_GPU = 1


FIND := find
CXX := g++
CXXFLAGS += -Wall -O3 -std=c++14
LDFLAGS += -lm -lmkl_rt -ltbb -L$(TBB_ROOT)/lib/intel64/gcc4.8/
ifeq ($(USE_GPU), 1)
#CUDA_HOME := /usr/local/cuda-8.0
NVCC := $(CUDA_HOME)/bin/nvcc
NVCCFLAGS += --default-stream per-thread
LDFLAGS += -L$(CUDA_HOME)/lib64 -lcudart -lcublas -lcurand -lcusparse
endif

CUDA_ARCH := -gencode arch=compute_61,code=sm_61

0 comments on commit 373f903

Please sign in to comment.