-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Precompiled header with g++ #872
Comments
I almost forgot, there is also a warning with g++:
Its an Eigen issue: https://gitlab.com/libeigen/eigen/-/issues/1221 |
option A sounds great. I would say that on Mac everyone uses clang is a fair statement. |
A: use it by default on Linux and Mac (do people use g++ on a Mac at all?),
and hide it behind a makefile flag (PRECOMPILED_HEADERS=true for example)
so users on Windows with RTools 4.0 can use it.
how exactly will this work? on all 3 platforms, build g++ headers so that
on Mac, most users won't notice because they'll be using clang, on Linux,
faster compile, and Windows with Rtools 4.0, also faster compile? that
would be great.
…On Mon, May 11, 2020 at 10:05 AM Rok Češnovar ***@***.***> wrote:
Description:
We are currently using precompiled model headers (model_header.hpp.gch)
only with clang. See lines 20-23 here:
https://github.com/stan-dev/cmdstan/blob/develop/make/program#L20
We could do the same with g++ which would speedup g++ compilation of a
model to match with clang - see #863 (comment)
<#863 (comment)>.
I tried this out on Linux and Windows. Here is what I found out (I used
the example bernoulli model):
- Ubuntu g++ 7.2.0: compile time goes from 12.5s to 6s
- Windows with Rtools 4.0 (g++ 8): compile time goes from 22s to 13s
- Windows with Rtools 3.5 (g++ 4.9.3): does not work
The precompiled header with g++ does take up 500-700MB (the clang++ one
takes 170MB on Linux). Given the size of the precompiled header, the fact
that it does not work on all of our supported systems and we can't detect
which compiler we use with makefiles, we have the following options:
- A: use it by default on Linux and Mac (do people use g++ on a Mac at
all?), and hide it behind a makefile flag (PRECOMPILED_HEADERS=true for
example) so users on Windows with RTools 4.0 can use it.
- B: hide it behind a makefile flag for g++ on all OSes
- C: not bother with this, close issue
Current Version:
v2.23.0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#872>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJWT5AQ4YB3YLLOUFMRJDDRRAA2LANCNFSM4M56CBLQ>
.
|
On mac/linux with clang: no change, precompiled headers are already used On Windows without the flag: no change CmdstanR/Py could help windows users by setting it automatically based on detected toolchain. |
I like solution (A) and think it's well worth doing. It'll also have the nice side effect of encouraging Windows users to upgrade RTools. |
Description:
We are currently using precompiled model headers (model_header.hpp.gch) only with clang. See lines 20-23 here: https://github.com/stan-dev/cmdstan/blob/develop/make/program#L20
We could do the same with
g++
which would speedupg++
compilation of a model to match with clang - see #863 (comment).I tried this out on Linux and Windows. Here is what I found out (I used the example bernoulli model):
The precompiled header with g++ does take up 500-700MB (the clang++ one takes 170MB on Linux). There is also a warning due to an Eigen issue that needs to be silenced with
-Wno-ignored-attributes
(see comment below).Given the size of the precompiled header, the warnings that need to be turned off, the fact that it does not work on all of our supported systems and that we can't detect which compiler we use with makefiles, we have the following options:
PRECOMPILED_HEADERS=true
for example) so users on Windows with RTools 4.0 can use it.Current Version:
v2.23.0
The text was updated successfully, but these errors were encountered: