Closed alexandrkirilov closed 4 months ago
The solution that is Ok for me was to change in rebar.config "make" on "gmake". Change this lines:
{pre_hooks, [{compile, "make -C c_src"}]}.
{post_hooks, [{clean, "make -C c_src clean"}]}.
on this lines:
{pre_hooks, [{compile, "gmake -C c_src"}]}.
{post_hooks, [{clean, "gmake -C c_src clean"}]}.
Could you please check if it builds using the latest master branch?
$ uname -a FreeBSD server.domain 14.0-RELEASE-p5 FreeBSD 14.0-RELEASE-p5 #0: Tue Feb 13 23:37:36 UTC 2024 @.***:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Could you check if the master branch works in your environment now?
Still not working
$ REBAR_BASE_DIR=/home/erlexec rebar3 compile ===> Fetching rebar3_hex v7.0.7 ===> Fetching hex_core v0.8.4 ===> Fetching verl v1.1.1 ===> Analyzing applications... ===> Compiling hex_core ===> Compiling verl ===> Compiling rebar3_hex ===> Fetching rebar3_ex_doc v0.2.22 ===> Analyzing applications... ===> Compiling rebar3_ex_doc ===> Verifying dependencies... gmake: Entering directory '/home/erlexec/c_src' c++: error: unknown argument: '-print-sysroot' c++: error: no input files c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o ei++.o ei++.cpp c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec.o exec.cpp c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec_impl.o exec_impl.cpp mkdir -p /home/erlexec/priv/x86_64-unknown-freebsd14.0/ mkdir -p "/home/erlexec/priv/x86_64-unknown-freebsd14.0/" c++ ei++.o exec.o exec_impl.o -L/usr/local/lib/erlang/lib/erl_interface-5.3.2/lib -lei -o /home/erlexec/priv/x86_64-unknown-freebsd14.0/exec-port gmake: Leaving directory '/home/erlexec/c_src' make: "/home/erlexec/c_src/Makefile" line 19: Invalid line type make: "/home/erlexec/c_src/Makefile" line 21: Unknown modifier "format("~s\n", [erlang" make: "/home/erlexec/c_src/Makefile" line 21: Unknown modifier "system_info(system_architecture"
There was just cloning your repository and start rebar3 command. It's not choosing compiler correctly. Only my version of rebar config works for me. You could test it by your own in VirtualBox.
Here the output with my config:
$ REBAR_BASE_DIR=/home/Build/erlexec rebar3 compile
===> Fetching rebar3_hex v7.0.7
===> Fetching hex_core v0.8.4
===> Fetching verl v1.1.1
===> Analyzing applications...
===> Compiling hex_core
===> Compiling verl
===> Compiling rebar3_hex
===> Fetching rebar3_ex_doc v0.2.22
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
gmake: Entering directory '/home/erlexec/c_src'
c++: error: unknown argument: '-print-sysroot'
c++: error: no input files
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o ei++.o ei++.cpp
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec.o exec.cpp
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec_impl.o exec_impl.cpp
mkdir -p "/home/erlexec/priv/x86_64-unknown-freebsd14.0/"
c++ ei++.o exec.o exec_impl.o -L/usr/local/lib/erlang/lib/erl_interface-5.3.2/lib -lei -o /home/erlexec/priv/x86_64-unknown-freebsd14.0/exec-port
gmake: Leaving directory '/home/erlexec/c_src'
===> Analyzing applications...
===> Compiling erlexec
I believe this time I fixed the issue. Please check again.
It works for me now
$ REBAR_BASE_DIR=/home/Build/erlexec rebar3 compile
===> Fetching rebar3_hex v7.0.7
===> Fetching hex_core v0.8.4
===> Fetching verl v1.1.1
===> Analyzing applications...
===> Compiling hex_core
===> Compiling verl
===> Compiling rebar3_hex
===> Fetching rebar3_ex_doc v0.2.22
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
gmake: Entering directory '/home/erlexec/c_src'
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o ei++.o ei++.cpp
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec.o exec.cpp
c++ -g -std=c++11 -finline-functions -Wall -DHAVE_PTRACE -MMD -DUSE_POLL=1 -O3 -DNDEBUG -DHAVE_SETRESUID -DHAVE_PIPE2 -I/usr/local/lib/erlang/erts-13.2.2.4/include -I/usr/local/lib/erlang/lib/erl_interface-5.3.2/include -c -o exec_impl.o exec_impl.cpp
mkdir -p /home/erlexec/priv/x86_64-unknown-freebsd14.0/
mkdir -p "/home/erlexec/priv/x86_64-unknown-freebsd14.0/"
c++ ei++.o exec.o exec_impl.o -L/usr/local/lib/erlang/lib/erl_interface-5.3.2/lib -lei -o /home/erlexec/priv/x86_64-unknown-freebsd14.0/exec-port
gmake: Leaving directory '/home/erlexec/c_src'
===> Analyzing applications...
===> Compiling erlexec
Everything is Ok for me. Thank you so much!
Hello!
There were attempt to build Erlexec on FreeBSD:
$ freebsd-version
14.0-RELEASE-p5
The command to build is:
$ git clone https://github.com/saleyn/erlexec.git erlexec
$ cd erlexec
$ rebar3 compile
This command resulting this error:
$ rebar3 compile
===> Fetching rebar3_hex v7.0.7
===> Fetching hex_core v0.8.4
===> Fetching verl v1.1.1
===> Analyzing applications...
===> Compiling hex_core
===> Compiling verl
===> Compiling rebar3_hex
===> Fetching rebar3_ex_doc v0.2.22
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> Verifying dependencies...
make: "/home/erlexec/c_src/Makefile" line 19: Invalid line type
make: "/home/erlexec/c_src/Makefile" line 21: Unknown modifier "format("~s\n", [erlang"
make: "/home/erlexec/c_src/Makefile" line 21: Unknown modifier "system_info(system_architecture"