Added some fixes for building under linux
-Added trainer creation to linux