Closed Tectu closed 3 years ago
Hi there, thanks for the comprehensive error message and the git repo. I'll look into this right away.
One question, if you look in the CMakeCache.txt file, can you check that the correct version of boost was actually found?
I'll get cracking in the meantime.
I get different errors with gcc11:
[ 89%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/listener.cpp.o
In file included from /home/rhodges/github/Tectu/malloy/lib/malloy/http/generator.cpp:2:
/home/rhodges/github/Tectu/malloy/lib/malloy/http/response.hpp:79:16: error: declaration of ‘malloy::http::status malloy::http::response::status() const’ changes meaning of ‘status’ [-fpermissive]
79 | status status() const { return result(); }
| ^~~~~~
In file included from /home/rhodges/github/Tectu/malloy/lib/malloy/http/generator.hpp:6,
from /home/rhodges/github/Tectu/malloy/lib/malloy/http/generator.cpp:1:
/home/rhodges/github/Tectu/malloy/lib/malloy/http/types.hpp:22:11: note: ‘status’ declared here as ‘using status = enum class boost::beast::http::status’
22 | using status = boost::beast::http::status;
| ^~~~~~
gmake[3]: *** [lib/malloy/CMakeFiles/malloy-objs.dir/build.make:134: lib/malloy/CMakeFiles/malloy-objs.dir/http/generator.cpp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
One question, if you look in the CMakeCache.txt file, can you check that the correct version of boost was actually found?
Yeah. I actually wanted to include that information in the original post but didn't want to bloat it too much. CMake reports that it found the correct/suitable boost libraries based on the -DBOOST_ROOT=
setting.
I get different errors with gcc11:
I'll get that fixed. As mentioned in another issue this library is in a very early stage and has a lot of rough edges. Getting it to compile on something other than Windows/MSYS2 is part of the undertaking of polishing it.
Unfortunately I cannot easily compile this with anything other than gcc 10.2 until I am able to build it on my FreeBSD machine :p
I'll spin up a docker. What's the latest freebsd docker image?
I'm sorry, I wouldn't be able to help you there. All my FreeBSD machines are classic installs directly on hardware.
Is there something else I can be helpful with?
Created a PR so that it at least builds on gcc11, -std=c++20
See if that changes anything. I don't have a spare machine to install freebsd. Best I can do is fire up an old docker of fedora and try gcc10
Thank you for the PR - that's appreciated!
Unfortunately, the problem reported in the first post remains. If you have something like VirtualBox or VMware available you might grab one of the virtual images from https://www.freebsd.org/where/ See the "Virtual Machine Images" under the "FreeBSD 13.0-Release" section.
Alternatively I can either setup a pre-configured VM with everything installed ready to issue 'make' and provide you with that VM image or I can setup a virtual host and give you SSH access to the machine. Would it be okay for you to proceed either of those options?
I get this on gcc10 with boost 1.73:
28%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/listener.cpp.o
/work/malloy/lib/malloy/listener.cpp: In member function ‘void malloy::server::listener::run()’:
/work/malloy/lib/malloy/listener.cpp:74:18: error: ‘dispatch’ is not a member of ‘boost::asio’
74 | boost::asio::dispatch(
| ^~~~~~~~
make[2]: *** [lib/malloy/CMakeFiles/malloy-objs.dir/build.make:186: lib/malloy/CMakeFiles/malloy-objs.dir/listener.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:492: lib/malloy/CMakeFiles/malloy-objs.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
I'll try with latest
The thing I can tell you for sure is that compiling malloy using the following conditions work:
10.2
/ 10.3
3.17
/ 3.20.2
1.75.0
(I think this used to work with 1.73.0
but can't confirm easily)Once I have this compiling on FreeBSD I will setup CI/CD to test various configurations which should quickly increase the quality of the library.
"Works on my machine!"
[root@931c98cc8547 work]# cmake -Hmalloy -Bbuild -DCMAKE_CXX_STANDARD=20
-- The CXX compiler identification is GNU 10.3.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/local/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found suitable version "1.76.0", minimum required is "1.73.0")
-- Build spdlog: 1.8.3
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Build type: Release
---------------------
Malloy configuration:
Build:
Examples : ON
Tests : ON
Features:
HTML : ON
TLS : OFF
---------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /work/build
[root@931c98cc8547 work]# cd build/
[root@931c98cc8547 build]# vim
Scanning dependencies of target spdlog
[ 3%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/spdlog.cpp.o
[ 6%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/stdout_sinks.cpp.o
[ 9%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/color_sinks.cpp.o
[ 12%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/file_sinks.cpp.o
[ 15%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/async.cpp.o
[ 18%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/cfg.cpp.o
[ 21%] Building CXX object _deps/spdlog-build/CMakeFiles/spdlog.dir/src/fmt.cpp.o
[ 25%] Linking CXX static library libspdlog.a
[ 25%] Built target spdlog
Scanning dependencies of target malloy-objs
[ 28%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/connection/connection_detector.cpp.o
[ 31%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/routing/router.cpp.o
[ 34%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/session/manager.cpp.o
[ 37%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/cookie.cpp.o
[ 40%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/generator.cpp.o
[ 43%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/http/uri.cpp.o
[ 46%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/html/form.cpp.o
[ 50%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/controller.cpp.o
[ 53%] Building CXX object lib/malloy/CMakeFiles/malloy-objs.dir/listener.cpp.o
[ 53%] Built target malloy-objs
Scanning dependencies of target malloy-example-basic
[ 56%] Building CXX object examples/examples/basic/CMakeFiles/malloy-example-basic.dir/main.cpp.o
[ 59%] Linking CXX executable malloy-example-basic
[ 59%] Built target malloy-example-basic
Scanning dependencies of target malloy-example-html-form
[ 62%] Building CXX object examples/examples/html_form/CMakeFiles/malloy-example-html-form.dir/main.cpp.o
[ 65%] Linking CXX executable malloy-example-html-form
[ 65%] Built target malloy-example-html-form
Scanning dependencies of target malloy-example-nestedrouters
[ 68%] Building CXX object examples/examples/nested_routers/CMakeFiles/malloy-example-nestedrouters.dir/main.cpp.o
[ 71%] Linking CXX executable malloy-example-nestedrouters
[ 71%] Built target malloy-example-nestedrouters
Scanning dependencies of target malloy-example-session
[ 75%] Building CXX object examples/examples/session/CMakeFiles/malloy-example-session.dir/main.cpp.o
[ 78%] Linking CXX executable malloy-example-session
[ 78%] Built target malloy-example-session
Scanning dependencies of target malloy-websocket
[ 81%] Building CXX object examples/examples/websocket/CMakeFiles/malloy-websocket.dir/main.cpp.o
[ 84%] Linking CXX executable malloy-websocket
[ 84%] Built target malloy-websocket
Scanning dependencies of target malloy-tests
[ 87%] Building CXX object test/CMakeFiles/malloy-tests.dir/test_suites/components/http_generator.cpp.o
[ 90%] Building CXX object test/CMakeFiles/malloy-tests.dir/test_suites/components/router.cpp.o
[ 93%] Building CXX object test/CMakeFiles/malloy-tests.dir/test_suites/components/uri.cpp.o
[ 96%] Building CXX object test/CMakeFiles/malloy-tests.dir/test_main.cpp.o
[100%] Linking CXX executable malloy-tests
[100%] Built target malloy-tests
[root@931c98cc8547 build]# g++ --version
g++ (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
:point_up: this was on a fedora 33 docker image
Well, knowing that it compiles on Fedora without problems is already helpful & good to know - thank you!
Is there anything you can point me towards for figuring out why the build on FreeBSD fails?
I’m at a loss at the moment I’m afraid. I will need to buy another hard drive and install freebsd to find out.
How about a VM? :)
Disk space still the issue, plus VMware pollutes the machine horribly. Nothing ever seems to work properly after I install it.
You should try VirtualBox then. :)
Also you can use more native tools, depending on the OS you are using. For Windows - Hyper-V, for Linux - QEMU, etc.
I've revisited this - I'm able to compile on FreeBSD without any problems. This must have been an issue in my application/library code.
Unfortunately, I don't have a way to look for the code which introduced this problem without checking pretty much ever commit in the history.
@madmongo1 Thank you for your efforts!
I have a boost.beast based library which compiles fine on Windows using MSYS2 & GCC 10.3. Now I wanted to compile it on FreeBSD but I am getting a series of errors I'm unsure what to make off (see below). Any ideas or anything else that would help me here? The code in the library is largely based on the various boost.beast examples, mainly the
example/advanced/server-flex
example.This is on FreeBSD 13.0-RELEASE 64-bit using GCC 10.3.0. I tried this with boost 1.75.0 and 1.76.0 - both result in the same compilation error(s).
Note that I had to manually specify the path to boost when invoking cmake as the official FreeBSD package for the boost-libs is still 1.72.0:
If you'd like to give this a try yourself, the library is available at: https://github.com/tectu/malloy
The compilation errors: