How to fix Calculix connection in Mac OS FreeCAD

FreeCAD FEM packages in Mac OS

FreeCAD FEM, CalculiX and gmsh in Mac OS

In this post I will detail my experience installing and using the FEM workbench in my Mac OS Mojave computer. I had already installed it the past but noticed that things change.

  • INTRODUCTION

  • THE PROBLEM

  • HOW I DID IT

  • CONCLUSIONS

INTRODUCTION

FreeCAD is a great free tool for development. It still lags behind Autodesk Fusion 360 (which has a very good free version), but with each version it has advanced significantly. The FEM package also has advanced pretty much. It is now possible to make structural and thermal simulation effortlessly.  What makes this software so great is that it works in any platform and you can see what it’s inside it and even participate in it’s development.

THE PROBLEM

The main difficulty is to get the package working as expected. In windows all the binaries are supplied but in the MacOS version that’s not the case. When I tried to use the FEM workbench, I encountered difficulties with not having the necessary binaries to run gmsh and Calculix. Another issue I had that seems to affect only Mojave MACs is that FreeCAD pretty much freezes when using the menus.

HOW I DID IT

I was getting actually a bit desperate to find a solution that works with my MAC Mojave. 

  1. Fixing FreeCAD in MAC Mojave menu freezing
  2. Installing gmsh and Calculix through Homebrew
  3. Connecting it to FreeCAD 

1. Fixing FreeCAD in MacOS Mojave menu freezing

The freezing issue in Mojave can be solved by creating an alias in the desktop of the binary inside the FreeCAD.app file or by writing in the terminal window the following: 

codesign --force --deep -s - FreeCAD.app

FreeCAD freeze app code signing

FreeCAD freeze app code signing

 

2. Installing gmsh and Calculix through Homebrew

In order to have the FEM workbench running in my MacOS I had to manually install gmsh and Calculix. For gmsh I used homebrew to install the correct binaries from the formula in the following link: https://formulae.brew.sh/formula/gmsh

I used the following command in the terminal: brew install gmsh

Homebrew gmsh

Homebrew gmsh

After installation you need to check the installation folder in Finder: /usr/local/Cellar/

gmsh homebrew location

gmsh homebrew location

There should be a folder named “gmsh” inside. The binary will be located inside the bin folder with gmsh name.

Installing Calculix was a bit harder because it looks like for some reason the Calculix-ccx formula was working anymore. I had to search until I found the following post in the FreeCAD forum: https://forum.freecadweb.org/viewtopic.php?f=18&t=10979&start=100

In the forum it looks like the primary FreeCAD installation support page also directed here.

Long story short the command necessary to write on the terminal is the following:

brew install namore/homebrew-custom/namore-calculix-ccx

This allowed me to have on my homebrew folder gmsh and Calculix to then link to FreeCAD.

What I could not do was to find a formula in homebrew to install Calculix-cgx (Pre/Post viewer). A plus of this formula is that it is supposed to work on newer Macs with and without intel processors and MacOS BigSur.

3. Connecting it to FreeCAD 

It is actually easy to connect gmsh and Calculix to FreeCad so as long as the FEM workbench is loaded and the binaries are installed. When opening FreeCAD make sure you load the FEM workbench before you go to FreeCAD preferences.

Loading FEM workbench

Loading FEM workbench

After loaded the FEM workbench will appear in the preferences menu. There you can select the gmsh and Calculix tabs to set the correct binary locations. This is just about what you have to do. To connect Calculix the process is the same but this time select the Calculix tab and insert the binary location. The binary location may be different depending on the Homebrew package that you have installed previously.

Gmsh binary location

Gmsh binary location

Calculix binary location

Calculix binary location

 

CONCLUSIONS

I could install Calculix and gmsh binaries through Homebrew in Mac OS and then connect them to FreeCAD. The only thing I could not install was Calculix pre and post processing  client CGX. The FreeCAD freezing in Mojave was solved by code signing or by creating an alias of the binary in my desktop. In the end I got happy with the final installed configuration.