ldconfig equivalent in Mac OS X?
The answer is no. But you can still configure the search path via environment variables, see dyld(1).
Where and how to set DYLD environment in Mac OS X
man dyld
DYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH
Is it OK to use DYLD_LIBRARY_PATH on Mac OS X? And, what's the dynamic library search algorithm with it?
As you've noted, DYLD_LIBRARY_PATH
behaves like LD_LIBRARY_PATH
on other *nix. However, there is another environment variable you should look at called DYLD_FALLBACK_LIBRARY_PATH
.
In general, these are (both on osx and linux) suggested only for development use as they can cause symbol lookup errors when you override with a library that does not have the same symbol table. A good example of this is when you attempt to override the default install of VecLib (e.g. blas lapack) with a custom install. This will cause symbol not found errors in applications linked to the system VecLib if DYLD_LIBRARY_PATH
is set and the reverse (symbol lookup errors in custom applications) if it is not. This is due to the system blas/lapack not being a full implementation of the ATLAS libs.
DYLD_FALLBACK_LIBRARY_PATH
will not produce these problems.
When installing libraries to a non-standard location, DYLD_FALLBACK_LIBRARY_PATH
is much more sane. This will look for symbols in libraries provided in the default paths and if the symbol is not found there, fall back to the specified path.
The benefit is that this process will not cause symbol lookup errors in applications compiled against the default libraries.
In general, when libraries are installed to non-standard locations absolute paths should be specified which negates the ambiguity of the dynamic lookup.
Installing readline 6.0 on OS X
Actually, this isn't an error at all... it's just a notice message at the end of the install. It get this too, and my readline 6 is happily installed.
If you check /usr/local/lib
and see readline there, you're done :-) No need to run any equivalent of ldconfig.
$ ls /usr/local/lib | grep readline
libreadline.6.0.dylib
libreadline.6.dylib
libreadline.a
libreadline.dylib
How can I mimic the GNU/linux C development environment on OSX Lion?
I can think of three possibilities:
You had 10.6 installed and upgraded to 10.7. You need to install the new version of Xcode (4.1, get it from the app store) to get back the developer tools.
you installed Xcode, did a custom install, and unchecked "UNIX development" or something. Rerun the installer and install the missing parts.
You installed a broken third-party version of gcc. Try
which gcc
and see what you get.
terminal error: cp: illegal option
You don't have --preserve
option in Mac version of cp
. Use -p
option instead (see man page)
Sometimes replacing Mac coreutils with the GNU
ones may be a good solution. See this thread to learn more about installing GNU
coreutils on your Mac.
Also, the ldconfig
won't work on Mac either. See this discussion to find an alternative.
Related Topics
What Should Linux/Unix 'Make Install' Consist Of
Remove Line of Text from Multiple Files in Linux
Fuzzy File Search in Linux Console
Print Date for the Monday of the Current Week (In Bash)
How to Udp Broadcast with C in Linux
How Can the Linux Kernel Be Forced to Enumerate the Pci-E Bus
Run Bash Command on Jenkins Pipeline
Location of .Bashrc for "Bash on Ubuntu on Windows" in Windows 10
How to Run a Command in a Chroot Jail Not as Root and Without Sudo
How to Open Some Ports on Ubuntu
Why Do We Need a Swapper Task in Linux
Call a Kernel Module Function from Program at User Space
Update-Alternatives: Warning: /Etc/Alternatives/Java Is Dangling
Get MAC Address Using Shell Script