I would cross the Pyrénées using the Aude valley,
if you want to cross closer to the sea here's a permanent route: http://www.departements-regions-cyclables.org/index.php?p=65&ref=56
never got close to Barcelona by bike,
I suspect I'd take the train for the last few km.
A map of the main cycling routes :
http://www.af3v.org/CarteAF3V/carte-detaillee.html
I would cross the Pyrénées using the Aude valley,
if you want to cross closer to the sea here's a permanent route:
http://www.departements-regions-cyclables.org/index.php?p=65&ref=56
never got close to Barcelona by bike,
I suspect I'd take the train for the last few km.