Compiling ohNet on FreeBSD
|
06-01-2015, 07:44 AM
Post: #21
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(05-01-2015 11:57 PM)simonc Wrote: An empty implementation is exactly what you showed above - an ifdef/endif with nothing in between. I presume this would mean that applications such as MinimServer couldn't detect interface changes on FreeBSD. Would it be be possible to add code to implement this functionality for FreeBSD? Are there any other aspects of the proposed FreeBSD changes that would remove other functionality? |
|||
06-01-2015, 08:43 AM
Post: #22
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(06-01-2015 07:44 AM)simoncn Wrote: I presume this would mean that applications such as MinimServer couldn't detect interface changes on FreeBSD.Yes, that's correct. This could be inconvenient on a laptop that roamed between networks but would have minimal impact on a desktop with a wired connection. Perhaps unreasonably, I'd assumed a FreeBSD machine would likely fall into this latter category. (06-01-2015 07:44 AM)simoncn Wrote: Would it be be possible to add code to implement this functionality for FreeBSD?In theory, yes. The OP said that (s)he wasn't a programmer at the start of the thread so I thought this might be too complicated a change for me to suggest. I don't have a FreeBSD machine to try something like this on; I'd be very happy to accept any tested patch however. (06-01-2015 07:44 AM)simoncn Wrote: Are there any other aspects of the proposed FreeBSD changes that would remove other functionality?No. All other ohNet functionality would be present as normal. |
|||
06-01-2015, 06:25 PM
Post: #23
|
|||
|
|||
![]()
Regarding the discussion about the reduced functionality of ohnet on FreeBSD (detecting interface changes), I can add that at least in my usecase this will not matter. I plan to implement Minimserver on FreeNAS running within a jail (a poor-man's virtualisation/sandboxing technique of FreeBSD). The host OS will provide a virtual interface to the jail, which will not change and stay always up. First I also planned to building a plugin to easily install Minimserver on FreeNAS-installations (for the community). But as I learned in the FreeNAS-forum, the plugin-system with jails will probably be heavily modified in the next main-release (real virtualization instead of jails), so I will postpone that until this is clear.
Regarding bringing ohNet to compile, I did implement the suggested changes. There was still the following error happening: Code: gcc -o Build/Obj/Posix/Release/Os.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -fPIC -DPLATFORM_FREEBSD -Werror -IBuild/Include/ Os/Posix/Os.c I could fix that by just completely removing the line 67: Code: # define MSG_NOSIGNAL 0 After that, compilation seems to suceed and run through! ![]() Code: python bundle_binaries.py --system FreeBSD --architecture x86 --configuration Release I tried removing the "--system" parameter alltogether, or replacing it with "Core", but neither worked. These are the possibilities: Code: python bundle_binaries.py --system Core --architecture x86 --configuration Release FreeBSD is not in that list. Do you have an idea? |
|||
06-01-2015, 08:10 PM
Post: #24
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(06-01-2015 06:25 PM)airflow Wrote: Regarding bringing ohNet to compile, I did implement the suggested changes. There was still the following error happening: That line is important for our Mac builds. Can you ifdef it out for FreeBSD only please? (06-01-2015 06:25 PM)airflow Wrote: There is a problem left which I'm researching right now: I think you could fix that by adding the lines Code: BuildTarget("FreeBSD", "x86", "Debug"): BuildInfo(builddir="Build/Obj/Posix/Debug"), Creating a bundle of build artifacts is optional for you build so don't worry too much if this doesn't fix it. If you get a build working, the next step would be to test it out. You can do this using the AllTests.py script: Code: python AllTests.py --incremental --full --native When things are complete, I'll be happy to accept a patch to save you having to maintain a fork. You can either post the output of git diff or, better, submit a pull request against the github repo. |
|||
07-01-2015, 11:03 AM
Post: #25
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(06-01-2015 07:44 AM)simoncn Wrote: I presume this would mean that applications such as MinimServer couldn't detect interface changes on FreeBSD. Would it be be possible to add code to implement this functionality for FreeBSD? Are there any other aspects of the proposed FreeBSD changes that would remove other functionality? From a quick look through the code, it seems that using the Linux version of struct InterfaceChangedObserver together with the Linux versions of SetInterfaceChangedObserver and DestroyInterfaceChangedObserver might work, which would enable the full ohNet functionality to be supported on FreeBSD. The would require changing the ifdefs as follows: In line 1132, retain the original line: #ifdef PLATFORM_MACOSX_GNU In line 1155, retain the original line: #if defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_IOS) In line 1258, retain the original line: #ifndef PLATFORM_MACOSX_GNU In line 1368, retain the original line: #ifdef PLATFORM_MACOSX_GNU In line 1380, retain the original line: #ifndef PLATFORM_MACOSX_GNU @airflow, could you try this to see if it compiles OK on FreeBSD? |
|||
07-01-2015, 12:30 PM
Post: #26
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(06-01-2015 08:10 PM)simonc Wrote: Creating a bundle of build artifacts is optional for you build so don't worry too much if this doesn't fix it. After the changes, creating the bundle of build artifacts works, too. Quote:If you get a build working, the next step would be to test it out. You can do this using the AllTests.py script: For the tests I had to modify the variable buildCmd to 'gmake ' in the file AllTests.py. The tests don't run completely through. A lot of them work, but at one point there are failures (the complete log is attached, here only the last part): Code: Starting Test Runner: SSDP discovery Quote:When things are complete, I'll be happy to accept a patch to save you having to maintain a fork. You can either post the output of git diff or, better, submit a pull request against the github repo. That's great, and I'll certainly do that as soon as everything works! (07-01-2015 11:03 AM)simoncn Wrote: [...suggested changes] Certainly, but I'll try that as soon I made the existing stuff to work (I don't want to change too much at the same time). |
|||
08-01-2015, 05:14 PM
Post: #27
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(07-01-2015 12:30 PM)airflow Wrote: The tests don't run completely through. A lot of them work, but at one point there are failures (the complete log is attached, here only the last part): These failures are to do with SSDP (the protocol used to advertise and/or discover UPnP devices). The cause for this is likely in your ohNet OS port (Os.c) but could also be the configuration of your VM. In rough order, I'd try investigating the following:
|
|||
03-02-2015, 11:49 AM
Post: #28
|
|||
|
|||
![]() (08-01-2015 05:14 PM)simonc Wrote: These failures are to do with SSDP (the protocol used to advertise and/or discover UPnP devices). The cause for this is likely in your ohNet OS port (Os.c) but could also be the configuration of your VM. Hello again! I couldn't pursue this task for a little while due to time constraints. But today I finally could try out your suggestions - and already the first one (enabling the code in OsNetworkSocketSetMulticastIf for PLATFORM_FREEBSD too) did the trick. Everything compiles and the test-suite completes. I will now try to make MinimServer to work. Code: TestDvLpec - completed Simon, you mentioned earlier you'd like to incorporate the changes to the project so that others may also benefit and the compatibility of the code is increased (and I don't have to maintain a fork). You already pointed to instructions earlier about how to do that. I will do it later today. |
|||
03-02-2015, 02:44 PM
Post: #29
|
|||
|
|||
![]()
I just submitted a pull request for the changes we did elaborate. I hope everything is alright... I omitted the changes I did for the file AllTests.py (change to gmake).
Thanks for all the great help in the process! Much appreciated! :-) (07-01-2015 11:03 AM)simoncn Wrote: From a quick look through the code, it seems that using the Linux version of struct InterfaceChangedObserver together with the Linux versions of SetInterfaceChangedObserver and DestroyInterfaceChangedObserver might work, which would enable the full ohNet functionality to be supported on FreeBSD. The would require changing the ifdefs as follows: @simoncn: I'd also like to implement your suggestions for full functionality, but I don't quite get them. In each line given you write "retain the original line", which means I shouldn't change it, should I? So what should I actually change? :-) |
|||
03-02-2015, 06:07 PM
Post: #30
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(03-02-2015 02:44 PM)airflow Wrote: @simoncn: I'd also like to implement your suggestions for full functionality, but I don't quite get them. In each line given you write "retain the original line", which means I shouldn't change it, should I? So what should I actually change? :-) I meant that in all the places I mentioned, you should remove your change and retain the code as it is currently on Github. |
|||
« Next Oldest | Next Newest »
|