# Installing cgx on macos

**URL:** <https://calculix.discourse.group/t/installing-cgx-on-macos/250>\
**Category:** CalculiX GraphiX\
**Created:** [October 10, 2020, 1:32pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250 "2020-10-10T13:32:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveen](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@praveen](https://calculix.discourse.group/u/praveen)\
**Post date:** [October 10, 2020, 1:32pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/1 "2020-10-10T13:32:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [October 11, 2020, 3:32pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/2 "2020-10-11T15:32:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![praveen](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@praveen](https://calculix.discourse.group/u/praveen)\
**Post date:** [October 11, 2020, 3:47pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/3 "2020-10-11T15:47:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [October 11, 2020, 3:53pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/4 "2020-10-11T15:53:18Z")

</div>

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  
…  
…

---

<div class="post-metadata">

**Author:** ![praveen](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@praveen](https://calculix.discourse.group/u/praveen)\
**Post date:** [October 11, 2020, 4:08pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/5 "2020-10-11T16:08:10Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [October 12, 2020, 6:49pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/6 "2020-10-12T18:49:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [October 12, 2020, 7:34pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/7 "2020-10-12T19:34:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![klaus.wittig](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@klaus.wittig](https://calculix.discourse.group/u/klaus.wittig)\
**Post date:** [October 12, 2020, 8:02pm UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/8 "2020-10-12T20:02:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![praveen](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@praveen](https://calculix.discourse.group/u/praveen)\
**Post date:** [October 13, 2020, 4:14am UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/9 "2020-10-13T04:14:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WilliamK](https://avatars.discourse-cdn.com/v4/letter/w/90ced4/32.png) [@WilliamK](https://calculix.discourse.group/u/WilliamK)\
**Post date:** [November 26, 2020, 5:59am UTC](https://calculix.discourse.group/t/installing-cgx-on-macos/250/10 "2020-11-26T05:59:52Z")

</div>

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
