Restrict mxnet in single thread

I am building a shared library to be submitted to NIST FRVT. I am using Mxnet for face feature generation. I have successfully set the “MXNET_ENGINE_TYPE=NaiveEngine” from the shared library code but the environment variable OMP_NUM_THREADS=1 does not work from the code where as with “export OMP_NUM_THREADS=1” works.

Can anyone help me into setting this environment variable from the shared library code?