Comments (38)
Also an issue on Erlang 22.0.6
unset LDFLAGS
unset LD_LIBRARY_PATH
unset CFLAGS
and it compiled fine.
from prometheus_process_collector.
@andrelip @mberrueta I think your problem may be this:
-L/usr/local/opt/openssl/lib
I had CPPFLAGS
and LDFLAGS
set in my environment for compiling in support for MySQL, and their being set was preventing the prometheus_process_collector
Makefile
from setting them correctly itself. I unset
both env vars and now this compiles fine.
from prometheus_process_collector.
@andrelip have you tried / tested - can this be closed ?
from prometheus_process_collector.
same thing here.
#define ATOM(Id, Value) \
{ \
Id = enif_make_atom(env, Value); \
}
there is any way to include it?
the code is https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_nif.c
but no idea how to include / reference
from prometheus_process_collector.
I tried to help here, but my no knowledge in c make it impossible
here there is more details if helps in any way
matiasberrueta@mac:~/c/p/w|update_libs⚡*?
➤ env DEBUG=1 mix deps.compile prometheus_process_collector
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
{bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling prometheus_process_collector
===> sh info:
cwd: "/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector"
cmd: make -C c_src
===> opts: [use_stdout,
{cd,"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector"},
{env,[{"REBAR_DEPS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/lib"},
{"REBAR_BUILD_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default"},
{"REBAR_ROOT_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/."},
{"REBAR_CHECKOUTS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_checkouts"},
{"REBAR_PLUGINS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/plugins"},
{"REBAR_GLOBAL_CONFIG_DIR",
"/Users/matiasberrueta/.config/rebar3"},
{"REBAR_GLOBAL_CACHE_DIR",
"/Users/matiasberrueta/.cache/rebar3"},
{"REBAR_TEMPLATE_DIR",
"/Users/matiasberrueta/.config/rebar3/templates"},
{"REBAR_APP_DIRS",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/apps/*:/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/lib/*:/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/."},
{"REBAR_SRC_DIRS",[]},
{"ERLANG_ERTS_VER","10.3.4"},
{"ERLANG_ROOT_DIR",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang"},
{"ERL",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang/bin/erl"},
{"ERLC",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang/bin/erlc"},
{"ERLANG_ARCH","64"},
{"ERLANG_TARGET","21.3.7-x86_64-apple-darwin18.5.0-64"},
{"ERLANG_LIB_DIR_erl_interface",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang/lib/erl_interface-3.11.2"},
{"ERLANG_LIB_VER_erl_interface","3.11.2"}]},
{abort_on_error,"Hook for compile failed!\n"}]
===> Port Cmd: make -C c_src
Port Opts: [{cd,"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector"},
{env,[{"REBAR_DEPS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/lib"},
{"REBAR_BUILD_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default"},
{"REBAR_ROOT_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/."},
{"REBAR_CHECKOUTS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_checkouts"},
{"REBAR_PLUGINS_DIR",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/plugins"},
{"REBAR_GLOBAL_CONFIG_DIR",
"/Users/matiasberrueta/.config/rebar3"},
{"REBAR_GLOBAL_CACHE_DIR",
"/Users/matiasberrueta/.cache/rebar3"},
{"REBAR_TEMPLATE_DIR",
"/Users/matiasberrueta/.config/rebar3/templates"},
{"REBAR_APP_DIRS",
"/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/apps/*:/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/lib/*:/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/_build/default/."},
{"REBAR_SRC_DIRS",[]},
{"ERLANG_ERTS_VER","10.3.4"},
{"ERLANG_ROOT_DIR",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang"},
{"ERL","/usr/local/Cellar/erlang/21.3.7/lib/erlang/bin/erl"},
{"ERLC",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang/bin/erlc"},
{"ERLANG_ARCH","64"},
{"ERLANG_TARGET","21.3.7-x86_64-apple-darwin18.5.0-64"},
{"ERLANG_LIB_DIR_erl_interface",
"/usr/local/Cellar/erlang/21.3.7/lib/erlang/lib/erl_interface-3.11.2"},
{"ERLANG_LIB_VER_erl_interface","3.11.2"}]},
exit_status,
{line,16384},
use_stdio,stderr_to_stdout,hide,eof]
cc prometheus_process_collector_nif.o prometheus_process_info_macos.o -L/usr/local/opt/openssl/lib -shared -L /usr/local/Cellar/erlang/21.3.7/lib/erlang/lib/erl_interface-3.11.2/lib -lerl_interface -lei -lstdc++ -o /Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/c_src/../priv/prometheus_process_collector.so
Undefined symbols for architecture x86_64:
"_enif_make_atom", referenced from:
on_load(enif_environment_t*, void**, unsigned long) in prometheus_process_collector_nif.o
"_enif_make_double", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
"_enif_make_int", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
"_enif_make_list_from_array", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
"_enif_make_long", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
"_enif_make_tuple", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
"_enif_make_ulong", referenced from:
Prometheus::get_process_info(enif_environment_t*, int, unsigned long const*) in prometheus_process_collector_nif.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/matiasberrueta/code/p/w/deps/prometheus_process_collector/c_src/../priv/prometheus_process_collector.so] Error 1
===> Hook for compile failed!
** (Mix) Could not compile dependency :prometheus_process_collector, "/Users/matiasberrueta/.mix/rebar3 bare compile --paths "/Users/matiasberrueta/code/p/w/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile prometheus_process_collector", update it with "mix deps.update prometheus_process_collector" or clean it with "mix deps.clean prometheus_process_collector"
matiasberrueta@mac:~/c/p/w|update_libs⚡*?
I tried compiling myself https://github.com/erlang/otp that has the code but I don't know what else is missing
also now is not working with the previous version neither, so not sure what else was changed :(
from prometheus_process_collector.
https://bugs.erlang.org/browse/ERL-935
with
Erlang/OTP 21 [erts-10.3.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace] Eshell V10.3.4 (abort with ^G)
fails
but with
Erlang/OTP 21 [erts-10.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Eshell V10.2 (abort with ^G)
works
from prometheus_process_collector.
Just compiled here:
Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.3 (abort with ^G)
no idea what's up.
from prometheus_process_collector.
@andrelip @mberrueta what is your mix-installed rebar3 version? You can run this:
~/.mix/rebar3 version
Please try running mix local.rebar
and trying again.
from prometheus_process_collector.
$ ~/.asdf/installs/elixir/1.8.1/.mix/rebar3 version
rebar 3.6.1 on Erlang/OTP 21 Erts 10.3.4
from prometheus_process_collector.
now it's working for me, but I don't know what solve it. I update and restart everything
from prometheus_process_collector.
@mberrueta what is your rebar3 version? I think this is actually a build tool issue, so perhaps it is worth closing the bug report in bugs.erlang.org until we can trim it down?
from prometheus_process_collector.
~/.mix/rebar3 --version
rebar 3.6.1 on Erlang/OTP 21 Erts 10.3.5
I opened a rebar issue before, but they said that wasn't related
erlang/rebar3#2064
from prometheus_process_collector.
My Makefile
skills are rusty, but I think the line at https://github.com/deadtrickster/prometheus_process_collector/blob/master/c_src/Makefile#L25 says "set LDFLAGS
if it's not already set". It probably should be appending to LDFLAGS
instead.
from prometheus_process_collector.
that's true!
from prometheus_process_collector.
@deadtrickster I'm not trying to duck the responsibility of creating a PR for my suggestion -- I'm just elbows deep in something else at the moment.
from prometheus_process_collector.
oh, no expectations at all. just agreeing.
from prometheus_process_collector.
This problem is occurring for me as well. While troubleshooting, one of my colleagues and I tried running make
on the c_src
and it fails. My colleague, whose experience with C is more extensive than mine, says it seems to him like the problem is with ld
. I have a newer version of ld
. Here is the output from running make
on the c_src
.
https://gist.github.com/clifton-mcintosh/9e5c9d546f8f45bd1d12377c1d709ed9
This is my version of ld
, which fails when running make
on the c_src
:
ld -v
@(#)PROGRAM:ld PROJECT:ld64-450.3
BUILD 18:45:16 Apr 4 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 10.0.1, (clang-1001.0.46.4) (static support for 22, runtime is 22)
TAPI support using: Apple TAPI version 10.0.1 (tapi-1001.0.4.1)
My colleague's earlier version of ld
, which works when running make
on the c_src
.
ld -v
@(#)PROGRAM:ld PROJECT:ld64-409.12
BUILD 02:04:28 Aug 14 2018
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 10.0.0, (clang-1000.10.44.2) (static support for 21, runtime is 21)
TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.10.8)
from prometheus_process_collector.
I'm also having trouble compiling.
===> Compiling prometheus_process_collector
cc prometheus_process_collector_nif.o prometheus_process_info_macos.o -arch x86_64 -flat_namespace -undefined suppress -shared -L /usr/local/Cellar/erlang/22.0.5/lib/erlang/lib/erl_interface-3.12/lib -lerl_interface -lei -lstdc++ -o /Users/acrogenesis/Library/CloudStorage/iCloud Drive/Documents/Development/valiot/valiot-jobs/deps/prometheus_process_collector/c_src/../priv/iCloud iCloud prometheus_process_collector.so
clang: error: no such file or directory: 'Drive/Documents/Development/valiot/valiot-jobs/deps/prometheus_process_collector/c_src/../priv/iCloud'
clang: error: no such file or directory: 'iCloud'
clang: error: no such file or directory: 'prometheus_process_collector.so'
make: *** [/Users/acrogenesis/Library/CloudStorage/iCloud] Error 1
===> Hook for compile failed!
~/.mix/rebar3 --version
rebar 3.6.1 on Erlang/OTP 22 Erts 10.4.4
ld -v
BUILD 10:27:00 May 27 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 11.0.0, (clang-1100.0.20.17) (static support for 23, runtime is 23)
TAPI support using: Apple TAPI version 11.0.0 (tapi-1100.0.10.2)
from prometheus_process_collector.
It seems it only fails if I'm compiling inside an iCloud Drive folder.
from prometheus_process_collector.
Also an issue on Erlang 22.0.6
from prometheus_process_collector.
@deadtrickster Created PR to fix this issue - tested on OSX / Docker (alpine) - would be sweet if it made it into a hex release.
from prometheus_process_collector.
Also fixed the issue (Elixir) where compilation fails with error message:
/code/common/horde_test/ DEBUG=1 mix compile
==> prometheus_process_collector
make: *** No targets specified and no makefile found. Stop.
could not compile dependency :prometheus_process_collector, "mix compile" failed. You can recompile this dependency with "mix deps.compile prometheus_process_collector", update it with "mix deps.update prometheus_process_collector" or clean it with "mix deps.clean prometheus_process_collector"
==> horde_test
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.
from prometheus_process_collector.
It seems that with @bryanhuntesl PR in v1.4.4 elixir_make
became a dependency.
This is a bit unfortunate for Erlang-only projects as it apparently requires some configuration of mix
and a working Elixir installation. Was this intended?
===> Compiling elixir_make
===> Error building application elixir_make:
No project builder is configured for type mix
from prometheus_process_collector.
Woops, nope. hmmm
from prometheus_process_collector.
It seems that with @bryanhuntesl PR in v1.4.4
elixir_make
became a dependency.
This is a bit unfortunate for Erlang-only projects as it apparently requires some configuration ofmix
and a working Elixir installation. Was this intended?===> Compiling elixir_make ===> Error building application elixir_make: No project builder is configured for type mix
@bieniusa - Is this analysis correct ?
There are two build systems for this project - the mix.exs used by Elixir and the rebar.config used by hex. Although I only added the dependency to the mix.exs, a dependency has been introduced for 'elixir_make' when using as a rebar3 dependency ?
@deadtrickster - how is this package published - how did the dependency creep in to rebar3 ?
from prometheus_process_collector.
@bieniusa - where/how are you using this as a dependency ?
from prometheus_process_collector.
It does not show up in rebar.config
, but hex lists it on the webpage.
from prometheus_process_collector.
I just upgraded my AntidoteDB dependencies (for some other reason) and there it showed up.
Guess it was only noticeable for me because I don't have an Elixir install on my machine.
from prometheus_process_collector.
Awww. This is going to be a nightmare to fix. If we want to have erlang and elixir support it would probably be best to dump the mix stuff completely and use rebar3 / port compiler / rebar3_publish and nothing else. The reason I came to this stuff was that build failed on Elixir projects because of the broken mix config.
from prometheus_process_collector.
What do you think @deadtrickster ?
from prometheus_process_collector.
Or make the 'elixir_make' dependency ':optional' - but that will create headaches for the Elixir people
from prometheus_process_collector.
This is going to be a nightmare to fix. If we want to have erlang and elixir support it would probably be best to dump the mix stuff completely and use rebar3 / port compiler / rebar3_publish and nothing else.
Yup, I would say this is the way to go. elixir_make
is meant to be an alternative to the conveniences provided by rebar for handling native code anyway. So both should take you to the same place.
from prometheus_process_collector.
published 1.4.5 without mix
from prometheus_process_collector.
Successfully builds on OSX (clang/homebrew) + docker (elixir:1.8.1 (some debian)) - thanks @deadtrickster
from prometheus_process_collector.
I had the same issue today. Elixir 1.9.1 with Erlang/OTP 22.
I spotted the openssl part L/usr/local/opt/openssl/lib
in @andrelip output. Commented them out in my .zshrc and it would compile. But, I can't seem to reproduce it ... ?
from prometheus_process_collector.
Good to close this ticket now ?
from prometheus_process_collector.
I'm going to vote "yes", with the qualification that I haven't used Elixir 1.8, OTP 21, or macOS 10.14 in some time.
from prometheus_process_collector.
Yes!
from prometheus_process_collector.
Related Issues (20)
- Doesn't automatically capture metrics HOT 4
- Conflicting dependencies with `prometheus_ex` HOT 5
- Version bump and release? HOT 1
- {on_load_function_failed,prometheus_process_collector} error HOT 16
- Missing metrics from Process Collector - Rabbit 3.7.7-1 HOT 1
- mix does not compile prometheas_process_collector 1.4.0 correctly HOT 2
- Process metrics not available HOT 1
- Compiling issues with Linux Ubuntu x86_64 Linux docker HOT 1
- The on_load function for module prometheus_process_collector returned :error HOT 30
- Compiling problems on elixir:1.9.1-alpine docker image HOT 5
- OTP 23 has removed -lerl_interface
- Always builds x86_64 binary on Darwin
- Does prometheus_process_collector support debian:stretch(ARM)
- Update version HOT 9
- Using rebar3_auto plugin (to auto-reload code) gives error `Upgrade not supported by this NIF library.`
- `erlang:load_nif` fails with `Library version (2.11) not compatible (with 2.10)` HOT 9
- module :prometheus_process_collector is not available HOT 6
- Document how to build with Docker HOT 5
- Erlang VM segfaults in `get_process_info () from prometheus_process_collector-1.3.1/priv/prometheus_process_collector.so` at startup HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus_process_collector.