Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load the SIMD JSON library in Cling #442

Closed
1 task done
Keithcat1 opened this issue Oct 20, 2021 · 5 comments · Fixed by root-project/root#15506
Closed
1 task done

Cannot load the SIMD JSON library in Cling #442

Keithcat1 opened this issue Oct 20, 2021 · 5 comments · Fixed by root-project/root#15506
Assignees
Labels

Comments

@Keithcat1
Copy link

Keithcat1 commented Oct 20, 2021

  • Checked for duplicates

Describe the bug

Attempting to #include "simdjson.cpp" (https://github.com/simdjson/simdjson) from the Cling REPL fails with:
[cling]$ #include <simdjson.cpp>
IncrementalExecutor::executeFunction: symbol '??2@YAPEAX_KAEBUnothrow_t@std@@@z' unresolved while linking function '??E?id@?$num_put@DV?$ostreambuf_iterator@DU?$char
traits@D@std@@@std@@@std@@2V0locale@2@A@@YAXXZcling_module_1
'!
You are probably missing the definition of void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '??_U@YAPEAX_KAEBUnothrow_t@std@@@z' unresolved while linking function '??__E?id@?$num_put@DV?$ostreambuf_iterator@DU?$char
traits@D@std@@@std@@@std@@2V0locale@2@A@@YAXXZcling_module_1'!
You are probably missing the definition of void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
Maybe you need to load the corresponding shared library?
[cling]$

Expected behavior

The file is included successfully and I can parse JSON in the REPL ETC.

To Reproduce

git clone https://github.com/simdjson/simdjson
cling
...
#include "simdjson/singleheader/simdjson.cpp"

Setup

Cling version 0.9
Windows 10 (64-bit)
Built it myself using Visual Studio 2019, Cmake and Ninja.

Additional context

This error happens both in CPPYY and Cling.
SIMD JSON has a #define to disable exceptions which didn't work. Building it as a DLL and then loading that didn't work either, though it might have delayed those error messages until actually trying to call into he SIMD JSON API.

@Keithcat1 Keithcat1 added the bug label Oct 20, 2021
@Axel-Naumann
Copy link
Member

@bellenot can we expect that this works? Any insights from your side?

@bellenot
Copy link
Member

@bellenot can we expect that this works? Any insights from your side?

I'll have to investigate and try to fix it

@ferdymercury
Copy link
Contributor

It seems to work now with recent master on Ubuntu22. Could you retry with latest master @Keithcat1 ?

@Keithcat1
Copy link
Author

No, it still doesn't work here on Windows. Tested using master branch of the latest SimdJSON and Cling commit f9b7ba1, since Cling is slow to build. I tried to do whatever the quickstart example did.


C:\py\git>git clone [email protected]:simdjson/simdjson
Cloning into 'simdjson'...
remote: Enumerating objects: 42532, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 42532 (delta 2), reused 3 (delta 0), pack-reused 42514
Receiving objects: 100% (42532/42532), 57.31 MiB | 13.01 MiB/s, done.
Resolving deltas: 100% (33285/33285), done.

C:\py\git>cd simdjson/singleheader

C:\py\git\simdjson\singleheader>cling

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ #include "simdjson.h"
[cling]$ simdjson::dom::parser parser;
[cling]$ simdjson::dom::element tweets = parser.load("twitter.json")
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { ?_Fake_alloc@std@@3U_Fake_allocator@1@B, ??$reset@PEAD$0A@@?$unique_ptr@$$BY0A@DU?$default_delete@$$BY0A@D@std@@@std@@QEAAXPEAD@Z, ??_C@_0BC@EOODALEL@Unknown?5exception?$AA@, ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBAAEBV?$allocator@D@2@XZ, ?_Orphan_all@_Container_base0@std@@QEAAXXZ, ?read_file@parser@dom@simdjson@@AEAA?AU?$simdjson_result@_K@3@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z, ?_Adjust_manually_vector_aligned@std@@YAXAEAPEAXAEA_K@Z, ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ, ??_R3exception@std@@8, ??1simdjson_error@simdjson@@UEAA@XZ, ??_Gbad_array_new_length@std@@UEAAPEAXI@Z, ?max@?$numeric_limits@_J@std@@SA_JXZ, ?root@document@dom@simdjson@@QEBA?AVelement@23@XZ, ??$exchange@PEADAEAPEAD@std@@YAPEADAEAPEAD0@Z, ?__cling_Un1Qu31@@YAXPEAX@Z, ??1bad_alloc@std@@UEAA@XZ, ?_Switch_to_buf@_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAAXXZ, .weak.??__Etweets@@YAXXZcling_module_3_.default.?tweets@@3Velement@dom@simdjson@@A, ??_7bad_alloc@std@@6B@, ??_C@_0BF@KINCDENJ@bad?5array?5new?5length?$AA@, ??$_Allocate@$0BA@U_Default_allocate_traits@std@@$0A@@std@@YAPEAX_K@Z, ??_7exception@std@@6B@, ?allocate@document@dom@simdjson@@QEAA?AW4error_code@3@_K@Z, ??$_Atomic_address_as@_JU?$_Atomic_padded@PEBVimplementation@simdjson@@@std@@@std@@YAPED_JAEBU?$_Atomic_padded@PEBVimplementation@simdjson@@@0@@Z, ??_R1A@?0A@EA@bad_array_new_length@std@@8, ?assign@?$_Narrow_char_traits@DH@std@@SAXAEADAEBD@Z, ??_C@_03PKPBNCAL@?o?$LL?$LP?$AA@, ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CA_K_K00@Z, _GLOBAL__sub_I_cling_module_3, ??_C@_02JDPG@rb?$AA@, ??$_Deallocate@$0BA@$0A@@std@@YAXPEAX_K@Z, ??_Gsimdjson_error@simdjson@@UEAAPEAXI@Z, ?copy@?$_Char_traits@DH@std@@SAPEADQEADQEBD_K@Z, ??$exchange@PEAEAEAPEAE@std@@YAPEAEAEAPEAE0@Z, ??_R2simdjson_error@simdjson@@8, ??_R2exception@std@@8, ??$_Get_size_of_n@$00@std@@YA_K_K@Z, ?tweets@@3Velement@dom@simdjson@@A, ??_R4bad_alloc@std@@6B@, ?allocate_padded_buffer@internal@simdjson@@YAPEAD_K@Z, __orc_init_func.cling-module-3, ??_Gbad_alloc@std@@UEAAPEAXI@Z, ?reset@?$unique_ptr@$$BY0A@EU?$default_delete@$$BY0A@E@std@@@std@@QEAAX$$T@Z, ??_R4exception@std@@6B@, ??$min@_K@std@@YAAEB_KAEB_K0@Z, ??_R0?AVexception@std@@@8, ?load_into_document@parser@dom@simdjson@@QEGAA?AU?$simdjson_result@Velement@dom@simdjson@@@3@AEAVdocument@23@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z, ?length@?$_Narrow_char_traits@DH@std@@SA_KQEBD@Z, ?_Allocate@_Default_allocate_traits@std@@SAPEAX_K@Z, ??0exception@std@@QEAA@QEBDH@Z, ??_R1A@?0A@EA@exception@std@@8, ??_C@_0BA@JFNIOLAK@string?5too?5long?$AA@, ??0exception@std@@QEAA@XZ, ?what@simdjson_error@simdjson@@UEBAPEBDXZ, ??_R3simdjson_error@simdjson@@8, ??0simdjson_error@simdjson@@QEAA@AEBU01@@Z, ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@QEBD@Z, ?allocate@dom_parser_implementation@internal@simdjson@@QEAA?AW4error_code@3@_K0@Z, .weak._GLOBAL__sub_I_cling_module_3.default.?tweets@@3Velement@dom@simdjson@@A, ?error_message@simdjson@@YAPEBDW4error_code@1@@Z, ??$_Convert_size@_K_K@std@@YA_K_K@Z, ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEBAAEBV?$allocator@D@2@XZ, _TI2?AUsimdjson_error@simdjson@@, ??C?$atomic_ptr@$$CBVimplementation@simdjson@@@internal@simdjson@@QEAAPEBVimplementation@2@XZ, ??_R2bad_alloc@std@@8, ??_7bad_array_new_length@std@@6B@, ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBAPEBDXZ, ?reset@?$unique_ptr@$$BY0A@_KU?$default_delete@$$BY0A@_K@std@@@std@@QEAAX$$T@Z, ??_R1A@?0A@EA@simdjson_error@simdjson@@8, ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAV?$allocator@D@2@XZ, $.cling-module-3.__inits.0, ??$_Allocate_at_least_helper@V?$allocator@D@std@@@std@@YAPEADAEAV?$allocator@D@0@AEA_K@Z, ??$_Allocate_for_capacity@$0A@@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEADAEAV?$allocator@D@1@AEA_K@Z, ?get@?$unique_ptr@$$BY0A@DU?$default_delete@$$BY0A@D@std@@@std@@QEBAPEADXZ, ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@U_Zero_then_variadic_args_t@1@@Z, ??$_Unfancy@D@std@@YAPEADPEAD@Z, _CTA2?AUsimdjson_error@simdjson@@, ?allocate@parser@dom@simdjson@@QEAA?AW4error_code@3@_K0@Z, ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ, ??$max@_K@std@@YAAEB_KAEB_K0@Z, ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ, _CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QEAA@AEBV01@@Z24, ??_C@_0N@GPMHHJKD@twitter?4json?$AA@, ??B?$unique_ptr@$$BY0A@EU?$default_delete@$$BY0A@E@std@@@std@@QEBA_NXZ, ??0simdjson_error@simdjson@@QEAA@W4error_code@1@@Z, ??_R4simdjson_error@simdjson@@6B@, _CT??_R0?AVexception@std@@@8??0exception@std@@QEAA@AEBV01@@Z24, ??B?$unique_ptr@$$BY0A@DU?$default_delete@$$BY0A@D@std@@@std@@QEBA_NXZ, ??_R3bad_array_new_length@std@@8, ?capacity@document@dom@simdjson@@QEBA_KXZ, ??_7simdjson_error@simdjson@@6B@, ??_R1A@?0A@EA@bad_alloc@std@@8, ?allocate@?$allocator@D@std@@QEAAPEAD_K@Z, ?load@?$_Atomic_storage@PEBVimplementation@simdjson@@$07@std@@QEBAPEBVimplementation@simdjson@@XZ, ??_R2bad_array_new_length@std@@8, ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ, ??$_Destroy_in_place@PEAD@std@@YAXAEAPEAD@Z, ??_R3bad_alloc@std@@8, ??0bad_alloc@std@@AEAA@QEBD@Z, ?_Large_mode_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QEBA_NXZ, _TI3?AVbad_array_new_length@std@@, _CTA3?AVbad_array_new_length@std@@, ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA_KAEBV?$allocator@D@2@@Z, ??_R0?AVbad_array_new_length@std@@@8, _CT??_R0?AUsimdjson_error@simdjson@@@8??0simdjson_error@simdjson@@QEAA@AEBU01@@Z32, ??0?$allocator@D@std@@QEAA@XZ, ??$exchange@PEA_KAEAPEA_K@std@@YAPEA_KAEAPEA_K0@Z, ??0_Fake_proxy_ptr_impl@std@@QEAA@AEBU_Fake_allocator@1@AEBU_Container_base0@1@@Z, ??B?$unique_ptr@$$BY0A@_KU?$default_delete@$$BY0A@_K@std@@@std@@QEBA_NXZ, ??C?$unique_ptr@Vdom_parser_implementation@internal@simdjson@@U?$default_delete@Vdom_parser_implementation@internal@simdjson@@@std@@@std@@QEBAPEAVdom_parser_implementation@internal@simdjson@@XZ, ??B?$unique_ptr@Vdom_parser_implementation@internal@simdjson@@U?$default_delete@Vdom_parser_implementation@internal@simdjson@@@std@@@std@@QEBA_NXZ, ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ, _CT??_R0?AVbad_array_new_length@std@@@8??0bad_array_new_length@std@@QEAA@AEBV01@@Z24, ??$?0_KAEAW4error_code@simdjson@@$0A@@?$pair@_KW4error_code@simdjson@@@std@@QEAA@$$QEA_KAEAW4error_code@simdjson@@@Z, ??_R4bad_array_new_length@std@@6B@, ?_Release@_Fake_proxy_ptr_impl@std@@QEAAXXZ, ?ensure_capacity@parser@dom@simdjson@@AEAA?AW4error_code@3@AEAVdocument@23@_K@Z, ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAA@XZ, ??$_Construct_in_place@PEADAEBQEAD@std@@YAXAEAPEADAEBQEAD@Z, ?load@parser@dom@simdjson@@QEGAA?AU?$simdjson_result@Velement@dom@simdjson@@@3@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z, ??$reset@PEA_K$0A@@?$unique_ptr@$$BY0A@_KU?$default_delete@$$BY0A@_K@std@@@std@@QEAAXPEA_K@Z, ??_Gexception@std@@UEAAPEAXI@Z, ??$reset@PEAE$0A@@?$unique_ptr@$$BY0A@EU?$default_delete@$$BY0A@E@std@@@std@@QEAAXPEAE@Z, ??_R0?AVbad_alloc@std@@@8, ?error@simdjson_error@simdjson@@QEBA?AW4error_code@2@XZ, ?parse_into_document@parser@dom@simdjson@@QEGAA?AU?$simdjson_result@Velement@dom@simdjson@@@3@AEAVdocument@23@PEBE_K_N@Z, ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QEAA@XZ, ??_R0?AUsimdjson_error@simdjson@@@8, ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QEAAAEAV?$allocator@D@2@XZ, ??$?0Velement@dom@simdjson@@AEAW4error_code@2@$0A@@?$pair@Velement@dom@simdjson@@W4error_code@3@@std@@QEAA@$$QEAVelement@dom@simdjson@@AEAW4error_code@4@@Z, ??__Etweets@@YAXXZcling_module_3_ }) }
IncrementalExecutor::executeFunction: symbol '?get_active_implementation@simdjson@@YAAEAV?$atomic_ptr@$$CBVimplementation@simdjson@@@internal@1@XZ' unresolved while linking [cling interface function]!
You are probably missing the definition of class simdjson::internal::atomic_ptr<class simdjson::implementation const > & __ptr64 __cdecl simdjson::get_active_implementation(void)
Maybe you need to load the corresponding shared library?

bellenot added a commit to bellenot/root that referenced this issue May 14, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
@bellenot
Copy link
Member

bellenot commented May 14, 2024

So the PR root-project/root#15506 fixes the issue, but you'll need to load simdjson.dll nevertheless:

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ #include "singleheader/simdjson.h"
[cling]$ .L ../../build/x64/simdjson/Release/simdjson.dll
[cling]$ simdjson::dom::parser parser;
[cling]$ simdjson::dom::element tweets = parser.load("twitter.json");
[cling]$

bellenot added a commit to root-project/root that referenced this issue May 14, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
FonsRademakers pushed a commit that referenced this issue May 14, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes #442
guitargeek pushed a commit to guitargeek/root that referenced this issue May 16, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
guitargeek pushed a commit to root-project/root that referenced this issue May 16, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
PPaye pushed a commit to PPaye/root that referenced this issue Jun 3, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
silverweed pushed a commit to silverweed/root that referenced this issue Aug 19, 2024
Export the following missing symbols:
```
void * __ptr64 __cdecl operator new(unsigned __int64,struct std::nothrow_t const & __ptr64)
void * __ptr64 __cdecl operator new[](unsigned __int64,struct std::nothrow_t const & __ptr64)
```
and
```
void * __cdecl operator new[](unsigned int,struct std::nothrow_t const &)
void * __cdecl operator new(unsigned int,struct std::nothrow_t const &)
```
Fixes root-project/cling#442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants