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

Parallelize gcc lto #1224

Open
jsks opened this issue Nov 20, 2023 · 1 comment
Open

Parallelize gcc lto #1224

jsks opened this issue Nov 20, 2023 · 1 comment

Comments

@jsks
Copy link

jsks commented Nov 20, 2023

gcc allows passing the number of threads for parallelization to use at link time with LTO. Since gcc 10.x this can be set automatically with -flto=auto which will use either GNU Make's job server or fallback to detecting the number of available CPU threads (see the gcc documentation)

An additional ifeq check can be added to makefile around line 74. This will silence the lto-wrapper warning that currently pops up about serial compilation of LTRANS jobs when compiling with gcc and STAN_CPP_OPTIMS enabled and hopefully decrease the linking time.

@bob-carpenter
Copy link
Contributor

Thanks, @jsks. I'm not an expert in make, but this looks like a good idea.

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