Start here (if you have it), look at the box your GS4 came in and see what the last three characters of the build are (MDK, MK2, etc). If you are trying to root they will ID your build so you know which method to use.
If you are trying to flash a custom kernel and are not on or started from MDK you cannot flash the kernel. If you took an OTA update you also cannot flash a custom kernel. Also be aware that you are not able to downgrade the firmware to MDK. Flashing a custom kernel requires an unlockable or exploitable bootloader. The MDK bootloader is not unlockable but it can be exploited with a process called "loki" that allows installation of a custom recovery. That recovery is required to flash custom kernels and some ROMs (such as Cyanogenmod).
I don't have the link handy and do not remember off the top of my head, but if you are rooted and have a terminal emulator there is a command that when ran will give the bootloader version on your device. That info will tell what you have so you know what you can and can't do to your device.
http://goo.gl/TF7HcD that will show your boot loader.
Sent from my SCH-I545 using XDA Premium 4 mobile app