cmetrics icon indicating copy to clipboard operation
cmetrics copied to clipboard

add build instructions

Open nicolasparada opened this issue 3 years ago • 11 comments

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).

nicolasparada avatar Nov 16 '22 17:11 nicolasparada

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.

nicolasparada avatar Nov 16 '22 18:11 nicolasparada

The missing cfl issue should be fixed by https://github.com/fluent/cfl/pull/24.

cosmo0920 avatar Nov 16 '22 18:11 cosmo0920

@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?

cosmo0920 avatar Nov 16 '22 18:11 cosmo0920

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.

nicolasparada avatar Nov 17 '22 20:11 nicolasparada

@cosmo0920 Still getting the same error btw.

nicolasparada avatar Nov 21 '22 19:11 nicolasparada

Try git submodule foreach git pull origin master and then cpack -G productbuild.

cosmo0920 avatar Nov 22 '22 07:11 cosmo0920

That did the trick. Thanks.

nicolasparada avatar Nov 22 '22 17:11 nicolasparada

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.

nicolasparada avatar Nov 22 '22 17:11 nicolasparada

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

gabrielbussolo avatar Nov 24 '22 14:11 gabrielbussolo

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....

cosmo0920 avatar Nov 26 '22 04:11 cosmo0920

Would be nice to have releases for mac. But instructions to manually build will do for now.

nicolasparada avatar Nov 26 '22 06:11 nicolasparada