Skip to content
Snippets Groups Projects
Commit f678e6d9 authored by cmaffeo2's avatar cmaffeo2
Browse files

Made revision be automatically included in build

parent a361c004
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
include ./findcudalib.mk
INCLUDE = $(CUDA_PATH)/include
ifeq ($(dbg),1)
NV_FLAGS += -g -G
EX_FLAGS = -g -O0 -m$(OS_SIZE)
......@@ -9,6 +10,20 @@ else
EX_FLAGS = -O3 -m$(OS_SIZE)
endif
## Determine the version; TODO add tags for versions
ifndef (VERSION)
ifeq ($(shell git status >& /dev/null && echo true),true)
VERSION:=git rev. $(shell git rev-parse HEAD | sed 's/\(.\{8\}\).*/\1/')
ifneq ($(shell git status --porcelain),)
VERSION:=$(VERSION) (modified)
endif
else
VERSION:=unknown (not compiled in a git repository)
endif
endif
CC_FLAGS += -DVERSION="\"$(VERSION)\""
CC_FLAGS += -I$(CUDA_PATH)/include
CC_FLAGS += -Wall -Wno-write-strings -std=c++0x -pedantic # TODO: test on Mac OSX and other architectures
NV_FLAGS += -lineinfo
......
......@@ -31,7 +31,12 @@ int main(int argc, char* argv[]) {
return 0;
} else if (argc == 2 && (strcmp(argv[1], "--version") == 0)) {
// --version
printf("%s Nov 2016 (alpha)\n", argv[0]);
// printf("%s Nov 2016 (alpha)\n", argv[0]);
#ifdef VERSION
printf("%s %s\n", argv[0], VERSION);
#else
printf("%s Nov 2016 (alpha)\n", argv[0]);
#endif
return 0;
} else if (argc == 2 && (strcmp(argv[1], "--info") == 0)) {
// --info
......@@ -46,8 +51,7 @@ int main(int argc, char* argv[]) {
// printf("Everything's great when you're...BrownTown\n");
printf(" –––––––––––––––––––––––––––––––––––––––––––––\n");
printf(" | Atomic Resolution Brownian Dynamics |\n");
printf(" –––––––––––––––––––––––––––––––––––––––––––––\n\n");
printf(" –––––––––––––––––––––––––––––––––––––––––––––\n");
GPUManager::init();
size_t n_gpus = max(GPUManager::gpus.size(), 1lu);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment