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

building error in Mac OS Big SUR Chip M1 #66

Open
andraderenew opened this issue Jul 24, 2021 · 5 comments
Open

building error in Mac OS Big SUR Chip M1 #66

andraderenew opened this issue Jul 24, 2021 · 5 comments

Comments

@andraderenew
Copy link

andraderenew commented Jul 24, 2021

Dear community:

I was trying to build from source App-LabRecorder but I still don't know why with or without rosetta I cannot get it to work.

ld: warning: ignoring file /Users/andraderenew/opt/anaconda3/lib/liblsl64.1.13.0.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_lsl_copy_streaminfo", referenced from:
      _main in clirecorder.cpp.o
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
      std::__1::thread::thread<void (recording::*)(lsl::stream_info const&, bool), recording*, lsl::stream_info const&, bool, void>(void (recording::*&&)(lsl::stream_info const&, bool), recording*&&, lsl::stream_info const&, bool&&) in recording.cpp.o
      std::__1::thread::thread<void (recording::*)(lsl::stream_info const&, bool), recording*, lsl::stream_info&, bool, void>(void (recording::*&&)(lsl::stream_info const&, bool), recording*&&, lsl::stream_info&, bool&&) in recording.cpp.o
  "_lsl_create_inlet", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_create_streaminfo", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_destroy_inlet", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
      std::__1::__shared_ptr_pointer<lsl::stream_inlet*, std::__1::shared_ptr<lsl::stream_inlet>::__shared_ptr_default_delete<lsl::stream_inlet, lsl::stream_inlet>, std::__1::allocator<lsl::stream_inlet> >::__on_zero_shared() in recording.cpp.o
  "_lsl_destroy_streaminfo", referenced from:
      _main in clirecorder.cpp.o
      std::__1::vector<lsl::stream_info, std::__1::allocator<lsl::stream_info> >::vector<lsl::lsl_streaminfo_struct_**>(lsl::lsl_streaminfo_struct_**, std::__1::enable_if<(__is_cpp17_forward_iterator<lsl::lsl_streaminfo_struct_**>::value) && (is_constructible<lsl::stream_info, std::__1::iterator_traits<lsl::lsl_streaminfo_struct_**>::reference>::value), lsl::lsl_streaminfo_struct_**>::type) in clirecorder.cpp.o
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
      recording::record_from_query_results(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in recording.cpp.o
      std::__1::vector<lsl::stream_info, std::__1::allocator<lsl::stream_info> >::vector<lsl::lsl_streaminfo_struct_**>(lsl::lsl_streaminfo_struct_**, std::__1::enable_if<(__is_cpp17_forward_iterator<lsl::lsl_streaminfo_struct_**>::value) && (is_constructible<lsl::stream_info, std::__1::iterator_traits<lsl::lsl_streaminfo_struct_**>::reference>::value), lsl::lsl_streaminfo_struct_**>::type) in recording.cpp.o
      std::__1::thread::thread<void (recording::*)(lsl::stream_info const&, bool), recording*, lsl::stream_info const&, bool, void>(void (recording::*&&)(lsl::stream_info const&, bool), recording*&&, lsl::stream_info const&, bool&&) in recording.cpp.o
      void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (recording::*)(lsl::stream_info const&, bool), recording*, lsl::stream_info, bool> >(void*) in recording.cpp.o
      ...
  "_lsl_destroy_string", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
      lsl::stream_inlet::pull_sample(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, int, double) in recording.cpp.o
  "_lsl_get_channel_count", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_get_channel_format", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_get_fullinfo", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_get_hostname", referenced from:
      _main in clirecorder.cpp.o
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_get_name", referenced from:
      _main in clirecorder.cpp.o
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
      recording::record_from_query_results(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in recording.cpp.o
  "_lsl_get_nominal_srate", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_get_source_id", referenced from:
      recording::record_from_query_results(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in recording.cpp.o
  "_lsl_get_uid", referenced from:
      recording::record_from_query_results(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in recording.cpp.o
  "_lsl_get_xml", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_local_clock", referenced from:
      recording::record_offsets(unsigned int, std::__1::shared_ptr<lsl::stream_inlet> const&, std::__1::atomic<bool>&) in recording.cpp.o
  "_lsl_open_stream", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_pull_sample_buf", referenced from:
      lsl::stream_inlet::pull_sample(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, int, double) in recording.cpp.o
  "_lsl_pull_sample_c", referenced from:
      lsl::stream_inlet::pull_sample(std::__1::vector<char, std::__1::allocator<char> >&, double) in recording.cpp.o
  "_lsl_pull_sample_d", referenced from:
      void recording::typed_transfer_loop<double>(unsigned int, double, std::__1::shared_ptr<lsl::stream_inlet> const&, double&, double&, unsigned long long&) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<double>(std::__1::vector<double, std::__1::allocator<double> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
  "_lsl_pull_sample_f", referenced from:
      void recording::typed_transfer_loop<float>(unsigned int, double, std::__1::shared_ptr<lsl::stream_inlet> const&, double&, double&, unsigned long long&) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<float>(std::__1::vector<float, std::__1::allocator<float> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
  "_lsl_pull_sample_i", referenced from:
      void recording::typed_transfer_loop<int>(unsigned int, double, std::__1::shared_ptr<lsl::stream_inlet> const&, double&, double&, unsigned long long&) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<int>(std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
  "_lsl_pull_sample_s", referenced from:
      void recording::typed_transfer_loop<short>(unsigned int, double, std::__1::shared_ptr<lsl::stream_inlet> const&, double&, double&, unsigned long long&) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<short>(std::__1::vector<short, std::__1::allocator<short> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
  "_lsl_resolve_all", referenced from:
      _main in clirecorder.cpp.o
  "_lsl_resolve_bypred", referenced from:
      recording::record_from_query_results(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in recording.cpp.o
  "_lsl_samples_available", referenced from:
      bool lsl::stream_inlet::pull_chunk_multiplexed<char>(std::__1::vector<char, std::__1::allocator<char> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<short>(std::__1::vector<short, std::__1::allocator<short> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<int>(std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<float>(std::__1::vector<float, std::__1::allocator<float> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<double>(std::__1::vector<double, std::__1::allocator<double> >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
      bool lsl::stream_inlet::pull_chunk_multiplexed<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::vector<double, std::__1::allocator<double> >*, double, bool) in recording.cpp.o
  "_lsl_set_postprocessing", referenced from:
      recording::record_from_streaminfo(lsl::stream_info const&, bool) in recording.cpp.o
  "_lsl_stream_info_matches_query", referenced from:
      _main in clirecorder.cpp.o
  "_lsl_time_correction", referenced from:
      recording::record_offsets(unsigned int, std::__1::shared_ptr<lsl::stream_inlet> const&, std::__1::atomic<bool>&) in recording.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [LabRecorderCLI.app/Contents/MacOS/LabRecorderCLI] Error 1
make[1]: *** [CMakeFiles/LabRecorderCLI.dir/all] Error 2
make: *** [all] Error 2
@tstenner
Copy link
Contributor

You need liblsl compiled for M1; for some reason the linker doesn't quit when trying to link against a library with the wrong architecture and ignores the file instead:

ld: warning: ignoring file /Users/andraderenew/opt/anaconda3/lib/liblsl64.1.13.0.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:

Also, 1.13.0 is quite old so unless there's a good reason to use it I suggest you build against 1.15 or later. I don't think there are official M1 builds, so you would have to build liblsl locally and then give the path to the local liblsl when building LabRecorder.

@cboulay
Copy link
Contributor

cboulay commented Jul 26, 2021

@andraderenew , I would appreciate it if you could test the hombrew formula.
https://github.com/labstreaminglayer/homebrew-tap

(currently targeting 1.14b9, only because I didn't bump it to 1.15 yet)

@andraderenew
Copy link
Author

How do I test for this? Sorry for late reply. I know is brew install…. But I don’t know what goes in the …

@cboulay
Copy link
Contributor

cboulay commented Jun 22, 2022

I have a Mac with an M1 now so I can test on my own.
brew install labstreaminglayer/tap/labrecorder should do it.

But, if I recall correctly, it wasn't so simple. I think I ended up building it myself in CLion. Sorry, no time to test right now.

@danielelozzi
Copy link

Hello! I installed all for lsl but i cannot find the executable app! I cannot find LabRecorder.app , unless lslver give me the correct output. Where i can find labrecorder.app?

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants