FEM on Mac OSX

About the development of the FEM module/workbench.
frabice
Posts: 18
Joined: Mon Jun 09, 2014 6:21 pm
Location: Clermont-Ferrand, France

FEM on Mac OSX

Postby frabice » Sun May 17, 2015 5:59 pm

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 1643 times
User avatar
PrzemoF
Posts: 1707
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Postby PrzemoF » Sun May 17, 2015 8:38 pm

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
Posts: 2999
Joined: Wed Oct 22, 2014 5:02 pm

Re: FEM on Mac OSX

Postby sgrogan » Mon May 18, 2015 1:41 pm

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?http://forum.freecadweb.org/viewtopic.php?f=18&t=10393&start=60#p84137
Exclaimer: I also don't know about MAC.
wmayer
Site Admin
Posts: 11234
Joined: Thu Feb 19, 2009 10:32 am

Re: FEM on Mac OSX

Postby wmayer » Mon May 18, 2015 2:15 pm

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: 18
Joined: Mon Jun 09, 2014 6:21 pm
Location: Clermont-Ferrand, France

Re: FEM on Mac OSX

Postby frabice » Mon May 18, 2015 6:34 pm

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
Posts: 1707
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Postby PrzemoF » Mon May 18, 2015 6:37 pm

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

Re: FEM on Mac OSX

Postby frabice » Mon May 18, 2015 7:45 pm

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
Posts: 1707
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Postby PrzemoF » Mon May 18, 2015 8:02 pm

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

Re: FEM on Mac OSX

Postby frabice » Mon May 18, 2015 8:19 pm

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
Posts: 1707
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FEM on Mac OSX

Postby PrzemoF » Mon May 18, 2015 8:28 pm

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