Hello all:
I am new to nginx & openresty, so this hopefully will be an easy issue to solve.
I have created a shared library, which I am trying to load in a Lua script via require using openresty / nginx.
(my library name is ie.so ...)
local ie_loaded = require("ie")
Note that *from a console / CLI*, using require("ie") from luajit, the
library loads fine - because before I run luajit from the command line, I have ensured that my
LD_LIBRARY_PATH environment variable has been set appropriately to find any other dynamic libs needed:
echo $LD_LIBRARY_PATH
/opt/intel/impi/4.1.0.024/intel64/lib:/opt/intel/impi/4.1.0.024/intel64/lib:/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64:/opt/intel/mic/coi/host-linux-release/lib:/opt/intel/mic/myo/lib:/opt/intel/composer_xe_2013.1.117/mpirt/lib/intel64:/opt/intel/composer_xe_2013.1.117/ipp/../compiler/lib/intel64:/opt/intel/composer_xe_2013.1.117/ipp/lib/intel64:/opt/intel/composer_xe_2013.1.117/compiler/lib/intel64:/opt/intel/composer_xe_2013.1.117/mkl/lib/intel64:/opt/intel/composer_xe_2013.1.117/tbb/lib/intel64:/opt/intel/lib/intel64
However, under nginx/openresty, the server loads ie.so, (it finds it) but then fails with error - as it needs other shared libraries. (In this particular case, the library was built with Intel's compiler suite, so one of the libraries it depends on, as seen from the error log below, is libifport.so.5
So, that is the key issue. How do I get an appropriate environment under nginx/openresty?
So, I've played around, trying things like:
env LD_LIBRARY_PATH; in the nginx config file
running nginx as a user whose .bashrc sets the LD_LIBRARY_PATH.
using os.execute("export LD_LIBRARY_PATH= ... ") in my nginx Lua scripts
but nothing works, and probably I am just missing the obvious way of doing such a thing by attempting hacks...
So I am at a loss how to set up an initial environment (LD_LIBRARY_PATH) to let openresty/nginx find the appropriate dependencies so it will successfully load my shared library.
Any thoughts?
Thanks,
Dave Linenberg