Skip to content

Instantly share code, notes, and snippets.

@Neelam96
Created October 3, 2021 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neelam96/a2a86b6bccc726fa1c2a99bccd9d1488 to your computer and use it in GitHub Desktop.
Save Neelam96/a2a86b6bccc726fa1c2a99bccd9d1488 to your computer and use it in GitHub Desktop.
Example makefile for compiling GAP benchmark
INCLUDE_DIRS = -I./src -I/opt/intel/oneapi/vtune/2021.1.1/include
CXX_FLAGS += -g -std=c++11 -O3 -Wall $(INCLUDE_DIRS)
PAR_FLAG = -fopenmp
LDFLAGS = -L/opt/intel/oneapi/vtune/2021.1.1/lib64 -littnotify -ldl
# Changes for Makefile to work
# 1. -ldl flag added: Makefile:26: recipe for target 'bfs' failed
# ERROR that occured: make: *** [bfs] Error 1
# make: *** Waiting for unfinished jobs....
# /usr/bin/ld: /opt/intel/oneapi/vtune/2021.1.1/lib64/libittnotify.a(ittnotify_static.o): undefined reference to symbol 'dlerror@@GLIBC_2.2.5'
# //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
# collect2: error: ld returned 1 exit status
# stackoverflow link: https://stackoverflow.com/questions/33747874/glfw3-error-dso-missing-from-command-line
# 2. -static flag removed:
# ERROR that occured: /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.a(target.o): In function `gomp_target_init':
# (.text+0x8b): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
# stackoverflow link to comments: https://stackoverflow.com/questions/41048581/static-compilation-with-gcc-openmp
# 3. -L<path to library> -lxyz :
# <path-to-library> is the path to static library named libxyz.a so specify the name as -lxyz
ifneq (,$(findstring icpc,$(CXX)))
PAR_FLAG = -openmp
endif
ifneq (,$(findstring sunCC,$(CXX)))
CXX_FLAGS = -std=c++11 -xO3 -m64 -xtarget=native
PAR_FLAG = -xopenmp
endif
ifneq ($(SERIAL), 1)
CXX_FLAGS += $(PAR_FLAG)
endif
KERNELS = bc bfs cc cc_sv pr sssp tc
SUITE = $(KERNELS) converter
.PHONY: all
all: $(SUITE)
% : src/%.cc src/*.h
$(CXX) $(CXX_FLAGS) $< -o $@ $(LDFLAGS)
# Testing
include test/test.mk
# Benchmark Automation
include benchmark/bench.mk
.PHONY: clean
clean:
rm -f $(SUITE) test/out/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment