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

Update optimization level recommendation #184

Closed
jtraglia opened this issue Aug 18, 2023 · 2 comments
Closed

Update optimization level recommendation #184

jtraglia opened this issue Aug 18, 2023 · 2 comments

Comments

@jtraglia
Copy link
Contributor

Instead of -O -D__BLST_PORTABLE__, I think the recommendation should be -O2 -D__BLST_PORTABLE__.

If the test or target application crashes with an "illegal instruction" exception [after copying to an older system], rebuild with `CGO_CFLAGS` environment variable set to <nobr>`-O -D__BLST_PORTABLE__`</nobr>. Don't forget <nobr>`-O`</nobr>!

While blst doesn't really benefit from -O2 because it's mostly assembly, this affects the whole Golang project that uses blst. The default value is -O2 (check with go env) and changing it to -O (-O1) could cause projects to be slower than normal.

@jtraglia
Copy link
Contributor Author

Also, just noticed the filenames here are a little out-dated. Should be cgo_server.c and cgo_assembly.S.

After running generate.py, <nobr>`go build`</nobr> and <nobr>`go test`</nobr> can be run as usual. Cgo will compile `server.c`, which includes the required C implementation files, and `assembly.S`, which includes appropriate pre-generated assembly code for the platform. To compile on Windows one has to have MinGW gcc on the `%PATH%`.

@dot-asm
Copy link
Collaborator

dot-asm commented Aug 18, 2023

Thanks!

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