Merge pull request #1553 from nouiz/fix_tests

Fix tests
fix gh-1540 and close gh-1541. Don't use rpath if the user didn't provided cuda.root.