CTU-IIG / demos-sched

Scheduler for simulation of avionics multi-core workloads on Linux
GNU General Public License v3.0
1 stars 2 forks source link

cannot find -lstdc++fs #56

Closed c-maia closed 3 years ago

c-maia commented 3 years ago

The following error occurs when I try to compile DEmOS, after a fresh pull. Please let me know if you need more info about the system.


meson build The Meson build system Version: 0.57.2 Source dir: /media/demos-sched Build dir: /media/demos-sched/build Build type: native build Project name: demos-sched Project version: undefined C compiler for the host machine: ccache cc (gcc 9.2.0 "cc (GCC) 9.2.0") C linker for the host machine: cc ld.bfd 2.32.0.20190204 C++ compiler for the host machine: ccache c++ (gcc 9.2.0 "c++ (GCC) 9.2.0") C++ linker for the host machine: c++ ld.bfd 2.32.0.20190204 Host machine cpu family: aarch64 Host machine cpu: aarch64

Executing subproject libev method meson
Project name: libev
Project version: 4.31
C compiler for the host machine: ccache cc (gcc 9.2.0 "cc (GCC) 9.2.0")
C linker for the host machine: cc ld.bfd 2.32.0.20190204
Library m found: YES
Program pod2man found: YES (/usr/bin/pod2man)
Has header "inttypes.h" : YES
Has header "dlfcn.h" : YES
Has header "inttypes.h" : YES (cached)
Has header "linux/aio_abi.h" : YES
Has header "linux/fs.h" : YES
Has header "memory.h" : YES
Has header "poll.h" : YES
Has header "port.h" : NO
Has header "stdint.h" : YES
Has header "stdlib.h" : YES
Has header "strings.h" : YES
Has header "string.h" : YES
Has header "sys/epoll.h" : YES
Has header "sys/eventfd.h" : YES
Has header "sys/event.h" : NO
Has header "sys/inotify.h" : YES
Has header "sys/select.h" : YES
Has header "sys/signalfd.h" : YES
Has header "sys/stat.h" : YES
Has header "sys/timerfd.h" : YES
Has header "sys/types.h" : YES
Has header "unistd.h" : YES
Library rt found: YES
Checking for type "__kernel_rwf_t" : YES
Checking for function "clock_gettime" : YES
Checking for function "epoll_ctl" : YES
Checking for function "eventfd" : YES
Checking for function "floor" with dependency -lm: YES
Checking for function "inotify_init" : YES
Checking for function "kqueue" : NO
Checking for function "nanosleep" : YES
Checking for function "poll" : YES
Checking for function "select" : YES
Checking for function "signalfd" : YES
Configuring config.h using configuration
Build targets in project: 2
Subproject libev finished.
Executing subproject yaml-cpp method meson
Project name: yaml_cpp
Project version: 0.6.3
C++ compiler for the host machine: ccache c++ (gcc 9.2.0 "c++ (GCC) 9.2.0")
C++ linker for the host machine: c++ ld.bfd 2.32.0.20190204
Compiler for C++ supports arguments -Wall: YES
Compiler for C++ supports arguments -Wextra: YES
Compiler for C++ supports arguments -Wshadow: YES
Compiler for C++ supports arguments -Weffc++: YES
Compiler for C++ supports arguments -Wno-long-long: YES
Compiler for C++ supports arguments -pedantic: YES
Compiler for C++ supports arguments -pedantic-errors: YES
Build targets in project: 3
Subproject yaml-cpp finished.
Executing subproject spdlog method meson
Project name: spdlog
Project version: 1.8.2
C++ compiler for the host machine: ccache c++ (gcc 9.2.0 "c++ (GCC) 9.2.0")
C++ linker for the host machine: c++ ld.bfd 2.32.0.20190204
Run-time dependency threads found: YES
Build targets in project: 4
Subproject spdlog finished.

Compiler for C++ supports arguments -Wsuggest-attribute=const: YES Configuring config_meson.h using configuration Program 0010-help.t found: YES (/media/demos-sched/test/0010-help.t) Program 0020-basic.t found: YES (/media/demos-sched/test/0020-basic.t) Program 0100-api.t found: YES (/media/demos-sched/test/0100-api.t) Program 0200-config.t found: YES (/media/demos-sched/test/0200-config.t) Build targets in project: 10

demos-sched undefined

Subprojects libev : YES spdlog : YES yaml-cpp: YES

Found ninja-1.9.0 at /usr/bin/ninja ninja -C build 1>&2 # Redirect everything to stderr so that QtCreator sees the error messages ninja: Entering directory `build' [58/66] Linking target src/tests/api-init-test FAILED: src/tests/api-init-test c++ -o src/tests/api-init-test src/tests/api-init-test.p/api_init_test.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group -lstdc++fs lib/libdemos-sch.a -Wl,--end-group /usr/lib/gcc/aarch64-poky-linux/9.2.0/../../../../aarch64-poky-linux/bin/ld: cannot find -lstdc++fs collect2: error: ld returned 1 exit status [59/66] Linking target src/evfd_tests FAILED: src/evfd_tests c++ -o src/evfd_tests src/evfd_tests.p/evfd.tests.cpp.o src/evfd_tests.p/evfd.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group -lstdc++fs subprojects/libev/libev.a -lm -Wl,--end-group /usr/lib/gcc/aarch64-poky-linux/9.2.0/../../../../aarch64-poky-linux/bin/ld: cannot find -lstdc++fs collect2: error: ld returned 1 exit status [63/66] Compiling C++ object src/demos-sched.p/config.cpp.o ninja: build stopped: subcommand failed. make: *** [Makefile:6: all] Error 1

wentasah commented 3 years ago

Can you try whether the change in eb7c0074589bf8293517271938d5f69040219ac1 fixes that?

c-maia commented 3 years ago

Can you try whether the change in eb7c007 fixes that?

It does not fix the issue. The following error message is printed when building DEmOS:

../meson.build:12:32: ERROR: C++ shared or static library 'stdc++fs' not found

However, after some reading I understood that, in GCC V8, if '-std=c++17' flag is included, the filesystem library is also included (I assume that the behaviour is the same for more recent GCC versions), and therefore the problem of not finding the library should not occur. Thus, if I comment the following lines in "meson.build", I am able to compile and execute DEmOS without any issues.

if cpp.find_library('stdc++fs').found()
  # without this, std::filesystem is not present for some compilers
  add_project_link_arguments(['-lstdc++fs'], language : 'cpp')
endif
wentasah commented 3 years ago

OK. As we discussed today, can you try different version in db4e0841171fa713b32e5de19e2a4bf9b57debc9? I've added required : false. I guess that this will work for you as well as for others.

c-maia commented 3 years ago

@wentasah I confirm that it works with required : false.