Luarocks on windows not recognizing my lua_libdir - lua

i want to install nngraph on lua using luarocks
using this code
luarocks --from=https://raw.githubusercontent.com/torch/rocks/master/ install nngraph
but it's give me an error
it said :
Error: Failed finding Lua library. You may need to configure LUA_LIBDIR.
does anyone have same experience? can you solve it ?
this was my config-5.2.lua :
rocks_trees = {
{ name = [[user]],
root = home..[[/luarocks]],
},
{ name = [[system]],
root = [[d:\shared\ta\_bootstrap\_install\]],
},
}
variables = {
MSVCRT = 'MSVCRT',
LUALIB = 'D:\\Shared\\TA\\_bootstrap\\_install\\lib\\liblua.dll.a',
LUA_LIBDIR = 'D:\\Shared\\TA\\_bootstrap\\_install\\lib'
}
verbose = false -- set to 'true' to enable verbose output

Is your config-5.2.lua file located in one of the searched paths? I installed the stand-alone binaries (with Lua version 5.3), which searches for C:/Program Files (x86)/luarocks/config-5.3.lua & %APPDATA%/luarocks/config-5.3.lua. Neither of these files existed on my system & I had to create one manually. Running the luarocks command without any arguments will show you where it searches. If you want to use a custom location, you can set the LUAROCKS_CONFIG environment variable.
I was able to get mine working by adding the following variables to my configuration (Note: I am using MinGW/GCC compiler):
rocks_trees = {
{ name = [[system]], root = [[C:/Development/Lua53]] },
}
variables = {
LUA = 'C:/Development/Lua53/bin/lua',
LUA_BINDIR = 'C:/Development/Lua53/bin',
LUA_INCDIR = 'C:/Development/Lua53/include',
LUA_LIBDIR = 'C:/Development/Lua53/lib',
CC = 'gcc',
LD = 'gcc',
}
The CC & LD variables are only necessary if it has trouble finding the compiler or linker (defaults to mingw32-gcc on my system).
Sources:
http://lua-users.org/wiki/LuaRocksConfig
http://lua-users.org/lists/lua-l/2015-12/msg00172.html
https://github.com/luarocks/luarocks/wiki/config-file-format
I hope this helps.
Edit: If all else fails, you may want to have a look at LuaDist. It is a Lua distribution with its own package management system & includes LuaRocks & some other libraries/utilities pre-installed. I haven't tried it yet, but I plan to.

Related

Is it possible to compile GLib (and then compile Autotrace) with Emscripten?

Compiling with Emscripten seems really easy with typical configure, make and make install workflows.
I would like to compile Autotrace (which uses this workflow), but it requires GLib.
In the Emscripten doc, it is mentioned that in such case GLib must be compiled with Emscripten. However GLib uses meson and ninja as compile tools.
Is it possible to compile GLib with Emscripten? (and will it be enough to get Autotrace working in a browser?)
Meson supports cross-compiling, so you can treat Emscripten as a cross compiler by writing a 'cross file':
emscripten.txt
[binaries]
c = '/opt/emsdk-portable/emscripten/1.38.8/emcc'
cpp = '/opt/emsdk-portable/emscripten/1.38.8/em++'
ar = '/opt/emsdk-portable/emscripten/1.38.8/emar'
#exe_wrapper = 'node'
[properties]
root = '/opt/emsdk-portable/emscripten/1.38.8/system'
c_args = ['-s', 'WASM=1', '-O2']
c_link_args = ['-s', 'WASM=1','-O2']
cpp_args = ['-s', 'WASM=1','-O2']
cpp_link_args = ['-s', 'WASM=1','-O2']
shared_lib_suffix = 'js'
static_lib_suffix = 'js'
shared_module_suffix = 'js'
exe_suffix = 'js'
[host_machine]
system = 'emscripten'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
(This was taken from https://github.com/prozum/meson-samples/blob/master/emscripten.txt)
Replace the paths with the paths to your Emscripten tools. Then invoke meson with meson --cross-file=emscripten.txt.

Missing files in Yocto SDK

I have some files downloaded by a certain recipe during an Yocto image build. I want to include them in the SDK of the same image.
I add this recipe in TOOLCHAIN_TARGET_TASK.
When I build the SDK based on the my custom image(populate_sdk) these files are missing from the resulting SDK. I can see only some certain header files made for that particular recipe.
I want to know how I can include these files in the SDK build. I didn't find any commands that does that for files for SDKs.
For reference, the files are downloaded by the recipe from this git:
https://github.com/dji-sdk/Onboard-SDK/archive/3.6.zip
The Recipe:
SUMMARY = "DJI Onboard SDK"
SECTION = "libs"
LICENSE_FLAGS = "osdk"
LICENSE = "CLOSED"
PV = "3.6"
SRC_URI = "https://github.com/dji-sdk/Onboard-SDK/archive/${PV}.zip"
FILESEXTRAPATHS_prepend := "${THISDIR}/Onboard-SDK-${PV}:"
TOOLCHAIN_TARGET_TASK_append = " osdk"
S="${WORKDIR}/Onboard-SDK-${PV}"
INSANE_SKIP_${PN} = "dev-so"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
inherit pkgconfig cmake
FILES_${PN} = "usr/lib/* usr/share/*"
FILES_${PN}-dev = "usr/include/*"
Could you please:
- Give us the recipe
- Tell us how you have populated TOOLCHAIN_TARGET_TASK variable ?
Should be something like that:
TOOLCHAIN_TARGET_TASK_append = " <recipename>-staticdev"
Have you add (inside the recipe):
BBCLASSEXTEND = "native nativesdk"
So we need more info to help you :)

About toml line break in dependencies of Cargo.toml

I write dependencies of Cargo.toml :
[dependencies ]
opencv = {version = "0.26", default-features = false, features = ["opencv-41"]}
Above one line can pass compilation.
I want to seperate lines for dependencies.
This page
https://github.com/BurntSushi/toml-test/blob/master/tests/valid/multiline-string.toml
said solution.
I refer this solution to write my dependencies:
[dependencies ]
opencv = """\{version = "0.26", \
default-features = false, \
features = ["opencv-41"] \
}"""
But compiler throw error:
$ cargo build [±master ●]
error: failed to parse manifest at /home/curlywei/WorkSpace/rust/testcargo/Cargo.toml
Caused by:
failed to parse the version requirement { version = "0.26", default-features = false, features = ["opencv-41"] } for dependency opencv
Caused by:
the given version requirement is invalid
How do I do?
Your link contains examples of multiline strings, not tables. In TOML, inline tables may not contain newlines.
Instead, the TOML spec suggests using a regular table:
No newlines are allowed between the curly braces unless they are valid within a value. Even so, it is strongly discouraged to break an inline table onto multiples lines. If you find yourself gripped with this desire, it means you should be using standard tables.
[dependencies.opencv]
version = "0.26"
default-features = false
features = ["opencv-41"]

How do I disable assertions for the entire project?

I have some code in Delphi that has Assert statements all over it. I know that there is a compiler directive {$C-}, but there are too many units to add it to. Is there a way to have it done by the compiler command line or somewhere in the dpr file?
You can use $C- from the command line as well, or configure it in 'Project->Options->Compiler' from the IDE (which configures it in the .dproj file).
There's a list of command line switches and options available by typing dcc32 from the command line. It can be redirected to a text file using command redirection (as in dcc32 > dccCommands.txt), which produces the following output with XE5's version of dcc32:
Embarcadero Delphi for Win32 compiler version 26.0
Copyright (c) 1983,2013 Embarcadero Technologies, Inc.
Syntax: dcc32 [options] filename [options]
-A<unit>=<alias> = Set unit alias
-B = Build all units
-CC = Console target
-CG = GUI target
-D<syms> = Define conditionals
-E<path> = EXE/DLL output directory
-F<offset> = Find error
-GD = Detailed map file
-GP = Map file with publics
-GS = Map file with segments
-H = Output hint messages
-I<paths> = Include directories
-J = Generate .obj file
-JPHNE = Generate C++ .obj file, .hpp file, in namespace, export all
-JL = Generate package .lib, .bpi, and all .hpp files for C++
-K<addr> = Set image base addr
-LE<path> = package .bpl output directory
-LN<path> = package .dcp output directory
-LU<package> = Use package
-M = Make modified units
-NU<path> = unit .dcu output directory
-NH<path> = unit .hpp output directory
-NO<path> = unit .obj output directory
-NB<path> = unit .bpi output directory
-NX<path> = unit .xml output directory
-NS<namespaces> = Namespace search path
-O<paths> = Object directories
-P = look for 8.3 file names also
-Q = Quiet compile
-R<paths> = Resource directories
-TX<ext> = Output name extension
-U<paths> = Unit directories
-V = Debug information in EXE
-VR = Generate remote debug (RSM)
-VT = Debug information in TDS
-VN = TDS symbols in namespace
-W[+|-|^][warn_id] = Output warning messages
-Z = Output 'never build' DCPs
-$<dir> = Compiler directive
--help = Show this help screen
--version = Show name and version
--codepage:<cp> = specify source file encoding
--default-namespace:<namespace> = set namespace
--depends = output unit dependency information
--doc = output XML documentation
--drc = output resource string .drc file
--no-config = do not load default dcc32.cfg file
--description:<string> = set executable description
--inline:{on|off|auto} = function inlining control
--legacy-ifend = allow legacy $IFEND directive
--zero-based-strings[+|-] = strings are indexed starting at 0
--peflags:<flags> = set extra PE Header flags field
--peoptflags:<flags> = set extra PE Header optional flags field
--peosversion:<major>.<minor> = set OS Version fields in PE Header (default: 5.0)
--pesubsysversion:<major>.<minor> = set Subsystem Version fields in PE Header (default: 5.0)
--peuserversion:<major>.<minor> = set User Version fields in PE Header (default: 0.0)
Compiler switches: -$<letter><state> (defaults are shown below)
A8 Aligned record fields
B- Full boolean Evaluation
C+ Evaluate assertions at runtime
D+ Debug information
G+ Use imported data references
H+ Use long strings by default
I+ I/O checking
J- Writeable structured consts
L+ Local debug symbols
M- Runtime type info
O+ Optimization
P+ Open string params
Q- Integer overflow checking
R- Range checking
T- Typed # operator
U- Pentium(tm)-safe divide
V+ Strict var-strings
W- Generate stack frames
X+ Extended syntax
Y+ Symbol reference info
Z1 Minimum size of enum types
Stack size: -$M<minStackSize[,maxStackSize]> (default 16384,1048576)

Does LuaRocks rockspec use only file names for module sub-names?

Is it normal for LuaRocks to ignore the module name in a rockspec, using the filename instead?
build = {
type = "builtin",
modules = {
apricot = "src/apricot.lua",
["apricot.stuff"] = "src/apricot/seeds.lua",
-- `apricot.stuff` is renamed to `apricot.seeds`
-- when installed as a rock.
}
}
(Lua 5.1, LuaRocks 2.1.0)
Yes, it was a bug. I just pushed a fix:
https://github.com/keplerproject/luarocks/commit/0b8605f5d53a9fef54ca17bf5447132327b0ae6e
Please let me know (preferably in the bug tracker) if there are any problems with this fix. Thank you!

Resources