Skip to content

Commit

Permalink
Merge pull request #109 from lean-dojo/peiyang
Browse files Browse the repository at this point in the history
Fix CMake flags
  • Loading branch information
Peiyang-Song authored Aug 14, 2024
2 parents e5a993a + f0e416d commit 923f5c8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ target libopenblas pkg : FilePath := do


def getCt2CmakeFlags : IO (Array String) := do
let mut flags := #["-DBUILD_CLI=OFF", "-DOPENMP_RUNTIME=NONE", "-DWITH_DNNL=OFF", "-DWITH_MKL=OFF"]
let mut flags := #["-DOPENMP_RUNTIME=NONE", "-DWITH_MKL=OFF"]

match getOS! with
| .macos => flags := flags ++ #["-DWITH_ACCELERATE=ON", "-DWITH_OPENBLAS=OFF"]
| .linux => flags := flags ++ #["-DWITH_ACCELERATE=OFF", "-DWITH_OPENBLAS=ON", "-DOPENBLAS_INCLUDE_DIR=../../OpenBLAS", "-DOPENBLAS_LIBRARY=../../OpenBLAS/libopenblas.so"]

if ← useCUDA then
flags := flags ++ #["-DWITH_CUDA=ON", "-DWITH_CUDNN=ON"]
else
flags := flags ++ #["-DWITH_CUDA=OFF", "-DWITH_CUDNN=OFF"]
-- [TODO] Temporary fix: Do not use CUDA even if it is available.
-- if ← useCUDA then
-- flags := flags ++ #["-DWITH_CUDA=ON", "-DWITH_CUDNN=ON"]
-- else
-- flags := flags ++ #["-DWITH_CUDA=OFF", "-DWITH_CUDNN=OFF"]

return flags

Expand Down

0 comments on commit 923f5c8

Please sign in to comment.