dlt-daemon
dlt-daemon copied to clipboard
Can this daemon be compiled with windows
Is it possible to compile this with windows and create a dll instead of so file.
@manojc99 I'm afraid that current DLT cannot be compiled on Windows. It seems initial version of dlt-daemon supported Windows, but after that it was considered for Linux usage only, so some headers, which are not available on Windows, are not excluded for Windows.
@manojc99 Do you have any updates from your side?
you can comile by using cygwin on windows, I have done
Thanks for the reply Rimon. Any instructions that you can share please
On Wed, 25 Sep 2019, 3:28 pm Rimon Chen, [email protected] wrote:
you can comile by using cygwin on windows, I have done
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GENIVI/dlt-daemon/issues/136?email_source=notifications&email_token=AHT32ULS6KNEXOSTHBZC27TQLMY5JA5CNFSM4HYPGSZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RKSEA#issuecomment-534948112, or mute the thread https://github.com/notifications/unsubscribe-auth/AHT32UP6GOFE63AWBQ2T2F3QLMY5JANCNFSM4HYPGSZQ .
git pull to this version eb3dcd26c80c4ac6e431b09b50b0861b9753ceea(master) and then modified as follow diff output
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index b7766f0..ed548f0 100644
static int dlt_daemon_init_fifo(DltDaemonLocal *daemon_local)
if (daemon_local->daemonFifoSize != 0) {
/* Set Daemon FIFO size */
- if (fcntl(fd, F_SETPIPE_SZ, daemon_local->daemonFifoSize) == -1) {
+ if (fcntl(fd, FD_SETSIZE, daemon_local->daemonFifoSize) == -1) {
snprintf(str, DLT_DAEMON_TEXTBUFSIZE, "set FIFO size error: %s\n", strerror(errno));
dlt_log(LOG_ERR, str);
}
}
/* Get Daemon FIFO size */
- if ((fifo_size = fcntl(fd, F_GETPIPE_SZ, 0)) == -1) {
+ if ((fifo_size = fcntl(fd, FD_GETSIZE, 0)) == -1) {
snprintf(str, DLT_DAEMON_TEXTBUFSIZE, "get FIFO size error: %s\n", strerror(errno));
dlt_log(LOG_ERR, str);
}
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
* \file dlt_user.c
*/
+ #define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_DEFAULT
+ #define pthread_mutex_consistent pthread_mutex_lock
+
#include <stdlib.h> /* for getenv(), free(), atexit() */
#include <string.h> /* for strcmp(), strncmp(), strlen(), memset(), memcpy() */
#include <signal.h> /* for signal(), SIGPIPE, SIG_IGN */
@@ -413,10 +416,10 @@ DltReturnValue dlt_init(void)
}
/* make mutex robust to prevent from deadlock when the segmented thread was cancelled, but held the mutex */
- if (pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST) != 0) {
- dlt_user_initialised = false;
- return DLT_RETURN_ERROR;
- }
+ //if (pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST) != 0) {
+ // dlt_user_initialised = false;
+ // return DLT_RETURN_ERROR;
+ //}
pthread_mutex_init(&mq_mutex, &attr);
pthread_mutexattr_destroy(&attr);
Thanks for the reply Rimon. Any instructions that you can share please … On Wed, 25 Sep 2019, 3:28 pm Rimon Chen, @.***> wrote: you can comile by using cygwin on windows, I have done — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#136?email_source=notifications&email_token=AHT32ULS6KNEXOSTHBZC27TQLMY5JA5CNFSM4HYPGSZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RKSEA#issuecomment-534948112>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHT32UP6GOFE63AWBQ2T2F3QLMY5JANCNFSM4HYPGSZQ .
@chenlimingcn You can edit your comment above to put the diff in the diff code block. Example:
```diff - removed + added ```
@chenlimingcn Thanks, great to know that you could compile successfully for Windows too. As suggested from @votrungchi , please modify your comment to show the code diff properly. It's even worth to write it down somewhere in the doc.
@ssugiura have done as above
Awesome, Will try this and update
I have compiled it with cygwin before and it works, if you need I can share the compiled file to you.
@koreyoshi-wang , Have you done with cygwin without the change proposed by @chenlimingcn , or any other steps required? Now I know that there are couple of use cases where users want to use DLT on Windows, so I would like to collect all of suggestions and take them into account.
@koreyoshi-wang This is a friendly reminder. Please let us know how you compiled for Windows.
Hi @chenlimingcn , I got the below error while doing make install on cygwin.
$ make install [ 1%] Linking C shared library cygdlt-2.dll /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsocket collect2: error: ld returned 1 exit status make[2]: *** [src/lib/CMakeFiles/dlt.dir/build.make:174: src/lib/cygdlt-2.dll] Error 1 make[1]: *** [CMakeFiles/Makefile2:160: src/lib/CMakeFiles/dlt.dir/all] Error 2 make: *** [Makefile:130: all] Error 2
@koreyoshi-wang This is a friendly reminder. Please let us know how you compiled for Windows.
Hi ssugiura, I have replaced a dependence (pthreads pthreads-w32-2-9-1-release.zip for cygwin, and no change proposed by @chenlimingcn.
@koreyoshi-wang can you please share the precompiled binaries
@koreyoshi-wang can you please share the precompiled binaries
dlt.zip It's compiled with 64-bit system, and tested on windows 10. Filter didn't work, and I have tried with Linux it didn't work too, so I don't know why.
@koreyoshi-wang Thank you for sharing the binary. Could you able to fix filter issue? Can you please share build instructions for windows?
@koreyoshi-wang @senthil4321 Any update on this?
@koreyoshi-wang Could you please let me know a way to replace pthreads dependency for cygwin?
@koreyoshi-wang @senthil4321 Any update on this?
No, I just compiled once, and filter didn't work, but I tested Linux Version the same problem, I don not know the recent status.
@koreyoshi-wang Could you please let me know a way to replace pthreads dependency for cygwin?
Sorry, I have uninstalled my cygwin, you just need to search pthreads in your cygwin library and replace ti.
@ssugiura @koreyoshi-wang, managed to make the filter work with the windows binary provided. Some points to note. 1. Filter should be in xml format.(Used dlt viewer gui application to create filter) 2. Both Appication ID and Context ID needs to be enabled in the filter. Hope this helps.
@manojc99 To avoid the socket error comment out all instances of:
#set(RT_LIBRARY "")
#set(SOCKET_LIBRARY socket)
and change to(Note these can be copied directly from the if statement above.)
set(RT_LIBRARY rt)
set(SOCKET_LIBRARY "")
The cygwin environment does not have libsocket, but should have librt
Edit: This compiles the code, but I have not tested functionality.
may I get libdlt.dll that exported all symbols?
If you are asking me; I no longer have access to the build.
Found this repository which has pre-compile file https://github.com/mbehr1/adlt
Hello @michael-methner I find this topic DLT on Window very interesting. Should we have an official doc for this topic? If it is OK, I will collect and summarize all users' idea or methods and prepare for a PR. Regards
I'm building a C++ app on Window by Visual Studio. I also finish installing DLT daemon by Cygwin on window. How can we send a log message from C++ app to DLT daemon by using DLT library? Is it possible on Window?
Hello @thanhthieuBKDN Not sure about dlt on Window since I have not tried yet. For dlt usage you can refer to this doc: https://github.com/COVESA/dlt-daemon/blob/master/doc/dlt_for_developers.md Regards
@koreyoshi-wang hi, is there any way to set the value of the port in dlt-receive.exe? or is there any other way to do it?