[Nix-dev] linking error
stewart mackenzie
setori88 at gmail.com
Thu Oct 17 08:34:50 CEST 2013
Dear nixors,
I've reinstalled my system using LVM to allow for greater space on
root if I run out, so this is a fresh clean system.
I've setup a mozart-oz development environment with all the needed
dependencies (although I still had to nix-env -i * them as the weren't
in ~/.nix-profile/lib, I assumed I could have a clean system and just
run load-env-mozart to get all dependencies, why do I still have to
run nix-env -i boost etc to make them available in
~/.nix-profile/lib?)
here is my ~/.nixpkgs/config.nix:
"
{
packageOverrides = pkgs : with pkgs; {
# needed mozart development environment
# type 'load-env-mozart' to load it after installing it using
'nix-env -i env-mozart'
sdlEnv = pkgs.myEnvFun {
name = "mozart";
buildInputs = [stdenv cmake clang boost gcc47 emacs tcl
tk git gnumake jdk];
};
};
}
"
now installing it then running 'load-env-mozart' then fail to run my executable.
here is my ldd output:
"
mozart:[stewart at rivergod:~/oz/bin]$ ldd ozemulator
linux-vdso.so.1 (0x00007fffd4c84000)
libboost_program_options.so.1.54.0 => not found
libboost_random.so.1.54.0 => not found
libboost_system.so.1.54.0 => not found
libboost_thread.so.1.54.0 => not found
libboost_filesystem.so.1.54.0 => not found
libboost_chrono.so.1.54.0 => not found
libpthread.so.0 =>
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/libpthread.so.0
(0x00007f6d36d46000)
librt.so.1 =>
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/librt.so.1
(0x00007f6d36b3d000)
libstdc++.so.6 => not found
libm.so.6 =>
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/libm.so.6
(0x00007f6d3683f000)
libgcc_s.so.1 => not found
libc.so.6 =>
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/libc.so.6
(0x00007f6d3648f000)
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib/ld-linux-x86-64.so.2
(0x00007f6d36f62000)
"
I need to satisfy all of the above library paths.
here are my ldconfig -v and ldconfig -p outputs:
"
mozart:[stewart at rivergod:~/oz/bin]$ ldconfig -v
ldconfig: Warning: ignoring configuration file that cannot be opened:
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/etc/ld.so.conf:
No such file or directory
ldconfig: Path `/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib64'
given more than once
ldconfig: Can't stat
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/libx32: No such
file or directory
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/lib:
libpcprofile.so -> libpcprofile.so
libc.so.6 -> libc-2.17.so
libcidn.so.1 -> libcidn-2.17.so
libnss_dns.so.2 -> libnss_dns-2.17.so
libBrokenLocale.so.1 -> libBrokenLocale-2.17.so
libresolv.so.2 -> libresolv-2.17.so
libutil.so.1 -> libutil-2.17.so
libnss_nisplus.so.2 -> libnss_nisplus-2.17.so
libSegFault.so -> libSegFault.so
libm.so.6 -> libm-2.17.so
libdl.so.2 -> libdl-2.17.so
librt.so.1 -> librt-2.17.so
libpthread.so.0 -> libpthread-2.17.so
libmemusage.so -> libmemusage.so
libthread_db.so.1 -> libthread_db-1.0.so
libcrypt.so.1 -> libcrypt-2.17.so
libnss_compat.so.2 -> libnss_compat-2.17.so
libnss_hesiod.so.2 -> libnss_hesiod-2.17.so
libnsl.so.1 -> libnsl-2.17.so
libnss_files.so.2 -> libnss_files-2.17.so
libnss_nis.so.2 -> libnss_nis-2.17.so
libnss_db.so.2 -> libnss_db-2.17.so
libanl.so.1 -> libanl-2.17.so
ld-linux-x86-64.so.2 -> ld-2.17.so
ldconfig: Can't create temporary cache file
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/etc/ld.so.cache~:
Read-only file system
mozart:[stewart at rivergod:~/oz/bin]$ ldconfig -p
ldconfig: Can't open cache file
/nix/store/zm4bhsm8lprkzvrjgqr0klfkvr21als4-glibc-2.17/etc/ld.so.cache
: No such file or directory
"
Here are my questions (as I'm trying to keep this as pure a possible):
How do I correctly setup LD_LIBRARY_PATH in nixos?
-- do I use configuration.nix?
How do I correctly setup library dependencies in nixos?
-- how do I interact with ld.so.conf? via configuration.nix?
Kind regards
Stewart
More information about the nix-dev
mailing list