aboutsummaryrefslogtreecommitdiff
path: root/examples/main/main.cpp
diff options
context:
space:
mode:
authorDannyDaemonic <DannyDaemonic@gmail.com>2023-05-01 09:23:47 -0700
committerGitHub <noreply@github.com>2023-05-01 18:23:47 +0200
commitf4cef87edfd1b2f8d5befd4fde54ca2e03987bea (patch)
treeb63939423df54fa5714e964e19e830811a990064 /examples/main/main.cpp
parent58b367c2d757c0ea12aec672382462b42204c724 (diff)
Add git-based build information for better issue tracking (#1232)
* Add git-based build information for better issue tracking * macOS fix * "build (hash)" and "CMAKE_SOURCE_DIR" changes * Redo "CMAKE_CURRENT_SOURCE_DIR" and clearer build messages * Fix conditional dependency on missing target * Broke out build-info.cmake, added find_package fallback, and added build into to all examples, added dependencies to Makefile * 4 space indenting for cmake, attempt to clean up my mess in Makefile * Short hash, less fancy Makefile, and don't modify build-info.h if it wouldn't change it
Diffstat (limited to 'examples/main/main.cpp')
-rw-r--r--examples/main/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 78fc9a1..7dc1005 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -5,6 +5,7 @@
#include "common.h"
#include "llama.h"
+#include "build-info.h"
#include <cassert>
#include <cinttypes>
@@ -81,11 +82,13 @@ int main(int argc, char ** argv) {
"expect poor results\n", __func__, params.n_ctx);
}
+ fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
+
if (params.seed <= 0) {
params.seed = time(NULL);
}
- fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
+ fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
std::mt19937 rng(params.seed);
if (params.random_prompt) {