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

Most upvoted comments

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. šŸ‘ šŸ’Æ

Does FreeBSD have C11 threads?

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

check_include_file (threads.h iHaveC11Threads)

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.

That looks like an issue related to C11 threads. I may have to try installing FreeBSD myself and see if there is a problem in the build config. Also possible that on FreeBSD there is some dynamic library that does not get linked automatically so it has to be added to the manual options.

@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.