Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lukvacek opened this issue Nov 28, 2022 · 6 comments
Closed

Comments

@lukvacek
Copy link

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"
@rapier1
Copy link
Owner

rapier1 commented Nov 28, 2022 via email

@rapier1
Copy link
Owner

rapier1 commented Nov 28, 2022 via email

@rapier1
Copy link
Owner

rapier1 commented Nov 28, 2022

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.

@lukvacek
Copy link
Author

lukvacek commented Dec 3, 2022

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?

@rapier1
Copy link
Owner

rapier1 commented Dec 3, 2022

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').

@lukvacek
Copy link
Author

lukvacek commented Dec 9, 2022

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.

@rapier1 rapier1 closed this as completed Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants