Setting LD_LIBRARY_PATH kills dotnet command
See original GitHub issueTrying to run a dotnet application on a Ubuntu machine with MatLab installed. Note - I’m not suggesting that this in itself is a bug with dotnet itself, but I would appreciate if someone can shed any light on why setting this environment variable kills the SDK.
Steps to reproduce
- Create an Ubuntu VM (16.04 here).
- Install the .NET SDK (2.1.401 here).
- Run
dotnet --info
(works fine). - Apply the following commands:
MCRROOT=/usr/local/MATLAB/MATLAB_Runtime/v90
LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/opengl/lib/glnxa64;
export LD_LIBRARY_PATH;
- Run
dotnet --info
again. The following error is displayed:
dotnet: /usr/local/MATLAB/MATLAB_Runtime/v90/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by dotnet)
You might need to actually install matlab to reproduce this. You can download MatLab 2015b here and install it as follows:
apt-get install -y --no-install-recommends unzip libxt6 libxext6 libxrandr2
unzip -q MCR_R2015b_glnxa64_installer.zip
./install -mode silent -agreeToLicense yes
Expected behavior
dotnet continues to run.
Actual behavior
dotnet does not run.
Environment data
dotnet --info
output:
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.401/
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.401 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
dotnet run OR dotnet watch with development environment ...
I am using dotnet watch command to run asp.net core project. However, by default, it is picking up the Production as an environment....
Read more >LD_LIBRARY_PATH considered harmful | Georg's Log
The purpose of the LD_LIBRARY_PATH environment variable is to instruct the linker to consider additional directories when searching for ...
Read more >NET environment variables - .NET CLI
Learn about the environment variables that you can use to configure the .NET SDK, .NET CLI, and .NET runtime.
Read more >How to permanently set 'LD_LIBRARY_PATH' in CentOS 7
In CentOS 7, the ifconfig command is not installed by default. Instead, the ip command is used to configure and display network interfaces....
Read more >LD_LIBRARY_PATH not loading from .profile nor /etc ...
Hi everybody,. Today I installed Ubuntu 9.04 (wubi) and I tried to add a LD_LIBRARY_PATH to my .profile file, the command is:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe @janvorli’s guidance is the best practice for any application that needs a custom
LD_LIBRARY_PATH
for the purpose of overriding system libraries.I’m going to close this issue as resolved. Please reactivate it if this does not address the issue. Thanks for reporting this to us!
I agree, the guidance to put it into the .profile / .cshrc is really not nice. @isaacabraham I would recommend creating a .sh file that would contain the LD_LIBRARY_PATH setting and matlab launching instead. You would use this script to launch matlab and your environment would stay clean for other applications like dotnet.