LuaRocks handles dependencies on Lua modules — rocks can specify other rocks it depends on, and attempts to fulfill those dependencies at install time. A rock will only be installed if all its dependencies can be fulfilled.
LuaRocks also supports verification of dependencies on external libraries. A rock can specify an external package it depends on (for example, a C library), and give to LuaRocks hints on how to detect if it is present, typically as C header or library filenames. LuaRocks then looks for these files in a pre-configured search path and, if found, assumes the dependency is fulfilled. If not found, an error message is reported and the user can then install the missing external dependency (using the tools provided by their operating system) or inform LuaRocks of the location of the external dependency in case it was installed and LuaRocks failed to find it.
Dependencies of a rock are specified in its rockspec file. See the complete specification of the dependency syntax in the Rockspec format page and examples in rockspec files of the public rocks server.