Skip to content

Commit

Permalink
Consider default C++ compiler in Makefile, defaulting to g++.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmont-dev committed Sep 1, 2024
1 parent 7e100c9 commit 57bd8fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Check if a default C++ compiler exists, otherwise use g++
CXX ?= g++

all: examples test-cpp11 test-cpp14 test-cpp20
examples: examples/main.cpp
mkdir -p build
g++ examples/main.cpp -Iinclude -o build/examples -std=c++11 -pthread -latomic
$(CXX) examples/main.cpp -Iinclude -o build/examples -std=c++11 -pthread -latomic
test: test-cpp11
test-cpp11: test/test.cpp
mkdir -p build
g++ test/test.cpp -Iinclude -Itest -o build/test -std=c++11 -pthread -latomic
$(CXX) test/test.cpp -Iinclude -Itest -o build/test -std=c++11 -pthread -latomic
test-cpp14: test/test.cpp
mkdir -p build
g++ test/test.cpp -Iinclude -Itest -o build/test-cpp14 -std=c++14 -pthread -latomic
$(CXX) test/test.cpp -Iinclude -Itest -o build/test-cpp14 -std=c++14 -pthread -latomic
test-cpp20: test/test.cpp
mkdir -p build
g++ test/test.cpp -Iinclude -Itest -o build/test-cpp20 -std=c++2a -pthread -latomic
$(CXX) test/test.cpp -Iinclude -Itest -o build/test-cpp20 -std=c++2a -pthread -latomic
clean:
rm -rf build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ Debug logging for requests and replies to the server can easily be turned on and
```C++
ollama::show_requests(true);
ollama::show_replies(true);
```
```

### Manual Requests
For those looking for greater control of the requests sent to the ollama server, manual requests can be created through the `ollama::request` class. This class extends `nlohmann::json` and can be treated as a standard JSON object.
Expand Down

0 comments on commit 57bd8fe

Please sign in to comment.