Skip to content

Commit 904aaeb

Browse files
committed
Update instructions
1 parent a32926a commit 904aaeb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,19 @@ ifneq ($(filter armv8%,$(UNAME_M)),)
120120
# Raspberry Pi 4
121121
CFLAGS += -mfp16-format=ieee -mno-unaligned-access
122122
endif
123-
ifeq ($(BUILD_TYPE),cuda)
123+
124+
ifeq ($(BUILD_TYPE),cublas)
124125
EXTRA_LIBS=
125126
CMAKE_ARGS+="-DLLAMA_CUBLAS=ON"
126127
EXTRA_TARGETS+=llama.cpp/ggml-cuda.o
127128
endif
128129

130+
ifeq ($(BUILD_TYPE),openblas)
131+
EXTRA_LIBS=
132+
CMAKE_ARGS+="-DLLAMA_OPENBLAS=ON"
133+
EXTRA_TARGETS+=
134+
endif
135+
129136
#
130137
# Print build information
131138
#

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t
3636
To build and run with OpenBLAS, for example:
3737

3838
```
39-
CMAKE_ARGS="-DLLAMA_OPENBLAS=ON" make libbinding.a
40-
LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags openblas ./examples -m "/model/path/here" -t 14
39+
BUILD_TYPE=openblas make libbinding.a
40+
CGO_LDFLAGS="-lopenblas" LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags openblas ./examples -m "/model/path/here" -t 14
4141
```
4242

4343
## GPU
4444

4545
To build with CuBLAS:
4646

4747
```
48-
CMAKE_ARGS="-DLLAMA_CUBLAS=ON" make libbinding.a
49-
LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags cublas ./examples -m "/model/path/here" -t 14
48+
BUILD_TYPE=cublas make libbinding.a
49+
CGO_LDFLAGS="-lcublas -lcudart -L/usr/local/cuda/lib64/" LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t 14
5050
```
5151

5252
Enjoy!

0 commit comments

Comments
 (0)