Am 26.09.2013 00:30 schröbte p...@pjb.com.au:
> Philipp Janda schröbte:
>> you could modify the `defaults.external_deps_dirs` variable
>> in `luarocks/cfg.lua`
>
> I tried:
>      defaults.external_deps_dirs = { "/usr/local", "/usr",
>        "/lib/i386-linux-gnu", "/usr/lib/i386-linux-gnu",
>      }
> but that seemed to get messed up with the
>      external_deps_subdirs = {
>        bin = "bin",
>        lib = "lib",
>        include = "include"
>      },
> so it seems luarocks needs the last four characters to be /lib So I:
>      mkdir /usr/symlinks
>      ln -s /usr/lib/i386-linux-gnu /usr/symlinks/lib
> And in /usr/local/share/lua/5.2/luarocks/cfg.lua:
>      defaults.external_deps_dirs = { "/usr/local", "/usr",
>        "/usr/symlinks",
>      }
> Which gave me my next error message:
>      Error: Could not find expected file gdbm.h, or gdbm.h for GDBM --
>      you may have to install GDBM in your system and/or pass GDBM_DIR
>      or GDBM_INCDIR to the luarocks command.
> so it seems luarocks needs lib/ and include/ to be subdirs of the
> same directory.  So I:
>      ln -s /usr/include /usr/symlinks/include
> and now it works !! :-)  And should continue to work, for all other
> modules on this machine :-)  Bit rough and primitive, though.

Yes, in the meantime I tried to integrate multiarch directories into 
luarocks, and I stumbled onto the same problems[1] ...

   [1]: https://github.com/keplerproject/luarocks/pull/88

>
> The logic behind looking at /etc/ld.so.conf (and thence /etc/ld.so.conf.d/*)
> is that that's what ld does (see step 8):
>    3.  On an ELF system, for native linkers, ...  search the
>        contents of the environment variable "LD_RUN_PATH".
>    4.  On SunOS, ... search any directories specified using -L options.
>    5.  For a native linker, the search the contents of the environment
>        variable "LD_LIBRARY_PATH".
>    6.  For a native ELF linker, the dirs in "DT_RUNPATH" or "DT_RPATH"
>        of a shared library are searched for shared libraries needed by it.
>        The "DT_RPATH" entries are ignored if "DT_RUNPATH" entries exist.
>    7.  The default directories, normally /lib and /usr/lib.
>    8.  For a native linker on an ELF system, if the file
>        /etc/ld.so.conf exists, the list of directories found in that file.

Yes, I first tried something like the following:

     grep -h -v "^\s*#" /etc/ld.so.conf /etc/ld.so.conf.d/*.conf 
2>/dev/null | grep -v "^\s*include\s\+" | grep -v "^\s*$"

The problem is that with multiarch you can have multiple versions of the 
same library compiled for different architectures and you must figure 
out which one to use for linking ...
Assuming you compile for yourself, you'd want the one native 
architecture. I use `gcc -dumpmachine` ATM to figure that out (although 
it seems I need additional logic for different variants of x86).

>
> A suitable rockspec featuring ~> should follow some time today...

Great!

>
> Regards,  Peter Billam
>

Philipp





------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to