piano_jonas unofficial "Compile On openSUSE" guide

Having trouble installing or compiling FreeCAD? Get help here.
piano_jonas
Posts: 4
Joined: Mon Aug 24, 2020 10:16 am

piano_jonas unofficial "Compile On openSUSE" guide

Postby piano_jonas » Mon Aug 24, 2020 3:20 pm

Here I'm going to document my experience in compiling FreeCAD on openSUSE.

OpenSUSE Leap 15.2 & FreeCAD

The official guide is to find here: https://wiki.freecadweb.org/Compile_on_Linux

  • FreeCAD requires a lot of dependencies to compile:

    • git
    • gcc
    • cmake
    • gcc-c++
    • python3-devel
    • libboost_headers1_66_0-devel
    • libboost_filesystem1_66_0-devel
    • libboost_program_options1_66_0-devel
    • libboost_regex1_66_0-devel
    • libboost_signals1_66_0-devel
    • libboost_system1_66_0-devel
    • libboost_thread1_66_0-devel
    • libxerces-c-devel
    • zlib-devel
    • occt-devel-7.3.0-lp152.2.45.x86_64
    • vtk-devel
    • med-devel
    • eigen3-devel
    • swig
    • Coin-devel
    • libqt5-qtbase-devel
    • libqt5-qtsvg-devel
    • libqt5-qttools-devel
    • libqt5-qtxmlpatterns-devel
    • libshiboken-python3-devel
    • python3-pyside2-devel
    • python3-matplotlib
    • python3-GitPython
    • python3-pivy
    • libboost_python-py3-1_66_0-devel
    • doxygen
    • libspnav-devel
    • openmpi-devel
    • glew-devel
    • libmed-devel

    Add with the one liner:

    Code: Select all

    sudo zypper in git gcc cmake gcc-c++ python3-devel libboost_headers1_66_0-devel libboost_filesystem1_66_0-devel libboost_program_options1_66_0-devel libboost_regex1_66_0-devel libboost_signals1_66_0-devel libboost_system1_66_0-devel libboost_thread1_66_0-devel libxerces-c-devel zlib-devel occt-devel-7.3.0-lp152.2.45.x86_64  vtk-devel med-devel eigen3-devel swig Coin-devel libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtxmlpatterns-devel libshiboken-python3-devel python3-pyside2-devel python3-matplotlib python3-pivy python3-GitPython libboost_python-py3-1_66_0-devel doxygen libspnav-devel openmpi-devel glew-devel libmed-devel
    
  • Now you can grab FreeCAD from GitHub and compile.
    I downloaded the source code to my home directory (~/FreeCAD_git) and installed in /opt/FreeCAD.
    FreeCAD It is a large program to compile, so if you have multiple cores, use the "-j" switch for make (e.g. "make -j8"):

    Code: Select all

    mkdir ~/FreeCAD_git
    cd ~/FreeCAD_git
    git clone https://github.com/FreeCAD/FreeCAD
    sudo mkdir /opt/FreeCAD
    sudo chown root:users /opt/FreeCAD
    sudo chmod 775 /opt/FreeCAD
    cd /opt/FreeCAD
    cmake --prefix=/opt/FreeCAD/ ~/FreeCAD_git/FreeCAD -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release
    make
    sudo make install
  • Start FreeCAD with:

    Code: Select all

    cd /opt/FreeCAD/bin
    ./FreeCAD
  • To create a desktop shortcut (in KDE):

    • Save the attached FreeCAD.png icon (64x64 px) to /opt/FreeCAD/bin
    • Create a .desktop file containing:

      Code: Select all

      [Desktop Entry]
      Categories=Application;Science;Math;Education;
      Comment[sv_SE]=Ett generellt 3d-modelleringsprogram
      Comment=A general purpose 3D CAD modeler
      Encoding=UTF-8
      Exec=/opt/FreeCAD/bin/FreeCAD %F
      GenericName[sv_SE]=CAD program
      GenericName=CAD Application
      Icon=/opt/FreeCAD/bin/FreeCAD.png
      MimeType=
      Name[sv_SE]=FreeCAD
      Name=FreeCAD
      Path=/opt/FreeCAD/bin/
      StartupNotify=true
      Terminal=false
      TerminalOptions=
      Type=Application
      Version=1.0
      X-DBUS-ServiceName=
      X-DBUS-StartupType=
      X-Desktop-File-Install-Version=0.22
      X-KDE-SubstituteUID=false
      X-KDE-Username=
      Name the file "FreeCAD.desktop" and save it in /usr/share/applications .
      You need root access (sudo) to save in this directory.
    • Open the Start Menu and type FreeCAD. Right click on the upcoming icon for adding it to desktop or favorites.
Good luck!

/jonas
Attachments
FreeCAD.png
FreeCAD.png (3.65 KiB) Viewed 504 times
Last edited by piano_jonas on Fri Sep 04, 2020 5:35 pm, edited 18 times in total.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby vocx » Mon Aug 24, 2020 3:56 pm

piano_jonas wrote:
Mon Aug 24, 2020 3:20 pm

Code: Select all

git clone https://github.com/FreeCAD/FreeCAD_sf_master.git
This is an obsolete address. You can just use the new address.

Code: Select all

git clone https://github.com/FreeCAD/FreeCAD
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
piano_jonas
Posts: 4
Joined: Mon Aug 24, 2020 10:16 am

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby piano_jonas » Mon Aug 24, 2020 5:58 pm

*updated* Thanks!

/jonas
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby vocx » Mon Aug 24, 2020 10:22 pm

piano_jonas wrote:
Mon Aug 24, 2020 5:58 pm
*updated* Thanks!

Code: Select all

cmake --prefix=/opt/FreeCAD/ ~/FreeCAD_git/FreeCAD_sf_master -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release
You also have to update this.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
piano_jonas
Posts: 4
Joined: Mon Aug 24, 2020 10:16 am

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby piano_jonas » Fri Sep 04, 2020 4:08 pm

Thanks and sorry for late update, but now I hopefully got everything right :) .

I also added instructions for creating a FreeCAD desktop icon in KDE.

/jonas
hinckel
Posts: 84
Joined: Fri Nov 21, 2014 11:45 am
Location: SJCAMPOS, SP - BR

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby hinckel » Wed Oct 28, 2020 5:39 pm

Hello piano_jonas
Thanks for your work on fixing this openSUSE FreeCAD build.

I have been build my working FreeCADD on openSUSE for a long while. Now recently (last 3 month) I have not been able to build it anymore.
I tried you recipe to no avail.
Here is the error messages I have been geting:

Code: Select all

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find LibPROJ (missing: LibPROJ_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/lib64/cmake/vtk-9.0/FindLibPROJ.cmake:42 (find_package_handle_standard_args)
  /usr/lib64/cmake/vtk-9.0/VTK-vtk-module-find-packages.cmake:1102 (find_package)
  /usr/lib64/cmake/vtk-9.0/vtk-config.cmake:131 (include)
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:45 (find_package)
  CMakeLists.txt:53 (SetupSalomeSMESH)
From other discussions, I am under the impression that openSUSE is not being very successful in building FreeCAD either. The only version available for the LEAP 15.2 is FreeCAD 18.4.
Any news on this side?
Best regards
J N Hinckel
piano_jonas
Posts: 4
Joined: Mon Aug 24, 2020 10:16 am

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby piano_jonas » Mon Nov 02, 2020 6:55 am

Hi!

Sorry for late answer :|

I have never got that error. Please in the console, type:

Code: Select all

zypper se libproj
to check that libproj is installed. Post the answer here, and I will try to help you further :)

/jonas
User avatar
Pedja
Posts: 10
Joined: Mon Mar 12, 2018 1:28 pm

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby Pedja » Tue Nov 03, 2020 1:16 pm

FWIW, I've been building weekly-ish FreeCAD 0.19 master branch snapshots for a while now, for Leap-15.2, on OBS.
Seems to work fine, or at least without major issues, AFAICT.

It's based on 0.18.x spec file, with several modifications, mostly with the build configuration:
- Several workbenches, either deprecated or no longer developed, are no longer built/shipped
- Added a bit newer versions of netgen and Calculix, for FEM WB.
- Built against openCASCADE-7.4.0p1 (will switch to 7.5.0 once released/FreeCAD gets fully updated for it)
- Offline help thingie spilt into another package
- and some more stuff, probably :)

If you are interested, I can post the link to the repo, if you want to use it as a reference
(installing binaries built by random guy from the Internet is a BadIdea[tm] :) )
hinckel
Posts: 84
Joined: Fri Nov 21, 2014 11:45 am
Location: SJCAMPOS, SP - BR

Re: piano_jonas unofficial "Compile On openSUSE" guide

Postby hinckel » Wed Nov 04, 2020 5:30 pm

Thanks for the replies. I think the problem was related to some files modified in the science repo. I reverted back to system and all is working fine now.
Hanky dory!