Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My notes for CLion usage to future me #23

Open
JohnAD opened this issue Apr 6, 2023 · 1 comment
Open

My notes for CLion usage to future me #23

JohnAD opened this issue Apr 6, 2023 · 1 comment

Comments

@JohnAD
Copy link

JohnAD commented Apr 6, 2023

Generally, any time I start a new project I write an informal text file to "future me" just in case I need to reproduce "what the heck did I do to get here?"

Just in case these are useful for others, these are my notes for doing c++ dev on CLion, a JetBrains tool, on an Ubuntu variant (PopOS!).


2023-February
  PopOS! 22.04 LTS
  CLion CLion 2023.1
    Build #CL-231.8109.174, built on March 28, 2023
  Linux 6.1.11-76060111-generic

First, follow https://wiki.freecad.org/Compile_on_Linux

Specifically, do all the apt-get and tool installations. Make sure that includes `sudo apt-get install qtwebengine5-dev`

Don't worry about Python libraries yet, we will let CLion install those through venv(?)

> git clone https://github.com/FreeCAD/FreeCAD.git freecad-master

Or, use whatever target name you want. I personally recommend that you _don't_ call it `freecad`. You will probably
end up with multiple versions of FreeCad on your machine, including the official binary distribution called "freecad",
so giving this directory that plain name is probably a bad idea.

Then delete the `cmake-build-debug` sub-directory. Cmake should be building that directory frestly on it's own. I don't
know why that directory is in the repo. Having it pre-exist confuses the *#@$ out of CLion.

Start CLion, choose Open. Select the repo directory and click on Ok.

Then, from the main screen, look for the Configuration drop down. If it says "Add Configuration..." wait a few minutes
while CLion parses everything for the first time. Hopefully, it says "FreeCADMain | Debug" after a while. If it doesn't, you
might have to choose things directly from the drop down.

Then, go to the Build menu and select "Build All in 'Debug'". You MUST do this at least once before anything else will
really work.

Go get a cup of coffee while it does a first-pass compile and build. By default, it uses up all but two of your machine's
core threads. Expect all your computer fans to go on full speed. You can tweak this later. You will see quite a few
warning about stuff. Ignore those. Later incremental changes should be nice and fast, but this first build is gonna take a
while. With tweaking, I got mine down to 14 minutes.

You can help CLion with memory issues if you bump up the heap size. It defaults to 2048 MB. I moved mine up to
8096 MB. Chose "Help" then "Change Memory Settings".

It should mostly work now. Mostly. Simply click on the "run" icon to see it run.

If you start messing about with Python or use other workbenches, you will want set up Python properly. My instructions
here are muddy. You might have to externally install more Python stuff.

The answer lies in "File" then "Settings" then "Build, Execution, Deployment" then "Python Interpreter". Then click on
"Add Interpreter", then "Choose Interpreter", then "Virtual Environment" with 3.10, then "Ok" and then closed the
Settings. Then, in theory, some packages should install.

Start FreeCAD again. Open the Python Console. Does running `sys.version` give you the 3.10 you would expect?
@JohnAD JohnAD changed the title Helpful? My notes for CLion usage to future me My notes for CLion usage to future me Oct 29, 2023
@JohnAD
Copy link
Author

JohnAD commented Oct 29, 2023

CLion did not like python 3.11 and 3.12 existing on my local computer. When running CMake it claimed that it could not find a legitimate Python interpreter. Removing 3.11 and 3.12 (including the /usr/bin binaries) fixed it.

Also, I had to pip install ifcopenshell inside the venv as the requirements.txt references a removed version. Pivy doesn't install, but that is an ubuntu problem that only affects specific workbenches; so I just ignored it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant