I am building facebook folly lib in WSL2 Ubuntu system.
But it failed.
My environment.
$ uname -r
5.15.90.1-microsoft-standard-WSL2
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
The error information.
[455/909] Building CXX object CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o
FAILED: CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DFMT_LOCALE -DFOLLY_XLOG_STRIP_PREFIXES=\"/home/orange/folly:/tmp/fbcode_builder_getdeps-ZhomeZorangeZfollyZbuildZfbcode_builder/build/folly\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/home/orange/folly -I. -I/tmp/fbcode_builder_getdeps-ZhomeZorangeZfollyZbuildZfbcode_builder/installed/fmt-rSB7vI55d8xVge5xISAhmkhjh1Turjb5j37Mb9oEyJo/include -O2 -g -DNDEBUG -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type -Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new -fopenmp -std=gnu++17 -MD -MT CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o -MF CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o.d -o CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o -c /home/orange/folly/folly/portability/Time.cpp
/home/orange/folly/folly/portability/Time.cpp:278:2: error: No clock_gettime(3) compatibility wrapper available for this platform.
#error No clock_gettime(3) compatibility wrapper available for this platform.
^
1 error generated.
[457/909] Building CXX object CMakeFiles/folly_base.dir/folly/portability/SysUio.cpp.o
ninja: build stopped: subcommand failed.
Command '['/usr/bin/cmake', '--build', '/tmp/fbcode_builder_getdeps-ZhomeZorangeZfollyZbuildZfbcode_builder/build/folly', '--target', 'install', '--config', 'Release', '-j', '3']' returned non-zero exit status 1.
!! Failed
Just note #error No clock_gettime(3) compatibility wrapper available for this platform.
I have google it and find an issue.But no solutions.
Also, I have try to add -lrt
parameter, not working.
If anyone knows how to fix it, I would appreciate it.