use extern template to fix osx -flto bug - closes #2339