Compiling ohNet on FreeBSD
|
13-12-2014, 02:27 PM
Post: #1
|
|||
|
|||
Compiling ohNet on FreeBSD
Hi!
I'd like to compile ohNet on a FreeBSD box. Reasoning behind it is my goal to run Minimserver (which uses ohNet) an my FreeNAS box. I'm not a programmer, but have intermediate Linux/BSD-skills. I got an github-account and downloaded the source of ohNet. I compiled and installed the dependencies I'm aware of. When I try to "make" the build, I get these error-messages: Code: root@testus_1:/usr/local/ohnet # make I haven't investigated a lot of time yet about what I could change in the Makefile to make it happen. I just wanted to check back in this forum before that to find out if 1) this is a realistic and achievable goal or of it's impossible to do it for some reason 2) if there are any plans for the development team to make it compile on BSD too for the future 3) if there are any knowledgable people on the forum who would be willing to assist me (I could theoreticall also provide shell-access to try out stuff together). Thanks a lot, airflow |
|||
15-12-2014, 10:55 AM
(This post was last modified: 15-12-2014 10:56 AM by simonc.)
Post: #2
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
Welcome to the forum airflow!
In answer to your questions: 1) Yes, building for FreeBSD should be entirely realistic and achievable. 2)No, we don't have any work in this area planned. We would however be happy to integrate and maintain any changes you find are required. 3)We're not expert in FreeBSD. On the assumption that all *nix systems will be broadly similar, we can certainly try to help. Your current problems suggest that a different version of make is being used. A bit of googling suggests that it's possible to install a different package and build using gmake (GNU make) instead. See http://stackoverflow.com/q/10257713/311966 for details. |
|||
15-12-2014, 01:00 PM
Post: #3
|
|||
|
|||
![]() (15-12-2014 10:55 AM)simonc Wrote: 3)We're not expert in FreeBSD. On the assumption that all *nix systems will be broadly similar, we can certainly try to help. Your current problems suggest that a different version of make is being used. A bit of googling suggests that it's possible to install a different package and build using gmake (GNU make) instead. See http://stackoverflow.com/q/10257713/311966 for details. Hello simonc, thanks for the welcome and for the tip regarding gmake. I found that I had to compile rsync as another dependency. I had another error after that: Code: gcc -o Build/Obj/Posix/Release/Ascii.o -c -fexceptions -Wall -pipe -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -g -O2 -fvisibility=hidden -fPIC -std=c++0x -D__STDC_VERSION__=199901L -Werror -IBuild/Include/ OpenHome/Ascii.cpp I could mitigate this error by searching for the command line option "-std=c++0x" and removing it in the Makefile. After that compilation begins, runs for quite a while and stops later with the following error: 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 -Werror -IBuild/Include/ Os/Posix/Os.c For me it looks like there are functions called which are only available in Linux. I searched for this in the web, but am not sure if this is easily fixable. What's your opinion on this? Best Regards, airflow |
|||
15-12-2014, 01:34 PM
Post: #4
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(15-12-2014 01:00 PM)airflow Wrote: Hello simonc, thanks for the welcome and for the tip regarding gmake. I found that I had to compile rsync as another dependency. I had another error after that: You should be able to suppress attempts to enable C++11 support by specifying nocpp11=yes when you invoke gmake (15-12-2014 01:00 PM)airflow Wrote: After that compilation begins, runs for quite a while and stops later with the following error: This does appear to be linux code being incorrectly referenced. The easiest way to fix this would be to add support for a command line flag that signifies FreeBSD support, say freebsd=1 set an extra define inside Makefile when this command line flag is present. You could possibly do this by setting Code: ifeq ($(freebsd), 1) You'll then need to check for this define inside ohNet/Os/Posix/Os.c. Probably everywhere that checks #ifndef PLATFORM_MACOSX_GNU should change to #if !defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_FREEBSD) |
|||
15-12-2014, 02:16 PM
Post: #5
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(15-12-2014 01:34 PM)simonc Wrote: [...] Thanks again for your suggestions, I implemented them. In the file Os/Posix/Os.c I also found a few lines #endif /* PLATFOTM_MACOSX_GNU */ do these also have to be modified? Yes, it really says PLATFOTM, not PLATFORM. I think that these are possibly the reason for compilation still not working: 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 -Werror -IBuild/Include/ Os/Posix/Os.c |
|||
15-12-2014, 02:34 PM
Post: #6
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(15-12-2014 02:16 PM)airflow Wrote: Thanks again for your suggestions, I implemented them. Text inside /* .... */ is a comment. It'd be good practice to update this but it isn't required. The typos you've spotted have been there for a long time so, while embarrassing, don't disrupt the build. (15-12-2014 02:16 PM)airflow Wrote: ...compilation still not working: It looks like your changes haven't taken effect. (The command line used to compile OS.c doesn't include a PLATFORM_FREEBSD define). Can you confirm the full command line you use with gmake please? I'd expect it to be gmake all nocpp11=yes freebsd=1 |
|||
15-12-2014, 03:57 PM
Post: #7
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(15-12-2014 02:34 PM)simonc Wrote: It looks like your changes haven't taken effect. (The command line used to compile OS.c doesn't include a PLATFORM_FREEBSD define). Can you confirm the full command line you use with gmake please? I'd expect it to be Thanks for stating the obvious, I did indeed miss the flag! ![]() Giving it reveals that there is a problem in the statement I added in the Makefile for defining the freebsd-flag: Code: Makefile:299: *** Recursive variable 'cflags_base' references itself (eventually). Stop. This points exactly to the code (define) I added for the freebsd-flag: Code: # added for FreeBSD-compatibility Could it be that this should rather be: Code: # added for FreeBSD-compatibility If I change this, the compilation begins, but fails with the same error-message like before: 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 -Werror -IBuild/Include/ Os/Posix/Os.c I assume I miss somthing in the Os.c-file. There is one occurrence of PLATFORM_MACOSX_GNU in the file, where I didn't change anything: Code: #if defined(PLATFORM_MACOSX_GNU) && !defined(PLATFORM_IOS) Could that be the problem? |
|||
15-12-2014, 04:33 PM
Post: #8
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
You probably want to replace my suggested Makefile changes with
Code: ifeq ($(platform), FreeBSD) around the similar lines for "Vanilla" (around line 264). I'm not sure how best to set platform but the top of the file has a number of examples to experiment with clones of. |
|||
21-12-2014, 05:48 PM
Post: #9
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(15-12-2014 04:33 PM)simonc Wrote: You probably want to replace my suggested Makefile changes with Your suggestion is to work with the already existing "platform"-parameter instead of introducing a new one (freebsd). This parameter has of course to be given when calling gmake, right? For example "gmake nocpp11=yes platform=FreeBSD". So far so good. If I try this with the settings you suggested, compilation immediately stops like this: Code: root@testus_1:/usr/local/ohnet # gmake nocpp11=yes platform=FreeBSD I then experimented by modifying the "ifeq ($(platform), FreeBSD)"-snippet. First, I tried to copy the contents of the "Vanilla"-section, to see if I can work from there. I assume that "Vanilla" is the platform that is chosen by default? Fact is, if I explicitely set platform=Vanilla, it compiles just as it did before (ending with the C.os/linux error), so I assume this is the case. So after changing the code to Code: ifeq ($(platform), FreeBSD) ...I would expect platform=FreeBSD to behave the same like platform=Vanilla. Because it now contains the same settings, doesn't it? Strangely, it doesn't - it fails immediately like before: Code: root@testus_1:/usr/local/ohnet # gmake nocpp11=yes platform=FreeBSD I tried to wrap my head around this for several times these days. I'm afraid I don't understand this stuff enough to fix it myself. I'll try out anyhing you suggest, if you are willing to continue to help, tough! :-) Thanks & greetings, airflow |
|||
22-12-2014, 09:42 AM
Post: #10
|
|||
|
|||
RE: Compiling ohNet on FreeBSD
(21-12-2014 05:48 PM)airflow Wrote: Your suggestion is to work with the already existing "platform"-parameter instead of introducing a new one (freebsd). This parameter has of course to be given when calling gmake, right? For example "gmake nocpp11=yes platform=FreeBSD". I'd meant for you to add a section like Code: @@ -60,6 +60,10 @@ else ifeq ($(Android-anycpu), 1) then build using Code: gmake all nocpp11=yes freebsd=1 (21-12-2014 05:48 PM)airflow Wrote: So far so good. If I try this with the settings you suggested, compilation immediately stops like this: Our builds include some amount of code generation. The tools for this are written in C#. Use of these should be optional but it sounds like there might be a bug somewhere that's making it mandatory. Is it possible for you to install mono (an open source implementation of the .NET runtime) for FreeBSD? You'd then have to build our code generation tools using Code: gmake tt freebsd=1 uset4=yes |
|||
« Next Oldest | Next Newest »
|