Why does my executable not run under bash ?

I've got a command line executable (compiled using nvcc and clang), which works fine when I run it from the command line.

This means it's executed from the tcsh (which is my interactive shell).


However, when I try to run the same executable from the bash , either a bash script or the interactive bash,

it fails with the error message


dyld: Symbol not found: _iconv

Referenced from: /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/Languag eModeling

Expected in: /opt/local/lib/libiconv.2.dylib

in /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/Languag eModeling


But the library is there in /opt/local/lib.


Any hints what I can check will be greatly appreciated.


Best regards,

Gabriel.

MacBook Pro with Retina display, OS X El Capitan (10.11.2), iPhone 6S, always latest iOS

Posted on Jan 12, 2016 2:49 PM

Reply
3 replies

Jan 13, 2016 6:26 AM in response to Tony T1

Thanks a lot for your response!


Yes, this is my complete script


#!/bin/tcsh echo LD_LIBRARY_PATH echo $LD_LIBRARY_PATH ./particles -n=30000

Actually, LD_LIBRARY_PATH is not defined, when i run this script. This is very puzzling to me, too, because I thought that the executable (in this case the tcsh) inherits all environment variables from the parent. And when I do setenv in my interactive shell, I can clearly see LD_LIBRARY_PATH .

Jan 13, 2016 7:12 AM in response to GabrielZ

It seems like I actually need to define the environment variable in the script itself again. This works


#!/bin/bash


CUDA="/Developer/NVIDIA/CUDA-6.5"

export DYLD_FALLBACK_LIBRARY_PATH=":/usr/local/lib:/opt/local/lib:/usr/X11R6/lib:${CUD A}/lib:${CUDA}/samples/common/lib/darwin"

./particles -n=30000


It is a mystery to me why the bash script does not inherit the value of DYLD_FALLBACK_LIBRARY_PATH from its parent (in this case, my interactive shell).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does my executable not run under bash ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.