getting different output when using FFTW3 Library than using Rosetta FFT
If the input is real valued than the output of the FFT is conjugate symmetric (Hermitian Symmetry). That means that the data in the second half of the output is redundant and the FFTW implementations takes advantage of that fact and only returns a complex vector of length $N/2+1$, i.e. 5 in your case. The Rosetta implementation just runs a standard complex FFT.
I suggest reading the documentation: http://www.fftw.org/fftw3_doc/One_002dDimensional-DFTs-of-Real-Data.html
Please note that your output is complex but you are only printing the real part.