robashaw / libecpint

A C++ library for the efficient evaluation of integrals over effective core potentials.
MIT License
28 stars 15 forks source link

Default compilation options #37

Closed lorenzo-rovigatti closed 3 years ago

lorenzo-rovigatti commented 3 years ago

This is an issue created as part of the libecpint's JOSS review.

I have noticed that, by default, libecpint is compiled without any optimisations. What's the rationale behind this choice? In most scientific libraries/software I have used the default behaviour is usually to compile with some (if not maximum) optimisation, especially if, like in this case, the library can be used as a performance-critical kernel.

Since you use cmake you can use a portable solution by letting the user choose the value of the CMAKE_BUILD_TYPE variable, which could be set to Release by default but could be changed to Debug or RelWithDebInfo when debugging. Of course, further options could still be passed with CMAKE_CXX_FLAGS.

robashaw commented 3 years ago

Thank you for the suggestion - I'm honestly not sure why it wasn't there already. The default build is now Release with optimizations turned on, and will be added in the linked pull request.