deployment failure without error: Rmarkdown with parameters - shiny

I am trying to deploy an Rmarkdown document to RPubs. Required data are in subfolder /Data of the directory where the app is located. Previous errors were solved by loading some (but, mysteriously, not all) libraries on separate lines ('library(). Now, it says deployment is successful, but the website https://yettas.shinyapps.io/ShinyVEST-lite/ returns:
'Error: Error: An error has occurred. Check your logs or contact the app author for clarification.' Unlike previous attempts, I do not see an Error explicitly listed in the logs (see below). I am not sure what to look for other than the word 'Error'.
Thank you in advance for your help!
2022-11-07T15:57:05.864726+00:00 shinyapps[7537976]: 176:
signalCondition 2022-11-07T15:57:05.864730+00:00 shinyapps[7537976]:
175: signal_abort 2022-11-07T15:57:05.864734+00:00 shinyapps[7537976]:
174: abort 2022-11-07T15:57:05.864742+00:00 shinyapps[7537976]: 173:
h 2022-11-07T15:57:05.864759+00:00 shinyapps[7537976]: 172:
.handleSimpleError 2022-11-07T15:57:05.864763+00:00
shinyapps[7537976]: 171: between 2022-11-07T15:57:05.864771+00:00
shinyapps[7537976]: 170: mask$eval_all_filter
2022-11-07T15:57:05.864774+00:00 shinyapps[7537976]: 168:
filter_eval 2022-11-07T15:57:05.864777+00:00 shinyapps[7537976]:
167: filter_rows 2022-11-07T15:57:05.864780+00:00 shinyapps[7537976]:
166: filter.data.frame 2022-11-07T15:57:05.864787+00:00
shinyapps[7537976]: 165: NextMethod 2022-11-07T15:57:05.864797+00:00
shinyapps[7537976]: 164: stopifnot 2022-11-07T15:57:05.864828+00:00
shinyapps[7537976]: 163: .re_sf 2022-11-07T15:57:05.864838+00:00
shinyapps[7537976]: 162: filter.sf 2022-11-07T15:57:05.864842+00:00
shinyapps[7537976]: 161: filter 2022-11-07T15:57:05.864871+00:00
shinyapps[7537976]: 160: select 2022-11-07T15:57:05.864876+00:00
shinyapps[7537976]: 159: mutate 2022-11-07T15:57:05.864888+00:00
shinyapps[7537976]: 158: %!>(MISSING)%!(NOVERB)
2022-11-07T15:57:05.864906+00:00 shinyapps[7537976]: 157:
new.get.data 2022-11-07T15:57:05.864915+00:00 shinyapps[7537976]:
156: %!>(MISSING)%!(NOVERB) 2022-11-07T15:57:05.864927+00:00
shinyapps[7537976]: 155: eval 2022-11-07T15:57:05.864943+00:00
shinyapps[7537976]: 154: eval 2022-11-07T15:57:05.864966+00:00
shinyapps[7537976]: 153: eval_with_user_handlers
2022-11-07T15:57:05.864971+00:00 shinyapps[7537976]: 148:
evaluate_call 2022-11-07T15:57:05.864975+00:00 shinyapps[7537976]:
147: evaluate::evaluate 2022-11-07T15:57:05.864997+00:00
shinyapps[7537976]: 146: evaluate 2022-11-07T15:57:05.865006+00:00
shinyapps[7537976]: 143: eng_r 2022-11-07T15:57:05.865018+00:00
shinyapps[7537976]: 142: block_exec 2022-11-07T15:57:05.865037+00:00
shinyapps[7537976]: 141: call_block 2022-11-07T15:57:05.865059+00:00
shinyapps[7537976]: 140: process_group.block
2022-11-07T15:57:05.865071+00:00 shinyapps[7537976]: 137:
process_file 2022-11-07T15:57:05.865091+00:00 shinyapps[7537976]:
136: knitr::knit 2022-11-07T15:57:05.865096+00:00 shinyapps[7537976]:
135: 2022-11-07T15:57:05.865109+00:00 shinyapps[7537976]:
130: 2022-11-07T15:57:05.865113+00:00 shinyapps[7537976]:
114: doc 2022-11-07T15:57:05.865142+00:00 shinyapps[7537976]: 113:
renderUI 2022-11-07T15:57:05.865149+00:00 shinyapps[7537976]: 112:
func 2022-11-07T15:57:05.865165+00:00 shinyapps[7537976]: 99:
renderFunc 2022-11-07T15:57:05.865171+00:00 shinyapps[7537976]: 98:
output$reactivedoc 2022-11-07T15:57:05.865190+00:00
shinyapps[7537976]: 17:
2022-11-07T15:57:05.865194+00:00 shinyapps[7537976]: 15:
2022-11-07T15:57:05.865219+00:00 shinyapps[7537976]:
13: fn 2022-11-07T15:57:05.865227+00:00 shinyapps[7537976]: 8:
retry 2022-11-07T15:57:05.865245+00:00 shinyapps[7537976]: 7:
connect$retryingStartServer 2022-11-07T15:57:05.865250+00:00
shinyapps[7537976]: 6: eval 2022-11-07T15:57:05.865269+00:00
shinyapps[7537976]: 5: eval 2022-11-07T15:57:05.865273+00:00
shinyapps[7537976]: 4: eval 2022-11-07T15:57:05.865297+00:00
shinyapps[7537976]: 3: eval 2022-11-07T15:57:05.865323+00:00
shinyapps[7537976]: 2: eval.parent
2022-11-07T15:57:05.865339+00:00 shinyapps[7537976]: 1: local

Related

dcvviewer crashing at launch

I'm trying to connect with dcvviewer to a remote server whose my_config_file.dcv configuration file is given.
When I run the command :
dcvviewer my_config_file.csv
The viewer opens and then suddenly closes.
Setting RUST_BACKTRACE=full for debugging purposes, I get the following stack.
thread '<unnamed>' panicked at 'assertion failed: !display_layout2.is_null()', src/display_layout.rs:789:9
stack backtrace:
0: 0x7f5c06ffea40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb070b7fa7e3175df
1: 0x7f5c0705867e - core::fmt::write::hd5207aebbb9a86e9
2: 0x7f5c06fefdc5 - <unknown>
3: 0x7f5c070016f3 - <unknown>
4: 0x7f5c070013df - std::panicking::default_hook::haa3ca8c310ed5402
5: 0x7f5c07001e2a - std::panicking::rust_panic_with_hook::h7b190ce1a948faac
6: 0x7f5c07001ce1 - <unknown>
7: 0x7f5c06ffeeec - <unknown>
8: 0x7f5c07001a42 - rust_begin_unwind
9: 0x7f5c069c4523 - core::panicking::panic_fmt::h8d17ca1073d9a733
10: 0x7f5c069c43ed - core::panicking::panic::hf0565452d0d0936c
11: 0x7f5c06ae46cb - dcv_display_layout_equal_with_epsilon
12: 0x563f87e005c1 - <unknown>
13: 0x563f87e03d55 - <unknown>
14: 0x7f5c06250eae - g_closure_invoke
15: 0x7f5c06264cbc - <unknown>
16: 0x7f5c0627043e - g_signal_emit_valist
17: 0x7f5c06270956 - g_signal_emit
18: 0x7f5c06255824 - <unknown>
19: 0x7f5c06257f34 - g_object_notify_by_pspec
20: 0x7f5c069ffbed - <unknown>
21: 0x7f5c06b0a9ab - <unknown>
22: 0x7f5c06aa54e6 - <unknown>
23: 0x7f5c06106d69 - <unknown>
24: 0x7f5c0610799b - <unknown>
25: 0x7f5c06aa49e7 - <unknown>
26: 0x7f5c06ad6cdc - <unknown>
27: 0x7f5c06f9741c - <unknown>
28: 0x7f5c06f56f9a - <unknown>
29: 0x7f5c062f69ad - g_main_context_dispatch
30: 0x7f5c062f6c00 - <unknown>
31: 0x7f5c062f6ca3 - g_main_context_iteration
32: 0x7f5c06135c4d - g_application_run
33: 0x563f87dfd7a8 - <unknown>
34: 0x7f5c05321d90 - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
35: 0x7f5c05321e40 - __libc_start_main_impl
at ./csu/../csu/libc-start.c:392:3
36: 0x563f87dfd7f5 - _start
37: 0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5
I'm running Ubuntu 22.04 with latest version of dcvviewer (NICE DCV Viewer - version 2022.2 (r4804)).
What can be wrong ?

ld: undefined reference to `lua_`. I don't know why ld cannot reference lua even though its there

I'm trying to install the code from this git-repo for a university project and I'm stuck because ld does not seem to be able to link lua properly. I followed the install instructions and compile the code with:
catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_CXX_STANDARD=14
which fails with several messages like:
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_toboolean(lua_State*, int)'
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_tonumberx(lua_State*, int, int*)'
...
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_pushstring(lua_State*, char const*)'
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_isstring(lua_State*, int)'
collect2: error: ld returned 1 exit status
The code was tested and works on Ubuntu 18.04 but I'm trying to get it to work on Manjaro. The manual states that liblua5.2-dev is needed and I installed lua52 from the AUR which seems to provide the right libraries.
The output of ldd is:
ldd /home/felixk/catkin_ws/devel/lib/libflatland_lib.so | grep lua
liblua5.2.so.5.2 => /usr/lib/liblua5.2.so.5.2 (0x00007f23fd51c000)
Then I checked if /usr/lib/liblua5.2.so.5.2 exists and it does. I tried to use readelf to check whether liblua5.2.so.5.2 contains the undefined references:
readelf -s /usr/lib/liblua5.2.so.5.2
Symbol table '.dynsym' contains 245 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __[...]#GLIBC_2.3 (2)
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND free#GLIBC_2.2.5 (3)
4: 0000000000000000 0 FUNC GLOBAL DEFAULT UND abort#GLIBC_2.2.5 (3)
5: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
6: 0000000000000000 0 FUNC GLOBAL DEFAULT UND ldexp#GLIBC_2.2.5 (4)
7: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
8: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterT[...]
9: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
10: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
11: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __[...]#GLIBC_2.7 (5)
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
13: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fread#GLIBC_2.2.5 (3)
14: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND stdin#GLIBC_2.2.5 (3)
15: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
16: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
17: 0000000000000000 0 FUNC GLOBAL DEFAULT UND atan#GLIBC_2.2.5 (4)
18: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pow#GLIBC_2.29 (6)
19: 0000000000000000 0 FUNC GLOBAL DEFAULT UND clock#GLIBC_2.2.5 (3)
20: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
21: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
22: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __[...]#GLIBC_2.4 (7)
23: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
24: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
25: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
26: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
27: 0000000000000000 0 FUNC GLOBAL DEFAULT UND modf#GLIBC_2.2.5 (4)
28: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
29: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
30: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
31: 0000000000000000 0 FUNC GLOBAL DEFAULT UND close#GLIBC_2.2.5 (3)
32: 0000000000000000 0 FUNC GLOBAL DEFAULT UND log#GLIBC_2.29 (6)
33: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fmod#GLIBC_2.2.5 (4)
34: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
35: 0000000000000000 0 FUNC GLOBAL DEFAULT UND cos#GLIBC_2.2.5 (4)
36: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
37: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
38: 0000000000000000 0 FUNC GLOBAL DEFAULT UND acos#GLIBC_2.2.5 (4)
39: 0000000000000000 0 FUNC GLOBAL DEFAULT UND srand#GLIBC_2.2.5 (3)
40: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
41: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fgets#GLIBC_2.2.5 (3)
42: 0000000000000000 0 FUNC GLOBAL DEFAULT UND frexp#GLIBC_2.2.5 (4)
43: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
44: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
45: 0000000000000000 0 FUNC GLOBAL DEFAULT UND log10#GLIBC_2.2.5 (4)
46: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.3.4 (8)
47: 0000000000000000 0 FUNC GLOBAL DEFAULT UND feof#GLIBC_2.2.5 (3)
48: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
49: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
50: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND memcpy#GLIBC_2.14 (9)
52: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
53: 0000000000000000 0 FUNC GLOBAL DEFAULT UND cosh#GLIBC_2.2.5 (4)
54: 0000000000000000 0 FUNC GLOBAL DEFAULT UND time#GLIBC_2.2.5 (3)
55: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (10)
56: 0000000000000000 0 FUNC GLOBAL DEFAULT UND sinh#GLIBC_2.2.5 (4)
57: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
58: 0000000000000000 0 FUNC GLOBAL DEFAULT UND tan#GLIBC_2.2.5 (4)
59: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
61: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
62: 0000000000000000 0 FUNC GLOBAL DEFAULT UND atan2#GLIBC_2.2.5 (4)
63: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
64: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
65: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
66: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (10)
67: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
68: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
69: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
70: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.11 (11)
71: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
72: 0000000000000000 0 FUNC GLOBAL DEFAULT UND popen#GLIBC_2.2.5 (3)
73: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fopen#GLIBC_2.2.5 (3)
74: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
75: 0000000000000000 0 FUNC GLOBAL DEFAULT UND sin#GLIBC_2.2.5 (4)
76: 0000000000000000 0 FUNC GLOBAL DEFAULT UND tanh#GLIBC_2.2.5 (4)
77: 0000000000000000 0 FUNC GLOBAL DEFAULT UND asin#GLIBC_2.2.5 (4)
78: 0000000000000000 0 FUNC GLOBAL DEFAULT UND exit#GLIBC_2.2.5 (3)
79: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
80: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.3.4 (8)
81: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMC[...]
82: 0000000000000000 0 FUNC GLOBAL DEFAULT UND sqrt#GLIBC_2.2.5 (4)
83: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
84: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (10)
85: 0000000000000000 0 FUNC WEAK DEFAULT UND [...]#GLIBC_2.2.5 (3)
86: 0000000000000000 0 FUNC GLOBAL DEFAULT UND getc#GLIBC_2.2.5 (3)
87: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
88: 0000000000000000 0 FUNC GLOBAL DEFAULT UND exp#GLIBC_2.29 (6)
89: 0000000000000000 0 FUNC GLOBAL DEFAULT UND rand#GLIBC_2.2.5 (3)
90: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (10)
91: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __[...]#GLIBC_2.3 (2)
92: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __[...]#GLIBC_2.3 (2)
93: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND [...]#GLIBC_2.2.5 (3)
94: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [...]#GLIBC_2.3.4 (8)
95: 0000000000007680 135 FUNC GLOBAL DEFAULT 9 lua_arith
96: 0000000000008640 32 FUNC GLOBAL DEFAULT 9 lua_getctx
97: 00000000000085d0 97 FUNC GLOBAL DEFAULT 9 lua_setuservalue
98: 0000000000008bd0 24 FUNC GLOBAL DEFAULT 9 lua_getallocf
99: 00000000000086f0 273 FUNC GLOBAL DEFAULT 9 lua_pcallk
100: 0000000000007a80 47 FUNC GLOBAL DEFAULT 9 lua_touserdata
101: 000000000000aff0 1192 FUNC GLOBAL DEFAULT 9 lua_getinfo
102: 000000000001b420 169 FUNC GLOBAL DEFAULT 9 luaL_openlib
103: 0000000000007460 60 FUNC GLOBAL DEFAULT 9 lua_insert
104: 0000000000007580 83 FUNC GLOBAL DEFAULT 9 lua_isnumber
105: 00000000000149d0 231 FUNC GLOBAL DEFAULT 9 lua_newthread
106: 0000000000024d90 117 FUNC GLOBAL DEFAULT 9 luaL_openlibs
107: 000000000001b360 183 FUNC GLOBAL DEFAULT 9 luaL_setfuncs
108: 000000000001ae50 275 FUNC GLOBAL DEFAULT 9 luaL_tolstring
109: 00000000000074a0 30 FUNC GLOBAL DEFAULT 9 lua_replace
110: 000000000001a840 38 FUNC GLOBAL DEFAULT 9 luaL_buffinitsize
111: 0000000000008df0 72 FUNC GLOBAL DEFAULT 9 lua_upvalueid
112: 0000000000007ef0 108 FUNC GLOBAL DEFAULT 9 lua_getglobal
113: 00000000000209c0 42 FUNC GLOBAL DEFAULT 9 luaopen_os
114: 000000000001a870 214 FUNC GLOBAL DEFAULT 9 luaL_ref
115: 000000000000ae00 5 FUNC GLOBAL DEFAULT 9 lua_gethook
116: 0000000000007370 24 FUNC GLOBAL DEFAULT 9 lua_version
117: 0000000000008260 39 FUNC GLOBAL DEFAULT 9 lua_settable
118: 0000000000019b40 159 FUNC GLOBAL DEFAULT 9 luaL_where
119: 000000000001a1f0 63 FUNC GLOBAL DEFAULT 9 luaL_checktype
120: 000000000001a230 58 FUNC GLOBAL DEFAULT 9 luaL_checkany
121: 0000000000019e90 132 FUNC GLOBAL DEFAULT 9 luaL_fileresult
122: 000000000001a5b0 57 FUNC GLOBAL DEFAULT 9 luaL_optunsigned
123: 0000000000008e40 92 FUNC GLOBAL DEFAULT 9 lua_upvaluejoin
124: 000000000001a050 33 FUNC GLOBAL DEFAULT 9 luaL_setmetatable
125: 000000000001a9b0 656 FUNC GLOBAL DEFAULT 9 luaL_loadfilex
126: 0000000000008c00 76 FUNC GLOBAL DEFAULT 9 lua_newuserdata
127: 0000000000007600 26 FUNC GLOBAL DEFAULT 9 lua_isuserdata
128: 000000000001a2c0 106 FUNC GLOBAL DEFAULT 9 luaL_optlstring
129: 000000000001a6f0 44 FUNC GLOBAL DEFAULT 9 luaL_addstring
130: 0000000000007390 34 FUNC GLOBAL DEFAULT 9 lua_absindex
131: 0000000000007c40 98 FUNC GLOBAL DEFAULT 9 lua_pushstring
132: 00000000000078a0 133 FUNC GLOBAL DEFAULT 9 lua_tounsignedx
133: 0000000000008660 135 FUNC GLOBAL DEFAULT 9 lua_callk
134: 0000000000007560 26 FUNC GLOBAL DEFAULT 9 lua_iscfunction
135: 000000000001ad60 85 FUNC GLOBAL DEFAULT 9 luaL_callmeta
136: 000000000001c470 127 FUNC GLOBAL DEFAULT 9 luaopen_base
137: 00000000000250e0 129 OBJECT GLOBAL DEFAULT 11 lua_ident
138: 0000000000008810 219 FUNC GLOBAL DEFAULT 9 lua_load
139: 000000000001acd0 139 FUNC GLOBAL DEFAULT 9 luaL_getmetafield
140: 0000000000007fe0 44 FUNC GLOBAL DEFAULT 9 lua_rawget
141: 00000000000074c0 37 FUNC GLOBAL DEFAULT 9 lua_copy
142: 0000000000008290 94 FUNC GLOBAL DEFAULT 9 lua_setfield
143: 00000000000072e0 102 FUNC GLOBAL DEFAULT 9 lua_xmove
144: 000000000001f430 216 FUNC GLOBAL DEFAULT 9 luaopen_io
145: 0000000000008d10 221 FUNC GLOBAL DEFAULT 9 lua_setupvalue
146: 0000000000019cd0 315 FUNC GLOBAL DEFAULT 9 luaL_argerror
147: 00000000000080c0 102 FUNC GLOBAL DEFAULT 9 lua_createtable
148: 0000000000007350 22 FUNC GLOBAL DEFAULT 9 lua_atpanic
149: 0000000000008010 50 FUNC GLOBAL DEFAULT 9 lua_rawgeti
150: 000000000000c7a0 155 FUNC GLOBAL DEFAULT 9 lua_yieldk
151: 0000000000008b10 145 FUNC GLOBAL DEFAULT 9 lua_concat
152: 000000000001a330 157 FUNC GLOBAL DEFAULT 9 luaL_checkoption
153: 0000000000008050 108 FUNC GLOBAL DEFAULT 9 lua_rawgetp
154: 0000000000008930 391 FUNC GLOBAL DEFAULT 9 lua_gc
155: 00000000000073e0 64 FUNC GLOBAL DEFAULT 9 lua_settop
156: 000000000001b040 127 FUNC GLOBAL DEFAULT 9 luaL_getsubtable
157: 0000000000007dd0 175 FUNC GLOBAL DEFAULT 9 lua_pushcclosure
158: 000000000001ac40 72 FUNC GLOBAL DEFAULT 9 luaL_loadbufferx
159: 0000000000008bf0 12 FUNC GLOBAL DEFAULT 9 lua_setallocf
160: 0000000000007b30 20 FUNC GLOBAL DEFAULT 9 lua_pushnil
161: 0000000000007a50 39 FUNC GLOBAL DEFAULT 9 lua_tocfunction
162: 000000000001a490 109 FUNC GLOBAL DEFAULT 9 luaL_checkinteger
163: 0000000000019f20 175 FUNC GLOBAL DEFAULT 9 luaL_execresult
164: 000000000000ae10 5 FUNC GLOBAL DEFAULT 9 lua_gethookmask
165: 00000000000082f0 126 FUNC GLOBAL DEFAULT 9 lua_rawset
166: 0000000000008920 5 FUNC GLOBAL DEFAULT 9 lua_status
167: 0000000000008ad0 50 FUNC GLOBAL DEFAULT 9 lua_next
168: 000000000001a180 105 FUNC GLOBAL DEFAULT 9 luaL_checkstack
169: 00000000000081e0 119 FUNC GLOBAL DEFAULT 9 lua_setglobal
170: 000000000001a440 67 FUNC GLOBAL DEFAULT 9 luaL_optnumber
171: 0000000000007420 55 FUNC GLOBAL DEFAULT 9 lua_remove
172: 000000000000af50 154 FUNC GLOBAL DEFAULT 9 lua_setlocal
173: 0000000000019fd0 122 FUNC GLOBAL DEFAULT 9 luaL_newmetatable
174: 0000000000014b10 16 FUNC GLOBAL DEFAULT 9 lua_close
175: 000000000000ae20 4 FUNC GLOBAL DEFAULT 9 lua_gethookcount
176: 00000000000077a0 119 FUNC GLOBAL DEFAULT 9 lua_tonumberx
177: 0000000000007cb0 64 FUNC GLOBAL DEFAULT 9 lua_pushvfstring
178: 0000000000007710 143 FUNC GLOBAL DEFAULT 9 lua_compare
179: 0000000000007e80 29 FUNC GLOBAL DEFAULT 9 lua_pushboolean
180: 0000000000007f60 38 FUNC GLOBAL DEFAULT 9 lua_gettable
181: 000000000001ffa0 118 FUNC GLOBAL DEFAULT 9 luaopen_math
182: 0000000000007ba0 53 FUNC GLOBAL DEFAULT 9 lua_pushunsigned
183: 000000000001b0c0 174 FUNC GLOBAL DEFAULT 9 luaL_requiref
184: 000000000000c650 328 FUNC GLOBAL DEFAULT 9 lua_resume
185: 0000000000008370 110 FUNC GLOBAL DEFAULT 9 lua_rawseti
186: 00000000000088f0 41 FUNC GLOBAL DEFAULT 9 lua_dump
187: 000000000001adc0 130 FUNC GLOBAL DEFAULT 9 luaL_len
188: 0000000000022f50 167 FUNC GLOBAL DEFAULT 9 luaopen_string
189: 0000000000007ec0 40 FUNC GLOBAL DEFAULT 9 lua_pushthread
190: 000000000001b170 224 FUNC GLOBAL DEFAULT 9 luaL_gsub
191: 0000000000008c50 181 FUNC GLOBAL DEFAULT 9 lua_getupvalue
192: 00000000000083e0 174 FUNC GLOBAL DEFAULT 9 lua_rawsetp
193: 0000000000007be0 88 FUNC GLOBAL DEFAULT 9 lua_pushlstring
194: 000000000001a720 71 FUNC GLOBAL DEFAULT 9 luaL_pushresult
195: 000000000000adc0 54 FUNC GLOBAL DEFAULT 9 lua_sethook
196: 00000000000075e0 27 FUNC GLOBAL DEFAULT 9 lua_isstring
197: 0000000000019820 800 FUNC GLOBAL DEFAULT 9 luaL_traceback
198: 000000000001a5f0 193 FUNC GLOBAL DEFAULT 9 luaL_prepbuffsize
199: 000000000001a120 85 FUNC GLOBAL DEFAULT 9 luaL_checkudata
200: 0000000000008ac0 9 FUNC GLOBAL DEFAULT 9 lua_error
201: 000000000001a950 83 FUNC GLOBAL DEFAULT 9 luaL_unref
202: 000000000001e150 42 FUNC GLOBAL DEFAULT 9 luaopen_debug
203: 000000000001b280 217 FUNC GLOBAL DEFAULT 9 luaL_checkversion_
204: 000000000001caa0 42 FUNC GLOBAL DEFAULT 9 luaopen_bit32
205: 0000000000007b50 25 FUNC GLOBAL DEFAULT 9 lua_pushnumber
206: 000000000001a780 146 FUNC GLOBAL DEFAULT 9 luaL_addvalue
207: 000000000001a500 107 FUNC GLOBAL DEFAULT 9 luaL_checkunsigned
208: 000000000001a6c0 46 FUNC GLOBAL DEFAULT 9 luaL_addlstring
209: 0000000000007ab0 21 FUNC GLOBAL DEFAULT 9 lua_tothread
210: 000000000001cf50 42 FUNC GLOBAL DEFAULT 9 luaopen_coroutine
211: 0000000000007620 87 FUNC GLOBAL DEFAULT 9 lua_rawequal
212: 00000000000074f0 33 FUNC GLOBAL DEFAULT 9 lua_pushvalue
213: 0000000000008130 105 FUNC GLOBAL DEFAULT 9 lua_getmetatable
214: 0000000000014720 683 FUNC GLOBAL DEFAULT 9 lua_newstate
215: 0000000000007b70 34 FUNC GLOBAL DEFAULT 9 lua_pushinteger
216: 0000000000023b40 79 FUNC GLOBAL DEFAULT 9 luaopen_table
217: 0000000000007f90 79 FUNC GLOBAL DEFAULT 9 lua_getfield
218: 000000000001a570 57 FUNC GLOBAL DEFAULT 9 luaL_optinteger
219: 0000000000019be0 234 FUNC GLOBAL DEFAULT 9 luaL_error
220: 0000000000007930 47 FUNC GLOBAL DEFAULT 9 lua_toboolean
221: 0000000000007ea0 23 FUNC GLOBAL DEFAULT 9 lua_pushlightuserdata
222: 00000000000079e0 111 FUNC GLOBAL DEFAULT 9 lua_rawlen
223: 0000000000007230 162 FUNC GLOBAL DEFAULT 9 lua_checkstack
224: 0000000000007cf0 218 FUNC GLOBAL DEFAULT 9 lua_pushfstring
225: 0000000000008490 317 FUNC GLOBAL DEFAULT 9 lua_setmetatable
226: 0000000000007ad0 96 FUNC GLOBAL DEFAULT 9 lua_topointer
227: 0000000000007540 18 FUNC GLOBAL DEFAULT 9 lua_typename
228: 0000000000007960 128 FUNC GLOBAL DEFAULT 9 lua_tolstring
229: 000000000001a820 28 FUNC GLOBAL DEFAULT 9 luaL_buffinit
230: 000000000001a770 10 FUNC GLOBAL DEFAULT 9 luaL_pushresultsize
231: 000000000001af70 207 FUNC GLOBAL DEFAULT 9 luaL_pushmodule
232: 000000000001b250 47 FUNC GLOBAL DEFAULT 9 luaL_newstate
233: 000000000001a080 148 FUNC GLOBAL DEFAULT 9 luaL_testudata
234: 0000000000007520 30 FUNC GLOBAL DEFAULT 9 lua_type
235: 000000000000ae80 199 FUNC GLOBAL DEFAULT 9 lua_getlocal
236: 000000000001a270 77 FUNC GLOBAL DEFAULT 9 luaL_checklstring
237: 0000000000008bb0 31 FUNC GLOBAL DEFAULT 9 lua_len
238: 000000000000ae30 79 FUNC GLOBAL DEFAULT 9 lua_getstack
239: 000000000001ac90 50 FUNC GLOBAL DEFAULT 9 luaL_loadstring
240: 00000000000081a0 64 FUNC GLOBAL DEFAULT 9 lua_getuservalue
241: 00000000000073c0 23 FUNC GLOBAL DEFAULT 9 lua_gettop
242: 0000000000007820 117 FUNC GLOBAL DEFAULT 9 lua_tointegerx
243: 0000000000024b50 568 FUNC GLOBAL DEFAULT 9 luaopen_package
244: 000000000001a3d0 111 FUNC GLOBAL DEFAULT 9 luaL_checknumber
It seems like all the undefined references exist in /usr/lib/liblua5.2.so.5.2 and I don't know how to go on from here.
Other answers on SO suggest to put the #includes of lua into a extern "C" like so:
extern "C"{
#include <lua5.2/lualib.h>
#include <lua5.2/lauxlib.h>
#include <lua5.2/lua.h>
}
But I would rather not change the given code and wouldn't even know how to find out in which files lua is #included .
Optimally I would only like to change the make command catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_CXX_STANDARD=14 to help ld to properly link but I don't know if thats possible. I'm not really familiar with make, cmake or in this case catkin_make and couldn't find out if it is possible to add linker options in the make command.
Lua can be compiled both as C ans C++ languages. This is an advertised feature of it. For that reason, Lua authors decided not to include the classic extern "C" in the headers.
Your liblua5.2.so.5.2 library was compiled in C language and the symbols are not mangled. You compiled your application in C++ mode with just including Lua headers without extern "C", so your Lua included symbols are mangled.
Solution: wrap your include with extern "C":
extern "C"
{
#include "lua.h"
}
The other solution would be to recompile Lua 5.2 as C++ language (with -x c++ compiler option for GCC and Clang, or /TP compiler option for MSVC).
I got it working thanks to prapin's answer :)
I installed lua 5.2 from source following the lua manual.
Instead of prapins suggestion to use the -x c++ compiler option I changed the following in the makefile in lua-5.2.0/src:
changed CC= gcc to CC= g++
added -shared -fPIC to MYCFLAGS= because I needed the .so file.
I hope this helps anybody with this problem who does not want to wrap the includes in extern "C"

Delooping an R code for calculation of overlapping intervals

I have data of this format (snippet):
SW_Release deviceType configStartDate configEndDate
1: 04.05.00 21 2005-11-03 19:12:36 2006-02-28 10:19:27
2: 04.05.00 16 2005-11-04 03:59:05 2006-02-28 10:19:27
3: 04.05.00 20 2005-11-04 03:59:06 2006-02-28 10:19:27
4: 04.05.00 15 2005-11-04 03:59:06 2006-02-28 10:19:27
5: 04.05.00 19 2005-11-04 03:59:06 2006-02-28 10:19:27
6: 04.05.00 17 2005-11-04 03:59:06 2006-02-28 10:19:27
7: 04.07.03 16 2006-02-28 10:19:27 2006-03-29 01:00:39
8: 04.07.03 20 2006-02-28 10:19:27 2006-03-29 01:00:41
9: 04.07.01 15 2006-02-28 10:19:27 2006-03-29 01:00:41
10: 04.07.01 19 2006-02-28 10:19:27 2006-03-29 01:00:41
11: 04.07.01 17 2006-02-28 10:19:27 2006-03-29 01:00:42
12: 04.07.01 21 2006-02-28 10:19:27 2006-03-29 01:00:42
13: 04.07.01 18 2006-02-28 10:19:27 2006-03-29 01:00:42
14: 04.07.04 16 2006-03-29 01:00:40 2006-05-01 16:07:49
15: 04.07.04 20 2006-03-29 01:00:41 2006-05-01 16:07:50
16: 04.07.02 15 2006-03-29 01:00:41 2006-05-01 16:07:50
17: 04.07.02 19 2006-03-29 01:00:41 2006-05-01 16:07:51
18: 04.07.02 17 2006-03-29 01:00:42 2006-05-01 16:07:51
19: 04.07.02 21 2006-03-29 01:00:42 2006-05-01 16:07:51
20: 04.07.02 18 2006-03-29 01:00:42 2006-06-01 09:45:36
21: 04.07.04 16 2006-05-02 09:47:57 2006-06-01 09:45:25
22: 04.07.04 20 2006-05-02 09:47:57 2006-06-01 09:45:28
23: 04.07.02 15 2006-05-02 09:47:58 2006-06-01 09:45:31
24: 04.07.02 19 2006-05-02 09:47:58 2006-06-01 09:45:32
25: 04.07.02 17 2006-05-02 09:47:58 2006-06-01 09:45:34
26: 04.07.02 21 2006-05-02 09:47:58 2006-06-01 09:45:35
27: 04.07.05 16 2006-06-01 09:45:27 2006-08-14 17:54:15
28: 04.07.05 20 2006-06-01 09:45:29 2006-08-14 17:54:15
29: 04.07.06 15 2006-06-01 09:45:31 2007-12-12 11:03:00
30: 04.07.06 19 2006-06-01 09:45:33 2007-12-12 11:03:00
31: 04.07.03 17 2006-06-01 09:45:35 2006-08-14 17:54:16
32: 04.07.03 21 2006-06-01 09:45:35 2006-08-14 17:54:16
33: 04.07.04 18 2006-06-01 09:45:37 2007-12-12 11:03:00
34: 04.07.06 16 2006-08-14 17:54:15 2007-12-12 11:02:59
35: 04.07.06 20 2006-08-14 17:54:15 2007-12-12 11:02:59
36: 04.07.04 17 2006-08-14 17:54:16 2007-12-12 11:03:00
37: 04.07.04 21 2006-08-14 17:54:16 2007-12-12 11:03:00
38: 04.05.12 14 2011-06-17 15:40:13 2012-05-24 11:43:24
I need to add up all the intervals (between second-to-last and last columns), but, as you can see, some rows have overlapping or partially overlapping intervals.
Before I add up all the days, I need to convert the full dataset (from which the above snippet came) into something like:
accumulated data:
configStartDate configEndDate
1: 2005-11-03 19:12:36 2007-12-12 11:03:00
2: 2011-06-17 15:40:13 2012-05-24 11:43:24
total days: 934.296
Here’s my R code for doing this (it has to be R, although I am considering re-writing it in C++ and using RCPP):
merge_intervals <- function(interval_dt){
interval_dt <- interval_dt[order(configStartDate), list(configStartDate, configEndDate)]
new_dt <- interval_dt[1, list(configStartDate, configEndDate)]
for (i in 2:dim(interval_dt)[1]) {
buff <- interval_dt[i, list(configStartDate, configEndDate)]
if (new_dt[dim(new_dt)[1], configEndDate] >= buff[, configStartDate]){
if(new_dt[dim(new_dt)[1], configEndDate] >= buff[, configEndDate]){
next
}
else{
new_dt[dim(new_dt)[1], configEndDate := buff[, configEndDate]]
}
}
else {
new_dt <- rbind(new_dt, buff)
}
}
return(new_dt)
}
Right now the whole thing takes about 0.16 seconds to run (with other calculations), but, for 3000 unique assets, that creates 8 minutes calculation time overhead.
How do I transform that for loop into something faster to reduce calculation time? Thanks!
Something like this?
df <- data.frame(
id = 1:3,
start = Sys.time() + c(0, 1000, 3000),
end = Sys.time() + c(1500, 2000, 4000)
)
library(dplyr)
df %>%
mutate(
overlap = lead(start, 1, default = TRUE) < end,
interval = cumsum(overlap)
) %>%
group_by(interval) %>%
summarise(start = min(start), end = max(end)) %>%
mutate(delta = end - start) %>%
summarise(total = sum(delta))

Why is 0x7FFFFFFFull | (1 << 31) returning 0xFFFFFFFFFFFFFFFF in C++?

When I do (0x7fffffff | 0x8000000) I am getting 0xffffffffffffffff instead of the expected 0xffffffff. What am I missing?
Some sample code and output to illustrate my question.
Code:
#include <iostream>
using namespace std;
int main()
{
unsigned long long val = 0;
for (int i = 0; i < 64; i++) {
val |= 0x1 << i;
cout << i << ": " << std::hex << val << std::dec << endl;
}
return 0;
}
Output:
0: 1
1: 3
2: 7
3: f
4: 1f
5: 3f
6: 7f
7: ff
8: 1ff
9: 3ff
10: 7ff
11: fff
12: 1fff
13: 3fff
14: 7fff
15: ffff
16: 1ffff
17: 3ffff
18: 7ffff
19: fffff
20: 1fffff
21: 3fffff
22: 7fffff
23: ffffff
24: 1ffffff
25: 3ffffff
26: 7ffffff
27: fffffff
28: 1fffffff
29: 3fffffff
30: 7fffffff
31: ffffffffffffffff
32: ffffffffffffffff
33: ffffffffffffffff
34: ffffffffffffffff
35: ffffffffffffffff
36: ffffffffffffffff
37: ffffffffffffffff
38: ffffffffffffffff
39: ffffffffffffffff
40: ffffffffffffffff
41: ffffffffffffffff
42: ffffffffffffffff
43: ffffffffffffffff
44: ffffffffffffffff
45: ffffffffffffffff
46: ffffffffffffffff
47: ffffffffffffffff
48: ffffffffffffffff
49: ffffffffffffffff
50: ffffffffffffffff
51: ffffffffffffffff
52: ffffffffffffffff
53: ffffffffffffffff
54: ffffffffffffffff
55: ffffffffffffffff
56: ffffffffffffffff
57: ffffffffffffffff
58: ffffffffffffffff
59: ffffffffffffffff
60: ffffffffffffffff
61: ffffffffffffffff
62: ffffffffffffffff
63: ffffffffffffffff
Firstly your code does not do what you say in your title/question; I have edited the title.
The problem is 1 << 31. If you have 32-bit int (which apparently you do, judging by the results), this cause arithmetic overflow. In C++14 this is implementation-defined behaviour; prior to C++14 it causes undefined behaviour. Reference.
Usually the implementation-defined behaviour will be to generate the int with the sign bit set and the other bits unset. In 2's complement this value is INT_MIN. You then perform arithmetic between an unsigned long long and an int. This is defined as: the int is converted to unsigned long long.
Converting signed integers to unsigned is done by wrapping it around (modular arithmetic) modulo ULLONG_MAX+1. So the result of (unsigned long long)INT_MIN is a very large positive number, in fact 0xFFFFFFFF80000000. (To check this, add 0x80000000 to it to get 0).
So you are actually doing 0x7FFFFFFF | 0xFFFFFFFF80000000 which gives the observed result.
Later on it gets worse: 1 << 32 and larger causes undefined behaviour due to shifting by the whole width of the type.
To fix this, change 0x1 in your code to 1ull. The you will be shifting an unsigned long long, instead of an int.
because of sign extension val is an unsigned long long. But val is not what you are shifting. You are shifting 0x1, an int, then extending it to long long for the '|='

Getting started with Datomic and Clojure in Emacs

My project.clj file looks like this
(defproject cljs-template "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.4.0-beta4"]
[noir-cljs "0.3.0"]
[fetch "0.1.0-alpha2"]
[noir "1.3.0-beta2"]
[org.clojure/core.cache "0.5.0"]
[com.datomic/datomic "0.1.3142"
:exclusions [org.slf4j/slf4j-nop org.slf4j/slf4j-log4j12]]
[ch.qos.logback/logback-classic "1.0.1"]]
:plugins [[lein-swank "1.4.3"]]
;:cljsbuild {:builds [{}]}
:main ^{:skip-aot true} cljs-template.server)
and my /src/cljs_template/server.clj begins as the following:
(ns cljs-template.server
(:require [noir.server :as server]
[noir.cljs.core :as cljs]
[cljs-template.tree :as tree])
(:use [datomic.api :only [db q] :as d]))
I then start up swank, run (in-ns 'cljs-template.server) within it, move my cursor to the end of the (ns) function call, and attempt to run the (ns) method using Ctrl-x Ctrl-e. When I do so, I get the following error.
No message.
[Thrown class java.lang.ExceptionInInitializerError]
Restarts:
0: [QUIT] Quit to the SLIME top level
1: [CAUSE1] Invoke debugger on cause org.apache.lucene.index.IndexWriterConfig [Thrown class java.lang.ClassNotFoundException]
Backtrace:
0: (Unknown Source) java.lang.Class.forName0
1: Class.java:247 java.lang.Class.forName
2: RT.java:2030 clojure.lang.RT.loadClassForName
3: RT.java:417 clojure.lang.RT.load
4: RT.java:398 clojure.lang.RT.load
5: core.clj:5386 clojure.core/load[fn]
6: core.clj:5385 clojure.core/load
7: RestFn.java:408 clojure.lang.RestFn.invoke
8: core.clj:5200 clojure.core/load-one
9: core.clj:5237 clojure.core/load-lib
10: RestFn.java:142 clojure.lang.RestFn.applyTo
11: core.clj:602 clojure.core/apply
12: core.clj:5271 clojure.core/load-libs
13: RestFn.java:137 clojure.lang.RestFn.applyTo
14: core.clj:602 clojure.core/apply
15: core.clj:5352 clojure.core/require
16: RestFn.java:436 clojure.lang.RestFn.invoke
17: fulltext_index.clj:4 datomic.fulltext-index/loading
18: (Unknown Source) datomic.fulltext_index__init.load
19: (Unknown Source) datomic.fulltext_index__init.<clinit>
20: (Unknown Source) java.lang.Class.forName0
21: Class.java:247 java.lang.Class.forName
22: RT.java:2030 clojure.lang.RT.loadClassForName
23: RT.java:417 clojure.lang.RT.load
24: RT.java:398 clojure.lang.RT.load
25: core.clj:5386 clojure.core/load[fn]
26: core.clj:5385 clojure.core/load
27: RestFn.java:408 clojure.lang.RestFn.invoke
28: core.clj:5200 clojure.core/load-one
29: core.clj:5237 clojure.core/load-lib
30: RestFn.java:142 clojure.lang.RestFn.applyTo
31: core.clj:602 clojure.core/apply
32: core.clj:5271 clojure.core/load-libs
33: RestFn.java:137 clojure.lang.RestFn.applyTo
34: core.clj:602 clojure.core/apply
35: core.clj:5352 clojure.core/require
36: RestFn.java:703 clojure.lang.RestFn.invoke
37: db.clj:4 datomic.db/loading
38: (Unknown Source) datomic.db__init.load
39: (Unknown Source) datomic.db__init.<clinit>
40: (Unknown Source) java.lang.Class.forName0
41: Class.java:247 java.lang.Class.forName
42: RT.java:2030 clojure.lang.RT.loadClassForName
43: RT.java:417 clojure.lang.RT.load
44: RT.java:398 clojure.lang.RT.load
45: core.clj:5386 clojure.core/load[fn]
46: core.clj:5385 clojure.core/load
47: RestFn.java:408 clojure.lang.RestFn.invoke
48: core.clj:5200 clojure.core/load-one
49: core.clj:5237 clojure.core/load-lib
50: RestFn.java:142 clojure.lang.RestFn.applyTo
51: core.clj:602 clojure.core/apply
52: core.clj:5271 clojure.core/load-libs
53: RestFn.java:137 clojure.lang.RestFn.applyTo
54: core.clj:602 clojure.core/apply
55: core.clj:5352 clojure.core/require
56: RestFn.java:703 clojure.lang.RestFn.invoke
57: query.clj:4 datomic.query/loading
58: (Unknown Source) datomic.query__init.load
59: (Unknown Source) datomic.query__init.<clinit>
60: (Unknown Source) java.lang.Class.forName0
61: Class.java:247 java.lang.Class.forName
62: RT.java:2030 clojure.lang.RT.loadClassForName
63: RT.java:417 clojure.lang.RT.load
64: RT.java:398 clojure.lang.RT.load
65: core.clj:5386 clojure.core/load[fn]
66: core.clj:5385 clojure.core/load
67: RestFn.java:408 clojure.lang.RestFn.invoke
68: core.clj:5200 clojure.core/load-one
69: core.clj:5237 clojure.core/load-lib
70: RestFn.java:142 clojure.lang.RestFn.applyTo
71: core.clj:602 clojure.core/apply
72: core.clj:5271 clojure.core/load-libs
73: RestFn.java:137 clojure.lang.RestFn.applyTo
74: core.clj:602 clojure.core/apply
75: core.clj:5352 clojure.core/require
76: RestFn.java:421 clojure.lang.RestFn.invoke
77: api.clj:6 datomic.api/loading
78: (Unknown Source) datomic.api__init.load
79: (Unknown Source) datomic.api__init.<clinit>
80: (Unknown Source) java.lang.Class.forName0
81: Class.java:247 java.lang.Class.forName
82: RT.java:2030 clojure.lang.RT.loadClassForName
83: RT.java:417 clojure.lang.RT.load
84: RT.java:398 clojure.lang.RT.load
85: core.clj:5386 clojure.core/load[fn]
86: core.clj:5385 clojure.core/load
87: RestFn.java:408 clojure.lang.RestFn.invoke
88: core.clj:5200 clojure.core/load-one
89: core.clj:5237 clojure.core/load-lib
90: RestFn.java:142 clojure.lang.RestFn.applyTo
91: core.clj:602 clojure.core/apply
92: core.clj:5271 clojure.core/load-libs
93: RestFn.java:137 clojure.lang.RestFn.applyTo
94: core.clj:604 clojure.core/apply
95: core.clj:5363 clojure.core/use
96: RestFn.java:408 clojure.lang.RestFn.invoke
97: NO_SOURCE_FILE:1 cljs-template.server/eval1941[fn]
98: NO_SOURCE_FILE:1 cljs-template.server/eval1941
99: Compiler.java:6465 clojure.lang.Compiler.eval
100: Compiler.java:6455 clojure.lang.Compiler.eval
101: Compiler.java:6431 clojure.lang.Compiler.eval
102: core.clj:2795 clojure.core/eval
103: core.clj:532 swank.core/eval782[fn]
104: MultiFn.java:163 clojure.lang.MultiFn.invoke
105: basic.clj:54 swank.commands.basic/eval-region
106: basic.clj:44 swank.commands.basic/eval-region
107: basic.clj:73 swank.commands.basic/eval968[fn]
108: Var.java:401 clojure.lang.Var.invoke
109: (Unknown Source) user/eval1937
110: Compiler.java:6465 clojure.lang.Compiler.eval
111: Compiler.java:6431 clojure.lang.Compiler.eval
112: core.clj:2795 clojure.core/eval
113: core.clj:100 swank.core/eval-in-emacs-package
114: core.clj:256 swank.core/eval-for-emacs
115: Var.java:409 clojure.lang.Var.invoke
116: AFn.java:167 clojure.lang.AFn.applyToHelper
117: Var.java:518 clojure.lang.Var.applyTo
118: core.clj:600 clojure.core/apply
119: core.clj:107 swank.core/eval-from-control
120: core.clj:330 swank.core/spawn-worker-thread[fn]
121: AFn.java:159 clojure.lang.AFn.applyToHelper
122: AFn.java:151 clojure.lang.AFn.applyTo
123: core.clj:600 clojure.core/apply
124: core.clj:326 swank.core/spawn-worker-thread[fn]
125: RestFn.java:397 clojure.lang.RestFn.invoke
126: AFn.java:24 clojure.lang.AFn.run
127: Thread.java:662 java.lang.Thread.run
I then press 0 to close the stacktrace, and press Ctrl-x Ctrl-e on the (ns) call again, now my error is:
Could not initialize class datomic.api__init
[Thrown class java.lang.NoClassDefFoundError]
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: (Unknown Source) java.lang.Class.forName0
1: Class.java:247 java.lang.Class.forName
2: RT.java:2030 clojure.lang.RT.loadClassForName
3: RT.java:417 clojure.lang.RT.load
4: RT.java:398 clojure.lang.RT.load
5: core.clj:5386 clojure.core/load[fn]
6: core.clj:5385 clojure.core/load
7: RestFn.java:408 clojure.lang.RestFn.invoke
8: core.clj:5200 clojure.core/load-one
9: core.clj:5237 clojure.core/load-lib
10: RestFn.java:142 clojure.lang.RestFn.applyTo
11: core.clj:602 clojure.core/apply
12: core.clj:5271 clojure.core/load-libs
13: RestFn.java:137 clojure.lang.RestFn.applyTo
14: core.clj:604 clojure.core/apply
15: core.clj:5363 clojure.core/use
16: RestFn.java:408 clojure.lang.RestFn.invoke
17: NO_SOURCE_FILE:1 cljs-template.server/eval6292[fn]
18: NO_SOURCE_FILE:1 cljs-template.server/eval6292
19: Compiler.java:6465 clojure.lang.Compiler.eval
20: Compiler.java:6455 clojure.lang.Compiler.eval
21: Compiler.java:6431 clojure.lang.Compiler.eval
22: core.clj:2795 clojure.core/eval
23: core.clj:532 swank.core/eval782[fn]
24: MultiFn.java:163 clojure.lang.MultiFn.invoke
25: basic.clj:54 swank.commands.basic/eval-region
26: basic.clj:44 swank.commands.basic/eval-region
27: basic.clj:73 swank.commands.basic/eval968[fn]
28: Var.java:401 clojure.lang.Var.invoke
29: (Unknown Source) cljs-template.server/eval6288
30: Compiler.java:6465 clojure.lang.Compiler.eval
31: Compiler.java:6431 clojure.lang.Compiler.eval
32: core.clj:2795 clojure.core/eval
33: core.clj:100 swank.core/eval-in-emacs-package
34: core.clj:256 swank.core/eval-for-emacs
35: Var.java:409 clojure.lang.Var.invoke
36: AFn.java:167 clojure.lang.AFn.applyToHelper
37: Var.java:518 clojure.lang.Var.applyTo
38: core.clj:600 clojure.core/apply
39: core.clj:107 swank.core/eval-from-control
40: core.clj:330 swank.core/spawn-worker-thread[fn]
41: AFn.java:159 clojure.lang.AFn.applyToHelper
42: AFn.java:151 clojure.lang.AFn.applyTo
43: core.clj:600 clojure.core/apply
44: core.clj:326 swank.core/spawn-worker-thread[fn]
45: RestFn.java:397 clojure.lang.RestFn.invoke
46: AFn.java:24 clojure.lang.AFn.run
47: Thread.java:662 java.lang.Thread.run
What am I doing wrong? How do I get datomic working in my emacs using swank/slime.
Turns out I was executing the wrong command.
I was running lein deps and getting the following error.
...
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic -Dversion=0.1.3157 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.datomic -DartifactId=datomic -Dversion=0.1.3157 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:pom:2.0
2) com.datomic:datomic:jar:0.1.3157
I saw that the README file in the downloaded datomic code also contained mention of adding datomic to my mvn. Naturally (here comes the stupid part) I assumed that they sort of said the same thing.
lein will tell you that you should execute
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic -Dversion=0.1.3157 -Dpackaging=jar -Dfile=/path/to/file
the README says you should execute
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic -Dfile=datomic-${DATOMIC-VERSION}.jar -DpomFile=pom.xml
Did you notice that the README instructions also includes a pom.xml file? Neither did I! Yeah, that is important.
Anyway, be sure to also include the pom.xml file. If you were trying to add datomic 0.1.3157 to your mvn repository, you would execute the following in the datomic directory you downloaded.
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic -Dfile=datomic-0.1.3157.jar -DpomFile=pom.xml
I posted a working project here
my usual suspect in debugging swank problems are:
is leiningen up to date
the version of lein-swank
version of emacs (Emacs 24, I have found to be much more reliable)
leftover old dependencies in the lib dir
EDIT: the correct way to get the datomic jar is as Stephen Cagle says, copied from his comment below:
mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic -Dfile=datomic-${DATOMIC-VERSION}.jar