turing-machines / mentals-ai

Agents in Markdown syntax (loops, memory and tools included)
https://x.com/mentals_ai
MIT License
348 stars 32 forks source link

Build Error ./src/core.h:30:10: fatal error: 'fmt/core.h' file not found #14

Open 0xHorace opened 5 months ago

0xHorace commented 5 months ago

on macos

fixed by specifying brew install paths in the makefile: BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib

rishi-wqd190004 commented 3 months ago

hi @0xE-acc could you share where you made the changes? I made the above changes here:

# Every folder in ./src will need to be passed to the compiler so that it can find header files
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib
INC_FLAGS := $(addprefix -I,$(BREW_INC_DIR))

Also heres the info I have been trying to run on: M1-8GB Target: arm64-apple-darwin23.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bi

rishi-wqd190004 commented 3 months ago

Also here is the complete error I have been getting when I run make:

grep: invalid option -- P usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] error: write on a pipe with no reader expr: syntax error Using compiler: g++ version mkdir -p build/./src/ g++ -DMACOS -I./src -I./src/tl -I./src/nlohmann -I./src/liboai -I./src/liboai/core -I./src/liboai/include -I./src/liboai/include/core -I./src/liboai/include/components -I./src/liboai/components -I./src/treehh -I./src/toml++ -I./src/toml++/impl -I/opt/homebrew/Cellar/poppler/24.04.0/include/poppler/cpp -I/opt/homebrew/Cellar/poppler/24.04.0/include/poppler -MMD -MP -std=c++20 -Wall -Wextra -O3 -march=native -c src/tool_registry.cpp -o build/./src/tool_registry.cpp.o In file included from src/tool_registry.cpp:1: In file included from ./src/tool_registry.h:3: ./src/core.h:36:10: fatal error: 'fmt/core.h' file not found

include <fmt/core.h>

^~~~ 1 error generated. make: *** [build/./src/tool_registry.cpp.o] Error 1

0xHorace commented 2 months ago

@rishi-wqd190004 apologies for the delay. Here's what that portion of my Makefile looks like. I just realized I added a second INC_FLAGS


INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

# Add Homebrew include directory to INC_FLAGS
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib
INC_FLAGS += -I$(BREW_INC_DIR)```