lagrange: Does not build on FreeBSD
This is the error I get on FreeBSD 12.1-RELEASE r354233 GENERIC amd64
> cmake --build .
Scanning dependencies of target the_Foundation
[ 1%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/the_foundation.c.o
[ 2%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/audience.c.o
[ 3%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/array.c.o
[ 4%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/block.c.o
[ 5%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/blockhash.c.o
[ 6%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/buffer.c.o
[ 7%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/class.c.o
[ 8%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/commandline.c.o
[ 9%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/crc32.c.o
[ 10%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/file.c.o
[ 12%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/fileinfo.c.o
In file included from /usr/home/samuel/src/lagrange/lib/the_Foundation/src/fileinfo.c:39:
/usr/include/sys/dir.h:41:2: error: "The information in this file should be obtained from <dirent.h>" [-Werror,-W#warnings]
#warning "The information in this file should be obtained from <dirent.h>"
^
/usr/include/sys/dir.h:42:2: error: "and is provided solely (and temporarily) for backward compatibility." [-Werror,-W#warnings]
#warning "and is provided solely (and temporarily) for backward compatibility."
^
2 errors generated.
gmake[2]: *** [lib/the_Foundation/CMakeFiles/the_Foundation.dir/build.make:212: lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/fileinfo.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:142: lib/the_Foundation/CMakeFiles/the_Foundation.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 32 (17 by maintainers)
Commits related to this issue
- Updated the_Foundation IssueID #45 — committed to skyjake/lagrange by skyjake 4 years ago
- Updated the_Foundation IssueID #45 — committed to skyjake/lagrange by skyjake 4 years ago
Good and bad news, I managed to install FreeBSD in a VM and figured out the build config using pthread. Lagrange seems to launch. However, there are a couple of other issues that I need to debug and fix (for instance, it fails to look up hostnames when connecting).
@skyjake: Pleased to report that the dev branch compiles correctly on OpenBSD as well. Great work at building such a portable piece of software. š šÆ
Well it does have <threads.h> and libstdthreads, so looks like it. However, I think at least SDL was compiled using pthreads āĀ maybe thereās some kind of conflict between the two if used in the same app? No idea. (This was the first time Iāve ever used FreeBSD. š)
@skyjake: I just tried out Lagrange. It is such a pleasure to use. Highly polished. Truly inspirational work. Will recommend Lagrange in all my circles! š
OK, I couldnāt get my mouse working under X11 in the VM, but AFAICS Lagrange is running now pretty well! š
I had to fix the getaddrinfo flags and force the use of pthread in the build config.
Donāt forget to change your CMAKE_BUILD_TYPE to Release.
I did note that the default window manager (twm?) couldnāt handle UTF-8 in window titles.
Hmm nothing in there looks suspicious to me⦠Perhaps libstdthreads.so does not implement some functionality that Lagrange assumes to be available.
Another option is to try forcing it to build with pthread instead. One way to try that is to comment out the line
in lib/the_Foundation/CMakeLists.txt and restore the linking with
phtread.A debug build is pretty simple, just run cmake with
-DCMAKE_BUILD_TYPE=Debug. Would be nice to see a backtrace.Iāll amend the build config accordingly.
@skyjake: Hey, thanks for all your patience and help, it finally builds with
stdthreadsin https://codeberg.org/skyjake/the_Foundation/src/branch/master/Depends.cmake#L75https://stackoverflow.com/questions/24557728/does-any-c-library-implement-c11-threads-for-gnu-linux/28412024 helped me.
Excited to try out lagrange!
@skyjake: I can help out with trying FreeBSD stuff, if that saves some time for you. If you can give me rough hints of what might be happening, perhaps I can push a patch.
I recommend using OpenSSL 1.1.1 for now. I havenāt yet tried using OpenSSL 3.0, so Iām sure there are many issues with it currently.
All right, please try now.
6d91f60bf3d827aaa185127b20af350fb3472bf4 updates the_Foundation submodule with this change.
Seems safe to change the include of <dir.h> to <dirent.h> there. Iāll apply the change.