FEM on Mac OSX

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
Johnquicker
Posts: 72
Joined: Wed Aug 15, 2018 5:50 am
Location: Shanghai, China
Contact:

One Temporary Solution for FEM on Mac OSX with gcc version Problem

Post by Johnquicker »

@chrisb have summarized how to install Calculix-ccx on Mac here.
Those instructions are clear and helpful for me. But I have encountered the same problems as @Locost reported here. He checked ccx in terminal as advised by @bernd:
Locost wrote: Mon May 07, 2018 10:18 am I also tried running it in terminal (ie ./usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13) and got something similar
./ccx_2.13

Code: Select all

dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib
  Referenced from: /usr/local/Cellar/calculix-ccx/2.13/bin/./ccx_2.13
  Reason: image not found
Abort trap: 6
I did the same and got the same messages. @bernd thought
bernd wrote: Mon May 07, 2018 6:45 pm NO not python, somthing seams wrong with your CalculiX binary ccx.
and @christ kindly provide his compiled ccx binary here. But it was solved by @Locost himself as described here:
Locost wrote: Fri May 11, 2018 4:22 am I solved the problem although I'm not sure how.
I decided to try installing CalculiX using the outdated install guide on the CalculiX website <http://www.dhondt.de/INST_CCX_2_8_MAC_02_10_2015.pdf>. The install wasn't successful (it threw an error while making CalculiX). However before having a second go at the install I tried chrisb's files again and the solver worked. My best guess is I changed something related to solvers dependencies SPOOLES and ARPACK.
Actually @Locost is right. Our gcc version is 8, but this ccx binary is compiled with version gcc of version 7. If we provide the missed lib files, ccx_2.13 will work as expected.
Here is what I did, by referencing @vicnorton here.

Code: Select all

$ ccx_2.13
dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib
  Referenced from: /usr/local/bin/ccx_2.13
  Reason: image not found
Abort trap: 6
$ cd /usr/local/opt
$ sudo mv gcc gcc8
$ brew install gcc@7
$ cd /usr/local/opt
$ sudo ln -s /usr/local/Cellar/gcc@7/7.3.0 gcc
$ ccx_2.13
dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/8/libgfortran.5.dylib
  Referenced from: /usr/local/opt/arpack/libexec/lib/libarpack.2.dylib
  Reason: image not found
Abort trap: 6
$ sudo cp -r /usr/local/Cellar/gcc/8.2.0/lib/gcc/8 /usr/local/Cellar/gcc@7/7.3.0/lib/gcc/
$ ccx_2.13
Usage: CalculiX.exe -i jobname
It worked, and I got the colored FEM results finally.
Image

I think this hack solution is temporary, because this problem should be solved more elegantly by:
  1. Provide new package in brewsci/science tap, However it has anounced no maintainace anymore.
  2. "$ brew reinstall calculix-ccx --build-from-source" in one's own machine with new gcc version. However the process finally "make *** [calculix-ccx] Error 1" but providing issue on that repository seems useless.
  3. MacPorts have been one way to install Calculix, as @ian.rees posted here years ago. I didn't try it, but I have read through that topic. It sounds exciting, and I hope he would come back to MacPort. ;)
    ian.rees wrote: Wed Mar 02, 2016 10:43 am I've been messing around over the last few evenings with making a port for CalculiX (the FEM program that FreeCAD uses) - would be great to get a bit of testing from people who have an interest in using FreeCAD on Macs! This just involves:

    1 Cloning a small git repository https://github.com/ianrrees/macports
    2 Pointing MacPorts at the git repository https://guide.macports.org/#development ... positories
    3 Running "sudo port install calculix" and noting any issues
    4 If it works you should be able to run ccx and see something like "Usage: CalculiX.exe -i jobname"

    I haven't had a chance to verify the dependencies yet; I've got it set to use gcc5 currently, but can probably use older versions too. Thanks! -Ian-
    ---
    OS: Mac OS X
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.17.13541 (Git)
    Build type: Release
    Branch: releases/FreeCAD-0-17
    Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
    Python version: 2.7.14
    Qt version: 5.10.1
    Coin version: 4.0.0a
    OCC version: 7.2.0
    Locale: English/UnitedStates (en_US)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM on Mac OSX

Post by Kunda1 »

CalculiX is currently on version 2.14
The brewsci Homebrew tap doesn't look maintained.
Perhaps we can organize someone(s) here in the community to be in charge of a Homebrew formula?
Currently CalculiX downstream packaging is being tracked at
https://github.com/luzpaz/FreeCAD-depen ... /issues/30
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
bobmel
Posts: 15
Joined: Wed Mar 14, 2018 9:28 am

Re: FEM on Mac OSX

Post by bobmel »

I have compiled CalculiX v2.15 with gcc 8.2.0 on macOS High Sierra in case someone else is interested.

A binary can be downloaded here: https://www.dropbox.com/s/vf6s896m0f4jdhs/ccx_2.15?dl=0

Word of caution: I'm a complete FEM newbie and I have only run a few of the tests provided with CalculiX so NO guarantees the binary works perfectly.

I've also created a repository on Github: https://github.com/bobmel/CalculiX where the modified code can be found.
kinichii
Posts: 1
Joined: Mon Jan 14, 2019 5:42 am

Re: FEM on Mac OSX

Post by kinichii »

bobmel wrote: Sat Jan 12, 2019 12:18 pm A binary can be downloaded here: https://www.dropbox.com/s/vf6s896m0f4jdhs/ccx_2.15?dl=0
Thanks.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM on Mac OSX

Post by Kunda1 »

bobmel wrote: Sat Jan 12, 2019 12:18 pm I have compiled CalculiX v2.15 with gcc 8.2.0 on macOS High Sierra in case someone else is interested.
In that case, would you be interested, in helping CalculiX and other FEM/FEA solvers in to the macos package ecosystem by submitting them to package managers like Homebrew or Macports ?
Checkout:
https://github.com/luzpaz/FreeCAD-depen ... hes/FEM.md
https://github.com/luzpaz/FreeCAD-depen ... /issues/20

Of course please also check out FreeCAD's homebrew taps as well: https://github.com/FreeCAD/homebrew-freecad
Those guys can also use some help.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
bobmel
Posts: 15
Joined: Wed Mar 14, 2018 9:28 am

Re: FEM on Mac OSX

Post by bobmel »

Kunda1 wrote: Mon Jan 14, 2019 1:12 pm
bobmel wrote: Sat Jan 12, 2019 12:18 pm I have compiled CalculiX v2.15 with gcc 8.2.0 on macOS High Sierra in case someone else is interested.
In that case, would you be interested, in helping CalculiX and other FEM/FEA solvers in to the macos package ecosystem by submitting them to package managers like Homebrew or Macports ?
Checkout:
https://github.com/luzpaz/FreeCAD-depen ... hes/FEM.md
https://github.com/luzpaz/FreeCAD-depen ... /issues/20

Of course please also check out FreeCAD's homebrew taps as well: https://github.com/FreeCAD/homebrew-freecad
Those guys can also use some help.
I’ll see what I can do. Creating one based on the existing v2.13 one in Homebrew/brewsci seems like fairly low hanging fruit.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: One Temporary Solution for FEM on Mac OSX with gcc version Problem

Post by ian.rees »

Johnquicker wrote: Tue Dec 11, 2018 8:31 am [*] MacPorts have been one way to install Calculix, as @ian.rees posted here years ago. I didn't try it, but I have read through that topic. It sounds exciting, and I hope he would come back to MacPort. ;)
That's very unlikely. My (programming, mostly) job has been keeping me too busy, and have been using Linux as my main OS for a few months (admittedly, a struggle with current Ubuntu and an nvidia-driven 4K screen - it nearly caught fire yesterday), and before that got totally burned out on MacPorts. Unless things have changed greatly in recent history, you're really better off with Homebrew...
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM on Mac OSX

Post by Kunda1 »

Can folks :+1: this comment: https://github.com/Homebrew/homebrew-co ... -459008392 please?
Reason: Show the homebrew devs that there is a MacOS userbase that would benefit from having CalculiX in Homebrew
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
twangrt
Posts: 40
Joined: Sun Apr 28, 2019 6:34 pm

Re: FEM on Mac OSX

Post by twangrt »

bobmel wrote: Sat Jan 12, 2019 12:18 pm I have compiled CalculiX v2.15 with gcc 8.2.0 on macOS High Sierra in case someone else is interested.

A binary can be downloaded here: https://www.dropbox.com/s/vf6s896m0f4jdhs/ccx_2.15?dl=0

Word of caution: I'm a complete FEM newbie and I have only run a few of the tests provided with CalculiX so NO guarantees the binary works perfectly.

I've also created a repository on Github: https://github.com/bobmel/CalculiX where the modified code can be found.
Thank you for providing the binary! Works well what I can tell.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/Sweden (en_SE)
namore
Posts: 1
Joined: Tue Jun 08, 2021 10:24 am

Re: FEM on Mac OSX

Post by namore »

To get calculix-ccx working with OSX 11.4 Big Sur (w/ M1 CPU), I forked and updated the Formula from homebrew-sci. It will issue some warnings since I didn't bother yet to add the hashes, but it works fine for me.

Installation is as simple as it gets:

Code: Select all

brew install namore/homebrew-custom/namore-calculix-ccx
Feel free to make a merge request if you want to improve something. I will try to find some time to tidy up the Formula and add hashes.

EDIT: The hashes are correct now, it installs without a warning. Next step is getting Bottles ready so that brew won't have to compile anything locally.
Last edited by namore on Sat Jun 12, 2021 1:54 pm, edited 1 time in total.
Post Reply