How do I get started on development?

So far I’ve been hanging around in the Discord, but I haven’t gotten much progress aside from compiling FreeCAD twice. I once compiled in Windows, switched to Void Linux where I had a hard time compiling (not sure if I made it to completion there), then I accidentally force cancelled a partition resize and had to reinstall my system and now I’m on openSUSE.



The biggest trouble I’ve faced so far is with dependency resolution. Since Void isn’t listed in the wiki, I had to manually figure out the package names one by one as the build failed. Void did have a source packages repository, but it seemed like there were differences in dependencies from the latest release to the master. Anyways now I’m on openSUSE because I didn’t have time to setup Void again at the moment. Even though openSUSE is listen in the Wiki, all the packages did not get installed right from the beginning. I particularly had issues with hdf5-openmpi4-devel and SoQt-devel conflicting with Coin-devel. I went around and found some instructions from the forums, and that way I had to manually figure out what packages the pkgconfig(QtXXX) were as listed in FreeCAD.spec in the OBS (which was easy thanks to pkgs.org). Then while compiling it showed me a warning that I didn’t have Coin docs. By a zypper search, I found that there was Coin4-devel along with its docs, and I figured that could fix SoQt for me. But I feel like SoQt isn’t a big requirement since CMake did build without it.



I also know that OpenMPI is for parallelization, so I don’t see why FreeCAD needs it. It was only listed in the wiki for the openSUSE package, so I think it is dated information. FreeCAD.spec looks like the right reference point.



So, I feel like instead of going by trial and error, it would be better to know what these individual packages are and how they fit in. e.g. Qt-XXX, PyQt-XXX, graphviz?, Med, Shiboken2. Do I have to reverse engineer everything and make a block diagram (Diagrams.net/Gaphor)?



I’m a beginner and I don’t have much experience working with big projects. So I’m kind of looking for how to start and get acquainted with the ecosystem. The people at Discord told me that it’s mostly users there, and the devs don’t hang around much. So forum seems to be the right place, but I’m normally used to IRC for development. I don’t know forum workflow can be. For example, the search here is not very usable because it tells me the keywords are too common. I don’t know if this is a configuration issue, but that’s how it is for now.

[quote=yorik post_id=2612 time=1337847818 user_id=68]
Before you start to code for FreeCAD, you must have a good knowledge of the application itself. This might seem obvious, but the OpenCascade kernel of FreeCAD is very complex, and you won’t go very far if you don’t know how it works, what it can do and what are its limitations.
[/quote]

Also I can see this is another aspect too. So far I haven’t started using it, but I really want to. I just didn’t get time yet. I’ve also applied for GSoC, so that’s one of the reasons I have to know about it early on, to stay prepared.

[quote=yorik post_id=2612 time=1337847818 user_id=68]
Present yourself to other developers. FreeCAD is before anything a social project, we discuss almost everything on this forum before implementing it, and it’s always best to discuss your ideas and tell people what you are planning to do before actually doing it.
[/quote]

This is mainly why I’ve started this thread. I know there’s more resources to go through, but I think letting other developers know is important too.



About communications: I hear that during GSoC we’ll have better communications. I was expecting it to be just Discord/IRC, but apparently that’s not the case right now. So in case we normally have better development communications during GSoC, why can’t we extend it to the normal case, with a developer presence on Discord etc? Maybe there are other factors like mentoring newbies is a big task? Also in the GSoC thread, I was asked to contact Bernd, and I tried PMing him, but I didn’t get any response. I don’t know if it was the right channel for communications, but I couldn’t find him on Discord, so, I don’t know.



So, I need a brief on all these. Sorry if it was long, but it’s late and I’m a bit sleepy.

There is a developer presence on Discord (me!), but I mostly just lurk unless you @-mention me or I just happen to be watching there at the moment you ask a question I have the answer to (and I have time to answer it). Most developer-level questions require a more significant response than is feasible on a messaging platform, and there’s not much point in spending time crafting a long answer there since it will just get lost in history. These factors, among several others, are why we are working to move developer documentation to the Handbook. That project is just getting started, though.

As you probably figured out already from the state of the Wiki developer docs, a) most developers are using some flavor of Ubuntu, or Windows, so those docs are the most up-to-date, and b) documentation of library dependencies is a moving target, so as soon as your docs are up-to-date, they are outdated again. Coupled with the non-standard library installation process across different Linux distros, and you have a nearly untenable situation for a project of our size. I have some hope that we can achieve a sort of standardization via Conda, but we’re having some trouble maintaining the feedstock for that right now.

I just heard about the handbook, and it seems like it can come in handy (no pun intended).

About the package management, it’s not a unsolvable issue at this point tho. I could’ve just used distrobox (which is a wrapper for podman) to set up an Ubuntu container. But I was more interested in seeing how the individual pieces fit in. Conda seems like a good idea too. I also wondered why we couldn’t have something like LibPack for Linux, since it looks like compilation is currently easiest for Windows.

I see how IRC can be difficult for development discussions. A handbook is good, but it can’t entirely solve the problem either. I think a combination of both is a better way to go, so for bigger responses, we can be redirected to the handbook. It’s good to see you are there, but it’s still hard to find every developer there, especially since the usernames aren’t always the same, and the contacts are not listed.

As of now, I guess I’ll wait for the handbook to mature.

I’d also like to know how new developers normally get started here. Since this is a big project. How do the communications go around as of now, etc.

Main problem in compiling is that actually Ubuntu PPA has some difficult to find maintainers to keep it in a decent state.

But Linux is not only Ubuntu, so you have some alternatives:

  • Arch Linux for which adrianinsaval l is compiling dev version almost daily, (You could kindly ask him to direct you to his personal arch linux repo).
  • Probably Gentoo as it has a decent policy of non altering too much sources
  • Debian could be an alternative, as Ubuntu is Debian dervied with some “complication added” (Not that Debian is not complicated itself), but as it is Debian probably it is not a big gain over Ubuntu.

Problem are not limited only to what package you have to download and install (Debian Ubuntu has the habits of breaking packages in many pieces, “runtime”, devel, and docs usually) but also what version they decide to use. (Debian an on some extent in minor way Ubuntu are not “bleeding edge”), but has development has “by design” a target on Ubuntu probably now the target is 20.04 your mileage may vary, as they are rather old in term of “library versions”.

One drawback, could be that usually if you want to develop by yourself, it will be better to target at least OCCT to a more recent version than the stock supplied with Debian and Ubuntu, as it is the core of FreeCAD and every improvement in OCCT will result usually in a more smooth “FreeCAD experience”.

Void Linux sadly is a good distribution, but you are on your own as development team is not so big and his package management system is rather peculiar (I had contributed some recipes for it some years ago, prior the “temporary” disappear of the lead developer, now it is returned from what I know, I have some good remembering of some talks on IRC with developers, but “making packages” was a nightmare :frowning: ).

Sorry for the long post.

Kind Regards

Carlo D.

I have compiled FreeCAD for the first time just a couple months ago. It is a shame I did not document any of it.

I use Debian, and as far as I remember it was quite smooth. The trouble I have mostly when I try to compile some code for some project, in general, is mainly:
Recipes do not explain what you are doing. When they get outdated, they become useless as knowledge.It is not the problem that it gets outdated! I had no experience with cmake until last year, when I tried to compile a project called Shotcut. I remember that more than 20 years ago, I had read all documentation on autotools (automake, autoconf, etc). So, I never understood the magic that cmake does. I don´t know how good cmake is on cleaning sources. I don’t know if I am supposed to use make or cmake after configuration is done. And most important… if you tell me use this and not that… you are not telling me why!!! :slight_smile:

Some other problems I usually find with projects in general:

  • I have to figure out which packages I need to install.
  • Some projects only support compilation that depends on tools that are not available in Debian repo.
  • Some projects want you to pip install stuff, and I refuse to install things I don’t understand where they are coming from. I gave up on the manim lib because of that.

To get knowledge, I usually read all instructions for all other platforms. And I try to understand why each package is required.

This is my experience. I don’t think it will help you, because you sound much more familiar and prepared than I am. But I hope that, eventually, when you figure out how to compile on openSuse, you update the wiki and also post it here. You could report every step… because you will have documented it. :slight_smile:

There is always tension in documentation between explaining everything, but being very (very!) longwinded, and the shorter form “do this because it works.” For example, most FreeCAD documentation tells you to compile with “cmake --build ./” – we say that because it works, because it covers all cases, and because it’s short. Of course, if you understand that what cMake did was generate a Makefile, or a build.ninja file, or whatever, then you are free to directly use those tools. But if we try to spell every option out in the documentation, suddenly it’s too long to read, so no one does! :smiley:

We do actually have more in-depth descriptions of what some of our dependencies are for: I’ve ported some of that over to the handbook last night. Please feel free to submit PRs with detail that you feel is missing.

I do understand. Every step… every decision in a developer’s life is pure tension! :slight_smile:
A comment from someone that does not write documentation (me):

  • Maybe it would be good to have a “recipe” straight ahead. And then, further explanations for those who care.
    This could make dated instructions more useful.

But I am not talking about FreeCAD. I was trying to be generic. I think the information is basically there!

  1. You use cMake.
  2. You have to install those packages.
  3. Things should just work out of the box.

I do remember that I found it really nice that building FreeCAD was pretty smooth. And this is probably much more important than any documentation.


Three things I have just learned:

  1. It seems that there is some other build system called “ninja”.
  2. If you call “cmake --build .”, cmake will call the proper build system for you!
  3. You are the kind of person that feels uneasy with paths that do not terminate in a slash (/). :mrgreen:


This is very good, indeed! :slight_smile:

With Debian you could compile your own version search for information about backporting packages.

You could use a recipe for as example a Debian dev version and reuse it importing the updated sources, there is around some documentation about this way.

Or you could maybe try to use as example Arch Linux and use the PKGBUILD recipe from what adrianinsaval is compiling his freecad-git version.

other ways are probably more problematics as they don’t take in account correctly all the packages dependencies.

As example with Arch Linux PKGBUILDs you coukd specify as example a -git package name that retrieve git sources and compile last git iteration, and force to use this package to compile your own FreeCAD version.

Something similar could be achieved with Debian using a custom package name suffix, but it was some time ago so you have to read some documentation.

Usually for Arch Linux and derivative and Debian and derivatives you have some automated way (with good documentation) to make your own version.

chennes is a developer so probably he have some more informed advices.

Regards

Carlo D.

Thank you for your replies guys! I’ve been busy for sometime, and also spent some time trying to categorize the dependencies myself.

Personally I found the package management really easy (although I didn’t make any recipes myself). And yeah, the IRC was a really nice place. About the lead dev, I don’t know about his presence now, but the Void team has now changed to work without the help of a lead.

If your posts are long, what are mine? :scream:

I will finish what you started. - Kylo Ren

CMake is like a build script generator, that can also launch the build system. i.e it makes the Makefiles using CMakeLists.txt. That’s if you’re using Make, but it can generate build scripts for other build systems such as ninja, KDevelop, Visual Studio solutions, XCode, etc. So I’d if there are CMakeLists.txt files, you have to run cmake first and then make, always.

I still don’t know why everyone prefers distro packages, but not pip packages :thinking:

I did the same :grinning_face_with_smiling_eyes:

It turned out my experience was similar to yours :smiley:. And yes, I did figure out how to compile it, documented every step and already posted it :laughing:.

As I said earlier, there are several build build systems. There is no one proper build system, since in Windows we use either Make (MinGW) or MSVC++ (VS), both of which are also generated by CMake. I haven’t used Ninja, XCode, etc. myself, so I don’t know how they work.

And I am a person who feels uneasy with paths that do terminate in a slash. I ended up removing a symlink to /etc/wpa_supplicant/ and it ended up removing the source folder instead of the symlink (though in hindsight I don’t recall how I did it without -rf, but the IRC folks told me the trailing / was the problem)

Thanks for the advice, I ended up using everything including PKGBUILDs and other distro recipes to make my own full categorization. I somehow got free time to do that :laughing:

Because I trust Debian. And I trust Debian maintainers. And I trust FreeCAD official repository.
When one trusts “pip”… I don’t really know where they are depositing their faith on…

the problem with pip is not really about trust, you can check where those are coming from too and often it’s directly from upstream maintainers. The problem is that they can easily conflict with system packages break things. There are some way of isolating them I think but by default they are installed in places where they interfere, I’ve seen plenty of people suffering here not knowing how to troubleshoot or what has broken their installation only to later realize that for some reason at some point in time they installed some pip package. It can also be a PITA when you update your version of python and you don’t even realize that you need to reinstall who knows how many pip packages.

There is stuff pip is pretty good for and there’s stuff for which it’s not a good idea, compile dependencies is one of those things where it is not a good idea.