Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
silasdb

Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by silasdb »

Hello all,

I have wanted to help on FreeCAD development since some years ago, when I worked with AutoCAD, Catia and other CAD/CAE tools before becoming a programmer. Now I use NetBSD and I thought it would be a nice objective to try to port it to NetBSD (and other BSD cousins). By doing that, I could get a general overview of the code, the building system and its dependencies.

To accomplish that, I had first to create packages of OpenCASCADE and SoQt to the pkgsrc package manager (www.pkgsrc.org). I will ask the pkgsrc-wip (pkgsrc-wip.sf.net) manager to add them. OpenCASCADE should compile out of the box on FreeBSD, but I had to patch one line to make it compile under NetBSD. I didn't had any bigger problem with SoQt, (besides a BSD Make vs. GNU Make issue) but I wondered why you are using SoQt 1.4.1 instead of Quarter or SoQt 1.5.0, because the Spaceball thing?

After having all dependencies installed and [probably] working on NetBSD, I checked out and tried to compile FreeCAD. I had to change some files in cMake/ directory, to make cmake find dependencies that were in unexpectedly places (pkgsrc by default installs everything in /usr/pkg). Let me make a note here: I found them a bit disorganized, since each .cmake file in that directory has a different way to find dependencies across the different system it supports. Would be a patch to standardize them welcome?

After having cmake find all the dependencies (which took some time), I started the compilation phase. Basically, I didn't have to do anything hard besides adding the FC_OS_BSD to FCConfig.h and append "|| defined(FC_OS_BSD)" on lines that have platform specific conditionals. The same code that runs on GNU/Linux seem to run fine on NetBSD.

I stopped the build at 37% because a crash that needs a "|| defined(FC_OS_BSD)" to be fixed, but I intend to resume the work tonight (GMT+03).

So, here are some questions...

1. Would support for BSD be acceptable? I can support that. I don't want to write down the advantages of portability just now, but we can talk about.

2. cMake/*.cmake needs refactoring to standardize those files?

3. Whenever a OS is not detected in FCConfig.h, should we suppose a general FC_OS_UNIX or something like that?

4. Are mailing lists dead? Is this forum the main place to talk about FreeCAD use and development?

It is just it for now...

Thank you very much!
Guest

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by Guest »

Here we go again.

I just successfully built FreeCAD on NetBSD! Simple patches were necessary on the code, basically appending || defined(FC_OS_BSD) where defined(FC_OS_LINUX) was present, as I said in my last message. A place was a bit more difficult, though: implementing fcvt() used in src/Mod/Mesh/App/Core/MeshIO.cpp, since this function is available only in Windows and GNU LibC (not present in NetBSD).

As a prove, I give you a screenshot: http://img713.imageshack.us/img713/8791 ... otroot.png

As you can see, I'm having problems with PyQt and the OpenCascade, but FreeCAD is compiled and its first screen run on NetBSD :-)

I'm still looking forward answers to this thread... Maybe answering questions I did in my last post.

Thank you very much.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by wmayer »

Hello,
but I wondered why you are using SoQt 1.4.1 instead of Quarter or SoQt 1.5.0, because the Spaceball thing?
On the Linux platforms we usually use the version of SoQt which is available there as package, e.g. 1.4.2 on Debian. On Windows we went back to 1.4.1 because with 1.5.0 we had a thread problem. Quarter is not an option at all at the moment because this would require many changes and btw. there is currently no Linux distribution offering this as package.
I found them a bit disorganized, since each .cmake file in that directory has a different way to find dependencies across the different system it supports. Would be a patch to standardize them welcome?
Not sure what you mean!? If you provide a patch we can discuss this point.
1. Would support for BSD be acceptable? I can support that. I don't want to write down the advantages of portability just now, but we can talk about.
Sure, we are always interested in making FreeCAD to run on as many platforms as possible.
2. cMake/*.cmake needs refactoring to standardize those files?
See above.
3. Whenever a OS is not detected in FCConfig.h, should we suppose a general FC_OS_UNIX or something like that?
I have no idea if the API of system headers is the same on all UNIX versions or whether there are slightly differences.
4. Are mailing lists dead? Is this forum the main place to talk about FreeCAD use and development?
We reanimated it a couple of months ago. Although 99% of the communication takes place in the php forum you can also the mailing list.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by wmayer »

I just successfully built FreeCAD on NetBSD! Simple patches were necessary on the code, basically appending || defined(FC_OS_BSD) where defined(FC_OS_LINUX) was present, as I said in my last message. A place was a bit more difficult, though: implementing fcvt() used in src/Mod/Mesh/App/Core/MeshIO.cpp, since this function is available only in Windows and GNU LibC (not present in NetBSD).
I don't remember what exactly this function does but we can check an alternative implementation without using this function.
As a prove, I give you a screenshot: http://img713.imageshack.us/img713/8791 ... otroot.png
OK, I see. But you're still not finished as the error messages tells me ;)
As you can see, I'm having problems with PyQt and the OpenCascade, but FreeCAD is compiled and its first screen run on NetBSD
In case OpenCascade was completely built you may set LD_LIBRARY_PATH accordingly!?
silasdb
Posts: 1
Joined: Fri Oct 29, 2010 12:50 am

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by silasdb »

Hi again.

Since it would be fine using the mailing list, I answered those questions there:

https://sourceforge.net/mailarchive/for ... evelopment

Anyway, just tell me if you prefer the forum.

Thanks!
gh2
Posts: 19
Joined: Tue Jan 08, 2019 1:14 pm

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by gh2 »

Hello

Is there any support for NetBSD? Binaries would be great.

I tried build from source too but preparing dependicies is hard or maybe impossible.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by GeneFC »

OK, you win the award. I have never seen a necrobump of more than 8 years. :lol:

Gene
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by triplus »

Quick search indicates FreeBSD did get some FreeCAD packaging love in the past. As FreeCAD 0.17 was made available. But now it looks like, due to Qt 4 removal, first dependencies like PySide 2 will need to get tackled. Before FreeCAD will be able to get compiled against Qt 5 again.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by wmayer »

According to issue #3653 FreeCAD compiles on FreeBSD.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting FreeCAD to BSD (NetBSD and cousins) and other stuff

Post by triplus »

Yes that is correct. FreeCAD 0.17 should be available on FreeBSD. But i took a look in their changelog and noticed:
Mark QT4 ports/functionality for removal on 2019-03-15
https://svnweb.freebsd.org/ports/head/c ... /?view=log

And unfortunately i can't find PySide2 package here:

https://www.freebsd.org/cgi/ports.cgi

Therefore FreeBSD will likely drop FreeCAD package in March 2019. Said that hopefully it won't take long before packages like PySide2 will get provided. And FreeCAD package to be made available again on FreeBSD.
Post Reply