[petsc-dev] Mac OS X El Capitan does not propagate DYLD_LIBRARY_PATH from parent process

Jed Brown jed at jedbrown.org
Wed Oct 7 16:36:36 CDT 2015


Satish Balay <balay at mcs.anl.gov> writes:

> So 'env' and 'printenv' cannont find DYLD_LIBRARY_PATH? - but 'echo' can?

$DYLD_LIBRARY_PATH is expanded by the calling shell, so this doesn't say
anything about "echo".  Also,

$ type echo
echo is a shell builtin
$ type env
env is /usr/bin/env
$ type printenv
printenv is /usr/bin/printenv

> Trying out code from http://stackoverflow.com/questions/2085302/printing-all-environment-variables-in-c-c
>
>>>>>>>>>>
> balay at imav^~/junk $ cat env2.c
> #include <stdio.h>
>
> int main(int argc, char **argv, char** envp)
> {
>   char** env;
>   for (env = envp; *env != 0; env++)
>     {
>       char* thisEnv = *env;
>       printf("%s\n", thisEnv);    
>     }
>   return(0);
> }
> balay at imav^~/junk $ gcc env2.c
> alay at imav^~/junk $ ./a.out |grep DYLD
> DYLD_LIBRARY_PATH=foobar
> balay at imav^~/junk $ 
>
> <<<<<<<<<<
>
> This works - but not env, printenv?

Are those executables?  If the behavior different if you copy them to
HOME and/or rename them?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20151007/e12a1e4c/attachment.sig>


More information about the petsc-dev mailing list