add build instructions
Add build instructions since there is no release offering for macos.
The steps I had do do were:
- Install cpack (cmake)
PATH="/Applications/CMake.app/Contents/bin:$PATH"
- Update bison
brew install bison
export PATH="$(brew --prefix bison)/bin:$PATH"
git clone https://github.com/fluent/cmetrics.git
git submodule update
git submodule update --init
git submodule foreach git pull origin master
cd build
cmake -DCPACK_GENERATOR=productbuild ..
make
cpack -G productbuild
Then double click on the generated .pkg file.
cmetrics-0.7.0-apple.pkg.zip (Built at 22 January 2024).
Sorry. That doesn't totally installs it for usage. Now if you try to use the Go module github.com/calyptia/cmetrics-go it will raise the error:
In file included from ../../go/pkg/mod/github.com/calyptia/[email protected]/cmetrics_darwin.go:9:
/usr/local/include/cmetrics/cmetrics.h:40:10: error: 'cfl/cfl.h' file not found with <angled> include; use "quotes" instead
#include <cfl/cfl.h>
^~~~~~~~~~~
"cfl/cfl.h"
In file included from ../../go/pkg/mod/github.com/calyptia/[email protected]/cmetrics_darwin.go:9:
In file included from /usr/local/include/cmetrics/cmetrics.h:40:
/usr/local/include/cmetrics/cfl/cfl.h:27:10: fatal error: 'cfl/cfl_info.h' file not found
#include <cfl/cfl_info.h>
^~~~~~~~~~~~~~~~
2 errors generated.
The missing cfl issue should be fixed by https://github.com/fluent/cfl/pull/24.
@nicolasparada I'd appreciated if you could try out to apply the above patch into bundled cfl. Is this possible to solve your header issue?
I tried with pulling latest code and a git submodule update --init again and then followed the steps to build it. Installed the generated .pkg and now the error changed to:
# github.com/calyptia/cmetrics-go
In file included from ../../go/pkg/mod/github.com/calyptia/[email protected]/cmetrics_darwin.go:9:
In file included from /usr/local/include/cmetrics/cmetrics.h:40:
In file included from /usr/local/include/cfl/cfl.h:33:
/usr/local/include/cfl/cfl_hash.h:26:10: fatal error: '../../lib/xxhash/xxh3.h' file not found
#include "../../lib/xxhash/xxh3.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
@cosmo0920 Still getting the same error btw.
Try git submodule foreach git pull origin master and then cpack -G productbuild.
That did the trick. Thanks.
As a note, I got a warning while running make.
/Users/nicolasparada/code/cmetrics/src/cmt_decode_msgpack.c:998:21: warning: incompatible pointer types assigning to 'struct cmt_counter *' from 'struct counter *' [-Wincompatible-pointer-types]
counter = (struct counter *) decode_context->map->parent;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
i had same issue, but i could solve following the steps here... cant we have a .pkg like we have the .deb on each release? im ignorant on it but we dont have ir right know bcz we need macos to build it? @cosmo0920 @edsiper
Hmm..., it's reasonable to put macOS installer on releases. But, for now, there is no CI instances for M1 Mac. If we decide to release macOS installers, we have to upload macOS installer for M1/M2 manually....
Would be nice to have releases for mac. But instructions to manually build will do for now.