lokinet icon indicating copy to clipboard operation
lokinet copied to clipboard

Lokinet Build Error Issue on Ubuntu 18.04

Open gokulgaze opened this issue 3 years ago • 9 comments

Describe the bug Lokinet Installation Error on Ubuntu 18.04 due to filesystem incompatability from CMake Build Program.

To Reproduce Following Commands were executed as per the instructions in the Lokinet GitHub Repository.

$ sudo apt install build-essential cmake git libcap-dev libcurl4-openssl-dev libuv1-dev libsodium-dev pkg-config $ git clone --recursive https://github.com/loki-project/loki-network $ cd loki-network $ mkdir build $ cd build $ cmake .. -DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON $ make -j$(nproc)

Screenshots Or Logs Please find the output of CMakeError.log file after running the CMake Build.

Performing C++ SOURCE FILE Test filesystem_compiled failed with the following output: Change Dir: /home/ubuntu/rig100-apps/oxen-tools/loki-network/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_d3776/fast" /usr/bin/make -f CMakeFiles/cmTC_d3776.dir/build.make CMakeFiles/cmTC_d3776.dir/build make[1]: Entering directory '/home/ubuntu/rig100-apps/oxen-tools/loki-network/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_d3776.dir/src.cxx.o /usr/bin/c++ -Dfilesystem_compiled -fPIE -std=c++1z -o CMakeFiles/cmTC_d3776.dir/src.cxx.o -c /home/ubuntu/rig100-apps/oxen-tools/loki-network/build/CMakeFiles/CMakeTmp/src.cxx /home/ubuntu/rig100-apps/oxen-tools/loki-network/build/CMakeFiles/CMakeTmp/src.cxx:1:10: fatal error: filesystem: No such file or directory #include ^~~~~~~~~~~~

CMakeFiles/cmTC_30827.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_30827.dir/src.cxx.o' failed make[1]: *** [CMakeFiles/cmTC_30827.dir/src.cxx.o] Error 1 make[1]: Leaving directory '/home/ubuntu/rig100-apps/oxen-tools/loki-network/build/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_30827/fast' failed make: *** [cmTC_30827/fast] Error 2

Source file was: #include

int main() { auto cwd = std::filesystem::current_path(); return !cwd.string().empty(); }

Device and Operating system (please complete the following information):

  • OS: Ubuntu 18.04
  • Device: AWS Cloud
  • Lokinet Version number or Git commit hash:

gokulgaze avatar Jun 22 '21 18:06 gokulgaze

If you still have the output you pasted above, can you double check the lines that start with #include? I think Github ate some angle brackets...

tewinget avatar Jun 22 '21 18:06 tewinget

do you have a full build log? that would help a lot.

majestrate avatar Jun 22 '21 18:06 majestrate

You need a C++17 compiler to build lokinet, and Ubuntu 18.04's default is g++-7, which doesn't support it. Ubuntu 18.04 does come with the g++-8 package, however, which allows you to build if you export CC=gcc-8 CXX=g++-8 before building.

jagerman avatar Jun 22 '21 19:06 jagerman

(Also, if you are unaware, there is an apt repository with builds for Ubuntu and Debian versions at https://deb.oxen.io)

jagerman avatar Jun 22 '21 19:06 jagerman

do you have a full build log? that would help a lot.

Please let me attach the full build log shortly.

gokulgaze avatar Jun 22 '21 23:06 gokulgaze

You need a C++17 compiler to build lokinet, and Ubuntu 18.04's default is g++-7, which doesn't support it. Ubuntu 18.04 does come with the g++-8 package, however, which allows you to build if you export CC=gcc-8 CXX=g++-8 before building.

Please let me retry the deployment with these commands. I am also trying to setup lokinet on a macOs machine.

gokulgaze avatar Jun 22 '21 23:06 gokulgaze

you may also need libtool and automake , I need to update the readme.

majestrate avatar Jun 23 '21 10:06 majestrate

Ubuntu 20 has g++-9 installed, so I set CC and CXX:

jon@insp:~/Downloads/lokinet-v0.9.6/build$ echo $CC
gcc-9
jon@insp:~/Downloads/lokinet-v0.9.6/build$ echo $CXX
g++-9

Still have this issue while compiling on Ubuntu 20:

jon@insp:~/Downloads/lokinet-v0.9.6/build$ make -j$(nproc)
[ 88%] Built target zlib_external
[ 88%] Built target openssl_external
[ 88%] Built target sodium_external
[ 88%] Built target expat_external
[ 88%] Built target libuv_external
[ 88%] Built target genversion
[ 88%] Built target sqlite3_external
[ 88%] Built target lokinet-cryptography
[ 88%] Built target unbound_external
[ 88%] Built target zmq_external
[ 88%] Built target curl_external
[ 88%] Built target ngtcp2
[ 88%] Built target oxenmq
[ 88%] Built target cpr
[ 88%] Built target lokinet-util
[ 88%] Built target lokinet-platform
[ 88%] Built target liblokinet
[ 88%] Linking CXX executable lokinet-bootstrap
[ 88%] Built target lokinet
[ 88%] Built target lokinet-shared
[ 88%] Built target lokinet-vpn
[ 88%] Built target testAll
/usr/bin/ld: ../static-deps/lib/libcurl.a(libcurl_la-psl.o): in function `Curl_psl_destroy':
psl.c:(.text+0x29): undefined reference to `psl_free'
/usr/bin/ld: ../static-deps/lib/libcurl.a(libcurl_la-psl.o): in function `Curl_psl_use':
psl.c:(.text+0xbb): undefined reference to `psl_latest'
/usr/bin/ld: psl.c:(.text+0x187): undefined reference to `psl_builtin'
/usr/bin/ld: psl.c:(.text+0x1a1): undefined reference to `psl_free'
/usr/bin/ld: ../static-deps/lib/libcurl.a(libcurl_la-version.o): in function `curl_version':
version.c:(.text+0x8b): undefined reference to `psl_get_version'
collect2: error: ld returned 1 exit status
make[2]: *** [daemon/CMakeFiles/lokinet-bootstrap.dir/build.make:102: daemon/lokinet-bootstrap] Error 1
make[1]: *** [CMakeFiles/Makefile2:1973: daemon/CMakeFiles/lokinet-bootstrap.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
jon@insp:~/Downloads/lokinet-v0.9.6/build$ 

Also tried after installing libtool and automake

RepComm avatar Oct 13 '21 00:10 RepComm

If this is for a full static build, it probably needs a --without-libpsl added to the curl configuration part of cmake/StaticBuild.cmake.

(Incidentally, if you aren't already aware, we have native ubuntu packages available on https://deb.oxen.io).

jagerman avatar Oct 13 '21 02:10 jagerman