It is possible to install gcc48 or gcc5 in FreeBSD and pass the options to configure to compile the C files with it, as shown below. Make sure to link with the OS official compiler however, cc or c++ and not gcc or g++, otherwise the generated binary will be incorrect. That's also why the -lgomp is required to link it.