FEM on Mac OSX

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

FEM on Mac OSX

Post by frabice »

Hello everyone,

I am trying to use the FEM WB but I face some problems. The first was with the mesh generation but that is resolved thanks to the gmsh macro.
Now I have an error at the calculix stage (see image attached). I am not sure to understand how it works. Is calculix supposed to come with freecad? Do I have to install it separately? Is this the real problem?

I am running Freecad from pressure_v2 branch of PrzemoF on a mac OS 10.9.5.
I tried to install calculix from source following the instructions from http://www.dhondt.de/INST_CCX_2_8_MAC_02_10_2015.pdf but I have an error at compilation stage.

Is anyone using the FEM workbench on a mac?
Attachments
Capture d’écran 2015-05-17 à 19.54.25.png
Capture d’écran 2015-05-17 à 19.54.25.png (92.83 KiB) Viewed 8211 times
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Post by PrzemoF »

If you have the ccx binary somewhere on the system you can define it's location in the FEM Preferences.

Exclaimer: I know nothing about running software on mac.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FEM on Mac OSX

Post by sgrogan »

This is the same error we were getting on Ubuntu when starting FreeCAD from the menu. Calculix was trying to run to a write protected directory. Maybe related to permissions?viewtopic.php?f=18&t=10393&start=60#p84137
Exclaimer: I also don't know about MAC.
"fight the good fight"
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FEM on Mac OSX

Post by wmayer »

To me the message "Failed to start" looks more like that ccx isn't installed/cannot be found on the machine. IIRC, the problem with the write-protected directory led to a not properly created .inp file.

When you look at http://www.dhondt.de/ there doesn't seem to exists a pre-built binary for MacOSX and it seems you have to build it yourself.
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: FEM on Mac OSX

Post by frabice »

wmayer wrote:When you look at http://www.dhondt.de/ there doesn't seem to exists a pre-built binary for MacOSX and it seems you have to build it yourself.
Yes I tried but I have error at builing. There seems to be some problems with pthread functions in the code... which doesn't seem so probable!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Post by PrzemoF »

If you want help we need to know exactly what's the error and after which step from the manual.
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: FEM on Mac OSX

Post by frabice »

The build of ccx fails, step 7.1.3 from the manual. This is the error I have:

Code: Select all

usr/local/bin/g++ -Wall -O3 -pthread  -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT -c biosav.c
biosav.c: In function ‘void biosav(int*, int*, char*, int*, double*, double*, double*, int*, int*, int*)’:
biosav.c:168:70: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’ [-fpermissive]
  pthread_create(&tid[i],NULL,(void *)biotsavartmt,(void *)&ithread[i]);
                                                                      ^
In file included from biosav.c:23:0:
CalculiX.h:1647:5: note: initializing argument 3 of ‘int pthread_create(_opaque_pthread_t**, const pthread_attr_t*, void* (*)(void*), void*)’
 int pthread_create (pthread_t *thread_id, const pthread_attr_t *attributes,
     ^
make: *** [biosav.o] Error 1
The error message is quite clear, but I find it strange that there is a conversion error...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Post by PrzemoF »

Try to use cc instead of g++. (Ignore that point: CC=cc → CC=/usr/local/bin/g++)
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: FEM on Mac OSX

Post by frabice »

It did go a bit further and manage to build biosav.c but I have another error afterwards:

Code: Select all

cc -Wall -O3 -pthread  -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT -c u_free.c
u_free.c:44:3: error: non-void function 'u_free' should return a value [-Wreturn-type]
  return;
  ^
1 error generated.
make: *** [u_free.o] Error 1
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Post by PrzemoF »

Change return; -> return 0; or add -Wno-return-type to your makefile after -Wall
Post Reply