question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting LD_LIBRARY_PATH kills dotnet command

See original GitHub issue

Trying 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

  1. Create an Ubuntu VM (16.04 here).
  2. Install the .NET SDK (2.1.401 here).
  3. Run dotnet --info (works fine).
  4. 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;
  1. 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:closed
  • Created 5 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
peterhuenecommented, Sep 5, 2018

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!

1reaction
janvorlicommented, Sep 4, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found