My launch.jason
"environment": [{
"name": "LD_LIBRARY_PATH",
"value": "/opt/OpenBLAS/lib:/home/peter/anaconda3/lib"
}]
My task.jason
"task": {
// set LD_PATH environment
"type": "node-terminal",
"label": "setenv",
"command": "export",
"args": ["LD_LIBRARY_PATH=/opt/OpenBLAS/lib:/home/peter/anaconda3/lib"]
}
Everything builds properly, all -I,-L,-l are in the task.jason (not shown for clarity).
If I run : export LD_LIBRARY_PATH=/opt/OpenBLAS/lib:/home/peter/anaconda3/lib at the terminal, then run the program, it runs perfectly. It will continue to run once I've exported the env variable at the terminal. If I quit VSCode and then reenter and run the program, it can't find the link libs at run time, but, again, if I run export at the terminal, it runs perfectly. Obviously, the shell the program is running in does not inherit the env variables. Before I export if I run echo $LD_LIBRARY_PATH, they are correct, but the program can't find them at link time if I don't export them.
I have not found any doc or stackoverflow that fixes this problem. Inheriting the run env is pretty basic. In Eclipse there's a check box to inherit the env (or not) at runtime and the same program with the same build libs and includes run perfectly. Any "simple" fix for this?