potatosalad / erlang-libdecaf

ed448goldilocks (libdecaf) NIF with timeslice reductions for Erlang and Elixir.
MIT License
29 stars 16 forks source link

OTP23 support - compile fails #9

Closed mpinkston closed 2 years ago

mpinkston commented 4 years ago

compilation on OTP23 fails with the error message

ld: library not found for -lerl_interface

I think that was deprecated and appears to be fixable by simply removing that line in the Makefile

LDLIBS += -L"$(ERL_INTERFACE_LIB_DIR)" \
    -lerl_interface \
    -lei \
    $(ED448GOLDILOCKS_OBJECTS)

to

LDLIBS += -L"$(ERL_INTERFACE_LIB_DIR)" \
    -lei \
    $(ED448GOLDILOCKS_OBJECTS)

(though I wasn't quite sure how to make this backwards-compatible)

ghost commented 4 years ago

I am also having the same with

Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Elixir 1.10.3 (compiled with Erlang/OTP 21)

OS Ubuntu 20.0

Error:

LD     libdecaf_nif.so
/usr/bin/ld: cannot find -lerl_interface
collect2: error: ld returned 1 exit status
talklittle commented 3 years ago

I think it is safe to remove that line -lerl_interface. Playing around with this library, I've found that it requires OTP 20+ to get all test cases to pass, and OTP 19+ to get any of the tests to pass at all.

On OTP 18.3.4, tests fail with error /build/libdecaf/c_src/nif/libdecaf_nif.c:184:54: error: use of undeclared identifier 'ERL_NIF_DIRTY_JOB_CPU_BOUND'. The failures happen with or without -lerl_interface.

The presence of the -lerl_interface line in the Makefile does not appear to make a difference on OTP 19+ for this library. I guess the -lei already provides all the symbols necessary.


To get the tests to run, I had to make a few changes:

make clean && make docker-setup DOCKER_OTP_VERSION=19.3.6 && make docker-test DOCKER_OTP_VERSION=19.3.6
kpy3 commented 3 years ago

Here is another try to deal with removed erl_interface, what should work for Erlang prior 23 and also for later releases: https://github.com/potatosalad/erlang-libdecaf/pull/11.

potatosalad commented 2 years ago

This should be fixed as part of libdecaf version 2.0.0.