serac icon indicating copy to clipboard operation
serac copied to clipboard

build issues with axom + LTO (GCC12)

Open samuelpmishLLNL opened this issue 1 year ago • 3 comments

the recent version of mpich for ubuntu 22.04 adds some link-time optimization flags to MPI targets, so all of the TPLs built end up with fat binaries. Enabling LTO flags also seems to mean that the libraries we depend on are not entirely black boxes any more, so when I compile serac, it complains about a bunch of warnings/errors in our libraries:

axom/sol.hpp:10487:31: error: potential null pointer dereference [-Werror=null-dereference]
[build] 10487 |                         *pref = obj;

axom/sidre/spio/IOBaton.cpp:119:28: error: ‘baton’ may be used uninitialized [-Werror=maybe-uninitialized]
[build]   119 |     int mpi_err = MPI_Ssend(&baton, 1, MPI_INT, m_rank_after_me, 0, m_mpi_comm);

axom/sidre/core/Attribute.hpp:57:39: error: potential null pointer dereference [-Werror=null-dereference]
[build]    57 |   IndexType getIndex() const { return m_index; }

...

and also one warning (promoted to error) in the stdlib:

/usr/include/c++/12/bits/hashtable_policy.h:277:57: error: potential null pointer dereference [-Werror=null-dereference]
[build]   277 |     _Hash_node_base(_Hash_node_base* __next) noexcept : _M_nxt(__next) { }

I'd like to just disable LTO entirely (for more than just the reasons above), but it's not clear to me how to do that to our uberenv/spack TPL system.

samuelpmishLLNL avatar Nov 10 '22 15:11 samuelpmishLLNL