Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiling ohNet on FreeBSD
08-02-2015, 11:12 AM
Post: #31
RE: Compiling ohNet on FreeBSD
(03-02-2015 06:07 PM)simoncn Wrote:  I meant that in all the places I mentioned, you should remove your change and retain the code as it is currently on Github.

simoncn, I tried this now. In fact, of all the 5 different locations in the code you mentioned, only 1 of these lines has been actually changed before by me. It's the change in line 1258, which I changed back to the original code. In the other cases, the line is the same. I hope I did understand you right. For your reference, here you can see the actual differences between the files:

Original fork I did with simon to make ohnet to compile successfully (4 changes in Os.c between master and my fork):
https://github.com/airflow2010/ohNet/com...patibility

You wanted to retain some lines, which is why there are only 3 changes in Os.c any more between master and fork):
https://github.com/airflow2010/ohNet/com...ility-full

In the latter case the code doesn't compile any more.

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
cc1: warnings being treated as errors
Os/Posix/Os.c: In function 'adapterChangeObserverThread':
Os/Posix/Os.c:1287: warning: implicit declaration of function 'NLMSG_OK'
Os/Posix/Os.c:1287: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1287: error: 'NLMSG_DONE' undeclared (first use in this function)
Os/Posix/Os.c:1287: error: (Each undeclared identifier is reported only once
Os/Posix/Os.c:1287: error: for each function it appears in.)
Os/Posix/Os.c:1288: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1288: error: 'RTM_NEWADDR' undeclared (first use in this function)
Os/Posix/Os.c:1289: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1289: error: 'RTM_DELADDR' undeclared (first use in this function)
Os/Posix/Os.c:1290: error: dereferencing pointer to incomplete type
Os/Posix/Os.c:1290: error: 'RTM_NEWLINK' undeclared (first use in this function)
Os/Posix/Os.c:1293: warning: implicit declaration of function 'NLMSG_NEXT'
Os/Posix/Os.c:1293: warning: assignment makes pointer from integer without a cast
Os/Posix/Os.c: In function 'SetInterfaceChangedObserver_Linux':
Os/Posix/Os.c:1325: error: storage size of 'addr' isn't known
Os/Posix/Os.c:1333: error: 'PF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1333: error: 'NETLINK_ROUTE' undeclared (first use in this function)
Os/Posix/Os.c:1338: error: 'AF_NETLINK' undeclared (first use in this function)
Os/Posix/Os.c:1339: error: 'RTMGRP_LINK' undeclared (first use in this function)
Os/Posix/Os.c:1339: error: 'RTMGRP_IPV4_IFADDR' undeclared (first use in this function)
Os/Posix/Os.c:1325: warning: unused variable 'addr'
Common.mak:421: recipe for target 'Build/Obj/Posix/Release/Os.o' failed
gmake: *** [Build/Obj/Posix/Release/Os.o] Error 1
Find all posts by this user
08-02-2015, 03:03 PM
Post: #32
RE: Compiling ohNet on FreeBSD
(08-02-2015 11:12 AM)airflow Wrote:  simoncn, I tried this now. In fact, of all the 5 different locations in the code you mentioned, only 1 of these lines has been actually changed before by me. It's the change in line 1258, which I changed back to the original code. In the other cases, the line is the same. I hope I did understand you right. For your reference, here you can see the actual differences between the files:

Original fork I did with simon to make ohnet to compile successfully (4 changes in Os.c between master and my fork):
https://github.com/airflow2010/ohNet/com...patibility

You wanted to retain some lines, which is why there are only 3 changes in Os.c any more between master and fork):
https://github.com/airflow2010/ohNet/com...ility-full

It looks like there has been some misunderstanding about the changes I was suggesting.

From the first set of changes in the pull request, the only line that needs to be updated is line 1260. Instead of:

#if !defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_FREEBSD)

my suggestion is to use:

#ifndef PLATFORM_MACOSX_GNU

Can you try this and see whether it compiles and passes the tests?
Find all posts by this user
08-02-2015, 05:35 PM
Post: #33
RE: Compiling ohNet on FreeBSD
(08-02-2015 03:03 PM)simoncn Wrote:  From the first set of changes in the pull request, the only line that needs to be updated is line 1260. Instead of:

#if !defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_FREEBSD)

my suggestion is to use:

#ifndef PLATFORM_MACOSX_GNU

Can you try this and see whether it compiles and passes the tests?

OK, in this case I did understand you correctly already the first time. I did change line 1260 back to "#ifndef PLATFORM_MACOSX_GNU". If you take a look at the second link of my previous post, you see the changes between the original source-Code and my fork. Line 1260 is not differing, therefore still at the state of the original source-code. It is not compiling, with the error-message given in my previous post.
Find all posts by this user
08-02-2015, 06:07 PM
Post: #34
RE: Compiling ohNet on FreeBSD
(08-02-2015 05:35 PM)airflow Wrote:  OK, in this case I did understand you correctly already the first time. I did change line 1260 back to "#ifndef PLATFORM_MACOSX_GNU". If you take a look at the second link of my previous post, you see the changes between the original source-Code and my fork. Line 1260 is not differing, therefore still at the state of the original source-code. It is not compiling, with the error-message given in my previous post.

Thanks for the clarification. I understand now.

It looks like the compilation errors are caused by the change in line 28 to remove two Linux-specific includes. Unfortunately, I don't think there is any way round this because the required netlink functionality is not (as I understand it) supported on FreeBSD. Thanks for trying this.
Find all posts by this user
14-02-2015, 12:40 AM
Post: #35
RE: Compiling ohNet on FreeBSD
After I built ohNet successfully with your help on FreeBSD, I wanted to get MinimServer to work with it. It turned out that there was still something missing to achieve that, which were the Java bindings (gmake nocpp11=yes ohNetJni). Those also made some changes to the code necessary, mainly removing inclusion of malloc.h (see also my description here). But it works now and MinimServer is actually running successfully. Thanks again!

Do you want/need these changes in the form of a pull request on github? I saw that you didn't accept my last one, is there anything wrong with it or did you change your mind?
Find all posts by this user
14-02-2015, 11:15 AM
Post: #36
RE: Compiling ohNet on FreeBSD
(14-02-2015 12:40 AM)airflow Wrote:  After I built ohNet successfully with your help on FreeBSD, I wanted to get MinimServer to work with it. It turned out that there was still something missing to achieve that, which were the Java bindings (gmake nocpp11=yes ohNetJni). Those also made some changes to the code necessary, mainly removing inclusion of malloc.h (see also my description here). But it works now and MinimServer is actually running successfully. Thanks again!

Before removing these includes for malloc.h, it would be necessary to verify that this change doesn't cause any problems when building the Java bndings for other platforms. It would be safer to put

#ifndef PLATFORM_FREEBSD

around these includes.
Find all posts by this user
15-02-2015, 12:57 AM
Post: #37
RE: Compiling ohNet on FreeBSD
(14-02-2015 11:15 AM)simoncn Wrote:  Before removing these includes for malloc.h, it would be necessary to verify that this change doesn't cause any problems when building the Java bndings for other platforms. It would be safer to put

#ifndef PLATFORM_FREEBSD

around these includes.

As far as I understand, the functionality of malloc.h is instead provided by stdlib.h, which was referenced in each of the files where I removed the inclusion of malloc.h. If this is not the case (or not for all supported platforms), the ifndef-clause is obviously preferred and the better solution. I will certainly modify the files like this if needed/wanted. I'll just wait for a feedback of Simon if this is actually the case. :-)
Find all posts by this user
15-02-2015, 10:53 PM
Post: #38
RE: Compiling ohNet on FreeBSD
(15-02-2015 12:57 AM)airflow Wrote:  As far as I understand, the functionality of malloc.h is instead provided by stdlib.h, which was referenced in each of the files where I removed the inclusion of malloc.h. If this is not the case (or not for all supported platforms), the ifndef-clause is obviously preferred and the better solution. I will certainly modify the files like this if needed/wanted. I'll just wait for a feedback of Simon if this is actually the case. :-)

It should probably be OK to remove the includes for malloc.h in the Java bindings because the ohNet core library uses malloc and is compiling on all platforms without these includes.
Find all posts by this user
16-02-2015, 11:45 AM
Post: #39
RE: Compiling ohNet on FreeBSD
(03-02-2015 02:44 PM)airflow Wrote:  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! :-)

Sorry for the delay n getting to this. I've integrated these changes now. I'll also look into setting up a FreeBSD VM to allow us to run builds/tests for all future ohNet changes.
Find all posts by this user
05-02-2016, 10:18 PM
Post: #40
RE: Compiling ohNet on FreeBSD
I regularly download the most recent commit of ohnet and compile it for use with MinimServer. Everything works fine like discussed previously and I can use it with the software. It's only the testing-suite which fails to execute properly recently.

When I execute "python AllTests.py --incremental --full --native", it fails with
Code:
mkdir -p Build/Bundles
python bundle_binaries.py --system Unknown --architecture x64 --configuration Release
Please specify --system from one of Android, Core, FreeBSD, Linux, Mac, Qnap, Windows, iOs.
Makefile:590: recipe for target 'bundle-after-build' failed
gmake: *** [bundle-after-build] Error 1

Build for all failed, aborting

It seems that I have to specify "--system" as "FreeBSD" somehow, but I'm not sure how. I tried "python AllTests.py --system FreeBSD --incremental --full --native" and "python AllTests.py freebsd=1 --incremental --full --native", but neither works. Do you know how to specify this correctly? This wasn't necessary earlier.

Thanks,
airflow
Find all posts by this user


Forum Jump: