Installing cgx on macos

I installed cgx on macos catalina. I am trying to view solution files from ISAAC. When I start cgx like this

cgx -isaac2d naca0012

I get a blank window. Also I see some error message

$ ~/applications/calculiX/cgx_2.17.1/src/cgx -isaac2d naca0012

Error in:sem_init

Error in:sem_init

Error in:sem_init

Error in:sem_init

on a Darwin machine, nodename Praveens-MacBook-Pro.local, release 19.6.0, version Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64, machine x86_64

The HOME was detected:/Users/praveen

parameters:3 arguments:2

GL_MAX_EVAL_ORDER:10, mesh threads:1

Try to read 2D-isaac results

Will it not work on macos ?

Thanks

Hi Praveen,
I never tested cgx on macos. But I could see if your isaac example works on my computer and if not I could try to solve the problem. I just checked a 2d and 3d example on my own linux pc without problems.
Klaus

Thanks a lot for looking into this.

I had to remove linking to librt since it does not seem to exist on macos. It compiled fine and I can run the executable. It shows an error as I posted above, but the X11 window opens but it is blank.

The reading seems to not to take place.
You should see something like that:

on a Linux machine, nodename linux-gpa9, release 4.12.14-lp151.28.67-default, version #1 SMP Fri Sep 4 15:23:21 UTC 2020 (2c5a14f), machine x86_64
The HOME was detected:/root
parameters:3 arguments:2
GL_MAX_EVAL_ORDER:8, mesh threads:1
Try to read 2D-isaac results

RAE2822.g.fmt opened
MODEL NAME: isaac

Read the Grid
nblocks:17
dim:2 block:1 i:52 j:27 nodes:1404
dim:2 block:2 i:27 j:52 nodes:1404
dim:2 block:3 i:22 j:98 nodes:2156
dim:2 block:4 i:98 j:12 nodes:1176
dim:2 block:5 i:14 j:12 nodes:168
dim:2 block:6 i:14 j:27 nodes:378

Sorry, I did not post full output. I see the following. It also opens the X11 window which does not show any plot.

$ ~/applications/calculiX/cgx_2.17.1/src/cgx -isaac2d naca0012
Error in:sem_init
Error in:sem_init
Error in:sem_init
Error in:sem_init
on a Darwin machine, nodename Praveens-MacBook-Pro.local, release 19.6.0, version Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64, machine x86_64 
 The HOME was detected:/Users/praveen
parameters:3 arguments:2
GL_MAX_EVAL_ORDER:10, mesh threads:1
 Try to read 2D-isaac results


naca0012.g.fmt opened
 MODEL NAME:  isaac

 Read the Grid  
nblocks:1
dim:2 block:1 i:226 j:34 nodes:7684
 block:1 i:226 j:34 k:1
xyz[0]: 20.000000 0.000000 0.000000 1
xyz[1]: 18.378240 0.000000 0.000000 2
xyz[2]: 15.410865 0.000000 0.000000 3
xyz[3]: 12.948765 0.000000 0.000000 4
xyz[4]: 10.905905 0.000000 0.000000 5

xyz[7679]: 11.767115 18.984750 0.000000 7680
xyz[7680]: 13.555470 18.841985 0.000000 7681
xyz[7681]: 15.827835 18.719570 0.000000 7682
xyz[7682]: 18.541915 18.664370 0.000000 7683
xyz[7683]: 20.000000 18.664370 0.000000 7684

 Read the Results  

naca0012.q.fmt opened

The input file "naca0012.qt.nam" could not be opened.
-> no turbulence quantities available
nblocks:1
dim:2 block:1 i:226 j:34 k:1
lcase.name[0]= basic---
 block:1 i:226 j:34 k:1  fsmach:0.800000 alpha:1.250000 Re:1000000.000000 time:0.000000
 Elements: 7425 Nodes:7684 Datasets:1  MinElemNr: 1 MaxElemNr: 7425 MinNodNr:1 MaxNodNr:7684  read in 0.010023 sec 
 found elements of type 1: 0
 found elements of type 2: 0
 found elements of type 3: 0
 found elements of type 4: 0
 found elements of type 5: 0
 found elements of type 6: 0
 found elements of type 7: 0
 found elements of type 8: 0
 found elements of type 9: 7425
 found elements of type 10: 0
 found elements of type 11: 0
 found elements of type 12: 0
gtol calculated:4.945783e-09

So the data are stored. Please type
plot na all
frame
You should see the nodes.
Type
plot e all
you should see elements

Did it work?

Ok, it just came to my attention that you got not even a graphic window, just the xterm. And I figured out that you opened one of the original isaac example files.I did that as well and now cgx crashed. So the problem is related to the original result files. I worked only with my own models created with cgx. I will look into that.

Ok, I found the trouble maker. Somehow this statement is not doing what I thought it would:
elem[anz->e].nr = ++anz->e;
It has to be replaced by
anz->e++;
elem[anz->e-1].nr = anz->e;
in readIsaac.c and optionally for Duns in readDuns.c
The updated code will be available with the next release.

Nothing happened when I did this. Still do not see any plots.

I have Mac OS/X Catalina but I do not run Calculix under the Mac OS. There are some differences between linux systems and the Mac implementation based on BSD Unix, such as the treatment of capital and lowercase letters in file and module names.

My solution was to install Ubuntu Linux on a removable SSD drive. During the install process, the Ubuntu installer puts EFI-Boot records on the Mac disk, making it possible to boot other operating systems than run on Intel processors. I put the results of a Calculix model on a flash drive that I can read when I reboot under the Mac OS.

If you must run Calculix at the same time as the Mac OS, consider one of the commercial products that allow you to run Linux or Windows simultaneously with the Mac OS. Another option is Oracle VirtualBox, which is Open Source under the GNU General Public License. I have just found it easier to boot in native mode than to run the virtualizing software, which can introduce bugs that neither the Mac OS and to the guest operating system had alone.

Best,

–William