Tpetra: std::call_once does not work well with gcc serial builds
Created by: kddevin
@trilinos/tpetra @egboman
Recall from #3057 (closed): Use of std::call_once with gcc in serial builds requires TPL_ENABLE_PThread=ON.
This requirement is not obvious to the user; indeed, only because I had been bitten by it once before (#3033 (closed)) did I know that info was available in a github issue. Most users will not guess that Pthreads is required for a serial build (nor should they).
Use of std::call_once has been reintroduced in Tpetra_Details_Behavior.cpp. Is it necessary? Can it be removed?
Expectations
Serial configurations should not need to specify TPL Pthreads to work correctly with Tpetra.
Current Behavior
std::call_once crashes in serial Trilinos builds without TPL_ENABLE_Pthread=ON.
Motivation and Context
@egboman is trying to run serial coloring algorithms in Zoltan2 on his Linux workstation. Tpetra CrsMatrix construction fails because std::call_once fails in fetching debug environment variables in CrsGraph constructor.
Definition of Done
I hope: std::call_once removed from Tpetra; I hate being bitten twice by the same bug.
Steps to Reproduce
build serial Trilinos with Zoltan2 and TPL_ENABLE_Pthread=OFF make test
Your Environment
On @egboman's workstation
module purge module load sems-env module load sems-cmake module load sems-gcc/4.9.3
cmake
-D CMAKE_BUILD_TYPE:STRING=DEBUG
-D BUILD_SHARED_LIBS:BOOL=ON
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON
-D Trilinos_ENABLE_Zoltan2:BOOL=ON
-D Zoltan2_ENABLE_Experimental:BOOL=ON
-D Trilinos_ENABLE_TESTS:BOOL=ON
-D TPL_BLAS_LIBRARIES="/usr/lib64/libblas.so.3"
-D TPL_LAPACK_LIBRARIES="/usr/lib64/liblapack.so.3"
..
Related Issues
Same as #3057 (closed) Related to #3033 (closed)