Skip to content

Adding support for string time series - Follow up on #43 #46

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

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

Yida-Lin
Copy link
Member

Follow up on #43.

As discussed:

  • Removing certain outdated data structures like eventMap and use time_series to handle all types of data.
  • As all the data points within a single stream is monotonous, use std::variant<std::vector<...>> instead of std::vector<std::variant<...>> to be more efficient (avoiding redundant std::visit)
  • Other clean ups

@Yida-Lin Yida-Lin requested a review from cbrnr December 29, 2024 08:14
@Yida-Lin
Copy link
Member Author

Hi @cbrnr , I have a pending PR to fix SigViewer as well, but I just realized: SigViewer and libbiosig does not compile on Windows. I only have a Windows laptop. How could we do this?

@cbrnr
Copy link
Collaborator

cbrnr commented Jan 20, 2025

Well, the GetACP error seems to be gone or no? There are a couple more libs missing, like suitesparse, but I'm not sure biosig will compile on Windows. @schloegl do you have a suggestion on how we can proceed? I'm not liking the fact that because of biosig SigViewer cannot be built on Windows.

@schloegl
Copy link

Well, the GetACP error seems to be gone or no? There are a couple more libs missing, like suitesparse, but I'm not sure biosig will compile on Windows. @schloegl do you have a suggestion on how we can proceed? I'm not liking the fact that because of biosig SigViewer cannot be built on Windows.

I suggest to switch to gnu compiler, e.g mingw. In fact, mxe can be used to build sigviewer for windows. So, there is solution - I do not see the need to for an msvc-based build on windows.

@cbrnr
Copy link
Collaborator

cbrnr commented Jan 21, 2025

This is a good idea. Can you try gcc @Yida-Lin?

@Yida-Lin
Copy link
Member Author

Hi @cbrnr @schloegl , actually for all screenshots above, I've always used mingw; I didn't use msvc at all recently. I'm using Qt 5.14.1 MinGW 64-bit2.

image

@cbrnr
Copy link
Collaborator

cbrnr commented Jan 30, 2025

@Yida-Lin then you have to add the missing headers and libraries I guess?

@Yida-Lin
Copy link
Member Author

Hi @cbrnr @schloegl , I think I already added everything from LibBiosig:

image

image

Any advice on what else I should add, and where I can download those?

Thanks

@cbrnr
Copy link
Collaborator

cbrnr commented Jan 31, 2025

I assume you added the corresponding LIBS flags? It might also be a mismatch between library settings and build settings (https://stackoverflow.com/a/10059399/1112283).

What I did (years ago) was to build libbiosig natively on Windows (using MinGW), but I disabled most dependencies (e.g. suitesparse). The static library produced like this did work when compiling SigViewer. I'm not sure if this is still an option, but it would certainly make things easier when you don't have to carry around so many dependencies.

@cbrnr
Copy link
Collaborator

cbrnr commented Jan 31, 2025

Another idea: did you make sure to use the same architecture (i.e., 64bit) for everything? It looks like you might have downloaded the 32bit version of libbiosig, see e.g. this post.

@Yida-Lin
Copy link
Member Author

Yida-Lin commented Feb 3, 2025

Hi @cbrnr ,

I tried again adding all the library flags, but has the following issue:

image

Regarding 64bit: yes, I downloaded the 64 bit libbiosig, otherwise there won't be a libb64.a in there.

image

@cbrnr
Copy link
Collaborator

cbrnr commented Feb 3, 2025

Thanks for checking @Yida-Lin (the file libb64.a is also present in the 32bit version though). I don't know why this is not working, it seems like the cross-compiled library is not compatible with the native libs somehow?

The only thing that comes to my mind is to try and compile libbiosig on Windows.

@cbrnr
Copy link
Collaborator

cbrnr commented Mar 31, 2025

@Yida-Lin Biosig 3.9 contains more precompiled libs for Windows, can you try if this update fixes the problem?

@Yida-Lin
Copy link
Member Author

Hi @cbrnr , thanks for the instructions.

I did try using the following link:

https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C++/windows/biosig-3.9.0-Windows-64bit.zip/download

here is my configuration:

image

image

I am using the SigView main branch at tip, but got the following errors:

image

@cbrnr
Copy link
Collaborator

cbrnr commented Mar 31, 2025

Can you try adding the following libs?

LIBS += -lws2_32 -lmsvcrt -lkernel32

@schloegl
Copy link

I've updated biosig-3.9.0-Windows-64bit.zip in such a way that libws2_32.a is provided, and the .../bin/*.dll are omitted. The link is the same:
https://sourceforge.net/projects/biosig/files/BioSig%20for%20C_C%2B%2B/windows/biosig-3.9.0-Windows-64bit.zip/

Let me know if this fixes the issue.

@Yida-Lin
Copy link
Member Author

Yida-Lin commented Apr 1, 2025

Thanks @cbrnr and @schloegl .

Re-downloaded using the new link and added a few libraries as Clemens suggested.

Now there are fewer errors:

image

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 1, 2025

Could it be you're using a 32bit MinGW and a 64bit libbiosig?

@Yida-Lin
Copy link
Member Author

Yida-Lin commented Apr 1, 2025

It shouldn't be the case

image

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 1, 2025

Very weird. Some additional things you could check:

  1. gcc -v 2>&1 | grep --color=auto "Thread model\|crt": does this show MSVCRT or UCRT?
  2. Does this produce any result? nm -gC /mingw64/lib/libmsvcrt.a | grep fseeki64

@schloegl
Copy link

schloegl commented Apr 1, 2025

I've now also included libmsvcrt.a , and uploaded the revised version to the same address.
This provide __imp__fseeki64. Let me know if anything else is missing.

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 1, 2025

@schloegl why is it necessary that you provide these libraries? These should be available on any Windows installation.

@schloegl
Copy link

schloegl commented Apr 1, 2025

I do not know. You need to tell me why you need it .
When I build SigViewer in MXE, I do not need to provide it, because its already there.
So, if you would use
https://github.com/schloegl/mxe
you would not have any of these issues.

I guess it has to do with the fact, that we use here static linking.
Howevever, when we tried dynamic linking, it seems you run into some other issues.
But it seems the issue is on your side, I just try to help.

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 1, 2025

Thanks @schloegl, I appreciate your help! It is also rather difficult for me to reproduce this issue, because I do not have a Windows machine. My problem here is that I would really like SigViewer to compile and build natively on Windows, as this was the case previously. I'm not sure when this stopped working, but I remember that it did work at some point.

I suggest that we (and by "we" I unfortunately mean just @Yida-Lin as the only person with a Windows machine here) start trying to build libbiosig on Windows using MinGW-W64. I suspect that the issue is caused by MXE builds not being 100% compatible with native Windows builds. @Yida-Lin, would you be up for trying that? Basically, you could start with downloading the latest biosig source and then running ./configure and make lib with your MinGW-W64 toolchain.

@Yida-Lin
Copy link
Member Author

Yida-Lin commented Apr 2, 2025

Hi @cbrnr and @schloegl , thanks for the instructions.

Sure, I can give it a try compiling libbiosig on Windows. Although this week (including the weekend) I am very occupied so I cannot promise a timeline; I will give it a try when I find time, hopefully some time next week.

Thanks

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 2, 2025

Thanks @Yida-Lin! If possible, please also try the two things I suggested in a previous comment.

@Yida-Lin
Copy link
Member Author

Hi @cbrnr ,

I gave it a try, but ran into the following error when compiling libbiosig on Windows:

image

@cbrnr
Copy link
Collaborator

cbrnr commented Apr 21, 2025

@schloegl can you help? There is a getdelim.c file in the win32 folder. I guess there should be a header win32/getline.h with the following contents:

#ifndef GETLINE_H
#define GETLINE_H

#include <stdio.h>

ssize_t getline(char **lineptr, size_t *n, FILE *stream);
ssize_t getdelim(char **lineptr, size_t *n, int delimiter, FILE *stream);

#endif

And this header should then be included in both getline.c and getdelim.c. The Makefile will probably also have to be modified. However, I'm not sure if this is the way to go.

@schloegl
Copy link

schloegl commented May 7, 2025

You ask me to review this, here are my comments.

  • When using MXE that change is not needed.

  • Concerning changing the Makefile, in biosig there is already logic in place to add getline.c and getdelim.c for mingw [1] .

  • Upstream gnulib [2,3] has this line enabled
    #include <config.h>
    Did you check whether this would do as well?

[1] https://sourceforge.net/p/biosig/code/ci/master/tree/biosig4c++/Makefile.in#l131
[2] http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/getline.c;hb=HEAD
[3] http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/getdelim.c;hb=HEAD

@cbrnr
Copy link
Collaborator

cbrnr commented May 7, 2025

This makes me wonder if running make is the correct thing to do on Windows? There used to be make win32 and make win64 targets, but these seem to be obsolete. I guess the key question is: is it possible to build libbiosig on Windows (using MinGW), or does this not work (anymore)? @Yida-Lin works on Windows, so asking him to install Linux and set up MXE just to compile Windows binaries is probably not realistic. IMO, this will also apply to many others who would like to compile libbiosig (and SigViewer) natively on Windows (using MinGW of course).

Technically, you could probably use MXE in WSL2, but this sounds a bit strange (installing a virtualized Linux on Windows just to use it to cross-compile Windows binaries)...

@schloegl
Copy link

schloegl commented May 7, 2025

I'm not maintaining and supporting builts of libiosig on windows anymore. Maintaining such a setup is a significant effort, w/o any obvious benefiit. From my POV, MXE and Wine are good enough and do the job, and as demonstrated in past, it is possible to provide SigViewer for Windows through that toolchain.

@cbrnr
Copy link
Collaborator

cbrnr commented May 7, 2025

I understand that, but it essentially broke the ability to build SigViewer on Windows, which had worked before. I'm not a fan of that, but I suppose we'll have to work around it for now.

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

Successfully merging this pull request may close these issues.

3 participants