It won't hurt to nail them to the bearing wall, but more importantly, they should be cross braced to each other to prevent warping and loss of bending strength.
This should be done every 6 feet or so, evenly spaced along their length.
Good Luck!
Dodgeman