porting lin_alg to linux