A huge earthquake has hit off the coast of Chile, prompting tsunami warnings as far away as California.