rapier1/hpn-ssh

Build on MacOS fails due to "error: use of undeclared identifier 'c'"

lukvacek opened this issue · 6 comments

Hello! I was able to successfully build and run this package on Ubuntu, but building on Mac OS results in the following error:

cipher-ctr-mt-functions.c:270:26: error: use of undeclared identifier 'c'
                thread_loop_check_exit(c);
                                       ^
cipher-ctr-mt-functions.c:277:27: error: use of undeclared identifier 'c'
                        thread_loop_check_exit(c);
                                               ^

I used the following ./configure command:
./configure --prefix="$(printf "%q\n" "$(pwd)")/dist" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="I/usr/local/opt/openssl/include"

Also tried using gcc 11 installed through:

brew install gcc@11
CC="gcc-11"

The above patch tests out on my system and I've pushed it to the master branch. Once we get another issue resolved I'll update tags/releases with this fix.

Awesome, thank you! Successfully compiles and runs for me as well.

As an aside (happy to discuss elsewhere), since you have a Mac too I am curious if have you had much success tuning the TCP stack for long fat networks? I have followed pretty much every resource I could find out there and cannot seem to get more than 12 MB/s (peaks to 15MB/s) between a Mac / linux computer pair on a 250-300ms latency connection over the internet. Mac-Mac is even worse. Running a linux-linux TCP connection yields 25-30 MB/s on the same connection. The connection has a limit of around ~36MB/s. I'm guessing it is because we cannot change the Mac's TCP congestion algorithm to something else like BBR / HTCP but wanted to check if this is comparable with your results as well?

So I have a MBP with a M1Pro chip in it. There are, shall we say, issues with how Apple tunes their TCP stack. First off, a lot of the systems don't have the ability to use jumbo frames (9k packet sizes - it reduces the number packets that need to be processed and decreases the ratio of bytes used for the header in comparison to the payload). On MBPs there also isn't really an option for anything more than a 1Gb/s connection. That said, the Studios have 10Gb ports which, I would hope, have support for jumbo frames.

Anyway, You should take a look at the https://fasterdata.es.net/host-tuning/osx/ tuning guide from ESNet (part of the DoE). There aren't a lot of options to play with but increasing the win_scale and the rcv/snd buffer max will help out a lot. On Ventura those seem to top out at 4MB. For a 300ms connection on, say, a 1Gb path you'll need closer to 34 to 36MB of buffer space on both ends (look up 'bandwidth delay product').

Thanks! Yes I've already followed that guide and a bunch of others as well (e.g., rolande.wordpress.com, macgeekery, etc). One thing I have noticed is that on a Mac downloads seem to work much better than uploads over a high latency connection. It seems like there is another bottleneck other than buffer sizes as for example testing ~8MB and ~16MB for the buffer sizes yields roughly the same speeds. I'm suspicious it's the fact that Macs can only use the TCP Cubic congestion algorithm which is very sensitive to even small amounts of packet loss compared to say BBR or HTCP.