about summary refs log tree commit diff
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua37
1 files changed, 25 insertions, 12 deletions
diff --git a/premake5.lua b/premake5.lua
index 40aaa01..9229800 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,14 +1,15 @@
 -- Build with
 --
---   premake5 gmake2 && make verbose=1 gemmalib -j 8
+--   make clean && rm build -rf
+--   premake5 gmake && make verbose=1 gemmalib -j 8
 --
 -- Including bin
 --
---   premake5 gmake2 && make verbose=1 config=debug -j 8 && LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib ./build/bin/Debug/gemma
+--   premake5 gmake && make verbose=1 config=debug gemma -j 8 && time LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib ./test/runner
 --
 -- Or
 --
---   premake5 gmake2 && make verbose=1 config=release
+--   premake5 gmake && make verbose=1 config=release -j 8 gemma && LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib ./build/bin/Release/gemma
 --
 -- Run
 --
@@ -19,6 +20,9 @@
 --   env LD_LIBRARY_PATH=./build/bin/Debug/:$GUIX_ENVIRONMENT/lib guile
 --   (load-extension "libgemmalib" "init_module")
 
+local pkg_cpp_flags = os.outputof("pkg-config --cflags openblas guile-3.0 gsl zlib")
+local pkg_linker_flags = os.outputof("pkg-config --libs openblas guile-3.0 gsl zlib")
+
 workspace "PanGemma"
    configurations { "Debug", "Release" }
 
@@ -31,35 +35,44 @@ workspace "PanGemma"
 
    files { "src/*.h src/*.c src/**.hpp", "src/**.cpp" }
    removefiles { "src/main.cpp" }
-   includedirs { "src/", os.getenv('GUIX_ENVIRONMENT') .. "/include/guile/3.0" }
-
-   links { "gsl", "z", "openblas" }
+   includedirs { "src/" }
 
    filter "configurations:Debug"
       defines { "DEBUG" }
+      buildoptions { pkg_cpp_flags }
+      linkoptions { pkg_linker_flags }
       symbols "On"
 
    filter "configurations:Release"
-      defines { "NDEBUG" }
-      optimize "On"
+      defines { "NDEBUG", "HAVE_INLINE" }
+      buildoptions { pkg_cpp_flags }
+      linkoptions { pkg_linker_flags }
+      buildoptions { "-pthread", "-Wall" }
+      optimize "Speed"
 
 project "gemma"
    kind "ConsoleApp"
    defines { "OPENBLAS" }
    language "C++"
+   buildoptions { "-Wfatal-errors" }
    objdir "build/"
    targetdir "build/bin/%{cfg.buildcfg}"
 
-   includedirs { os.getenv("GUIX_ENVIRONMENT") .. "/include/guile/3.0" }
    files { "src/*.h src/*.c src/**.hpp", "src/**.cpp" }
    removefiles { "src/gemma_api.cpp" }
    includedirs { "src/" }
-   links { "gsl", "z", "openblas", "guile-3.0" }
+   links { "lmdb" }
 
    filter "configurations:Debug"
       defines { "DEBUG" }
+      buildoptions { pkg_cpp_flags }
+      linkoptions { pkg_linker_flags }
+      links { "profiler" }
       symbols "On"
 
    filter "configurations:Release"
-      defines { "NDEBUG" }
-      optimize "On"
+      defines { "NDEBUG", "HAVE_INLINE" }
+      buildoptions { "-pthread", "-Wall" }
+      buildoptions { pkg_cpp_flags }
+      linkoptions { pkg_linker_flags }
+      optimize "Speed"