Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird build errors on Linux #139

Open
AdamantGarth opened this issue Jan 28, 2023 · 2 comments
Open

Weird build errors on Linux #139

AdamantGarth opened this issue Jan 28, 2023 · 2 comments

Comments

@AdamantGarth
Copy link

AdamantGarth commented Jan 28, 2023

Hi, tried to build this on Arch Linux by following the readme, and got some weird errors:

$ cmake -DUBUS_SUPPORT=OFF -DUCI_SUPPORT=OFF -DULOOP_SUPPORT=OFF .
-- The C compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0")
-- Checking for module 'json-c'
--   Found json-c, version 0.16
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for fmod
-- Looking for fmod - not found
-- Looking for json_tokener_get_parse_end
-- Looking for json_tokener_get_parse_end - found
-- Looking for json_object_new_array_ext
-- Looking for json_object_new_array_ext - found
-- Looking for json_object_new_uint64
-- Looking for json_object_new_uint64 - found
-- Looking for ceil
-- Looking for ceil - not found
-- Looking for res_mkquery
-- Looking for res_mkquery - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for frexp
-- Looking for frexp - found
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
nl
    linked by target "rtnl_lib" in directory /home/user/Src/ucode
    linked by target "nl80211_lib" in directory /home/user/Src/ucode
nl_include_dir
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
   used as include directory in directory /home/user/Src/ucode/examples
ubox
    linked by target "nl80211_lib" in directory /home/user/Src/ucode

CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "libucode":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "ucode":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "fs_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "math_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "rtnl_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "nl80211_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "resolv_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "struct_lib":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of
  "exception-handler":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of "execute-file":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of
  "execute-string":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of
  "native-function":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of "state-reset":

    "nl_include_dir-NOTFOUND"



CMake Error in examples/CMakeLists.txt:
  Found relative path while evaluating include directories of "state-reuse":

    "nl_include_dir-NOTFOUND"



-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Running make also seemingly fails:

$ make
[  2%] Building C object CMakeFiles/libucode.dir/lexer.c.o
[  5%] Building C object CMakeFiles/libucode.dir/lib.c.o
[  8%] Building C object CMakeFiles/libucode.dir/vm.c.o
[ 11%] Building C object CMakeFiles/libucode.dir/chunk.c.o
[ 13%] Building C object CMakeFiles/libucode.dir/vallist.c.o
[ 16%] Building C object CMakeFiles/libucode.dir/compiler.c.o
[ 19%] Building C object CMakeFiles/libucode.dir/source.c.o
[ 22%] Building C object CMakeFiles/libucode.dir/types.c.o
[ 25%] Building C object CMakeFiles/libucode.dir/program.c.o
[ 27%] Linking C shared library libucode.so
[ 27%] Built target libucode
[ 30%] Building C object CMakeFiles/ucode.dir/main.c.o
[ 33%] Linking C executable ucode
[ 33%] Built target ucode
[ 36%] Building C object CMakeFiles/fs_lib.dir/lib/fs.c.o
[ 38%] Linking C shared module fs.so
[ 38%] Built target fs_lib
[ 41%] Building C object CMakeFiles/math_lib.dir/lib/math.c.o
[ 44%] Linking C shared module math.so
[ 44%] Built target math_lib
[ 47%] Building C object CMakeFiles/rtnl_lib.dir/lib/rtnl.c.o
/home/user/Src/ucode/lib/rtnl.c:31:10: fatal error: netlink/msg.h: No such file or directory
   31 | #include <netlink/msg.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/rtnl_lib.dir/build.make:76: CMakeFiles/rtnl_lib.dir/lib/rtnl.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:232: CMakeFiles/rtnl_lib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

But despite that, there's ucode binary, and it seems to work fine:

$ ./ucode -e 'print("OK!\n")'
OK!
@ynezz
Copy link
Contributor

ynezz commented Jan 29, 2023

cmake -DUBUS_SUPPORT=OFF -DUCI_SUPPORT=OFF -DULOOP_SUPPORT=OFF .

You should add -D NL80211_SUPPORT=OFF into your cmake args if you don't need nl80211 library in ucode.

@AdamantGarth
Copy link
Author

Yep, cmake -DUBUS_SUPPORT=OFF -DUCI_SUPPORT=OFF -DULOOP_SUPPORT=OFF -DNL80211_SUPPORT=OFF -DRTNL_SUPPORT=OFF . did it, thanks!

Maybe it's worth adding these extra options to the Linux build instructions in the readme? Those libraries sound like something OpenWRT-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants