actually, the problem was that R tried to use Matlab libraries, so it's best to use system's libraries