Installation for Mac OS X users

1,445 views
Skip to first unread message

Tessel Grubben

unread,
Mar 5, 2021, 10:46:46 AM3/5/21
to basilisk-fr
Hi there,

I am having some trouble installing the software on my Mac. I am new to all of this, so please forgive me if the solution my problem is obvious. 
When following the Mac OS X installation instructions fo make and gdb:
cd basilisk/src 
cp config.osx config 
make -k 
make

I get the next error message after make -k:

(base) tesselgrubben@MacTG src % make -k

Makefile:108: /Makefile.defs: No such file or directory

make: *** No rule to make target `/Makefile.defs'.

make: Failed to remake makefile `/Makefile.defs'.

cc -O2 -DLIBDIR=\"`pwd`\" \

-DCC99="\"\"" \

-DCPP99="\"\"" \

-DCADNACC="\"\"" \

-DBASILISK="\"\"" \

qcc.c include.o rotate.o -o qcc

cd kdt && make

make[1]: Nothing to be done for `all'.

cd darcsit && make && cd cgi-bin && make

make[1]: Nothing to be done for `all'.

chmod 755 darcsit

cd gl && make libfb_dumb.a libglutils.a

make[1]: `libfb_dumb.a' is up to date.

bison parser.y

parser.y:73.1-6: invalid directive: `%param'

parser.y:73.8-22: syntax error, unexpected {...}

make[1]: *** [parser.tab.c] Error 1

make[1]: Target `libglutils.a' not remade because of errors.

make: *** [libfb_dumb] Error 2

cd wsServer && make

gcc -std=c99 -Wno-unused-result -Wno-unused-function  /Users/tesselgrubben/FDSE/basilisk/src/wsServer/src/ws.c -g -Wall -pipe -DDUMBGL -O2 -I /Users/tesselgrubben/FDSE/basilisk/src/wsServer/include -c -o /Users/tesselgrubben/FDSE/basilisk/src/wsServer/src/ws.o

/Users/tesselgrubben/FDSE/basilisk/src/wsServer/src/ws.c:304:34: error: use of

      undeclared identifier 'MSG_NOSIGNAL'

  return send (sockfd, buf, len, MSG_NOSIGNAL);

                                 ^

1 error generated.

make[1]: *** [/Users/tesselgrubben/FDSE/basilisk/src/wsServer/src/ws.o] Error 1

make[1]: Target `all' not remade because of errors.

make: *** [libws] Error 2

make: *** No rule to make target `bview.s', needed by `bview2D'.

make: Target `all' not remade because of errors.


How can I solve this? 

Cheers,

Tessel


Vatsal Sanjay

unread,
Mar 5, 2021, 10:59:10 AM3/5/21
to basilisk-fr
Hi Tessel,

Use the following steps instead:

cd basilisk/src
cp config.osx config
export BASILISK=$PWD
export PATH=$PATH:$PWD
make -k
make

The above steps should, in principle, work. The reason could be that the make command does not know your basilisk home directory. See the steps at http://basilisk.fr/src/INSTALL.

Once you are done, follow the subsequent steps on http://basilisk.fr/sandbox/INSTALL_MACOS. Be careful of the different names of the .bashrc file on mac.

Cheers,
Vatsal

Tessel Grubben

unread,
Mar 5, 2021, 11:28:51 AM3/5/21
to basilisk-fr
Hi Vatsal, thanks for you reply! It however still doesn't seem to work :(
I now get the following warning:

qcc.lex:2920:33: warning: explicitly assigning value of variable of type 'int'

      to itself [-Wself-assign]

    int s = system (command); s = s;


And this error is still there as well:

/Users/tesselgrubben/FDSE/basilisk/src/wsServer/src/ws.c:304:34: error: use of

      undeclared identifier 'MSG_NOSIGNAL'

  return send (sockfd, buf, len, MSG_NOSIGNAL);


Any suggestions on what else I could try?

Op vrijdag 5 maart 2021 om 16:59:10 UTC+1 schreef vatsal...@gmail.com:

Benny Smith

unread,
Mar 7, 2021, 6:08:33 PM3/7/21
to basilisk-fr
I have seen the same problem trying to install Basilisk on my Mac, and if anyone knows the solution it would be much appreciated.

Stephane Popinet

unread,
Mar 8, 2021, 3:49:55 AM3/8/21
to basil...@googlegroups.com
googling "MSG_NOSIGNAL macosx" gives me this:

https://github.com/intel/parameter-framework/issues/39

with the solution in the patch.

This solution might actually be better:

https://makedist.com/posts/2014/01/16/porting-msg_more-and-msg_nosigpipe-to-os-x/

Otherwise I will give you my generic answer to this kind of issues:
"Don't use a mac", there are many good reasons not to.

cheers,

Stephane

Twan Heijink

unread,
Mar 9, 2021, 12:23:59 PM3/9/21
to basilisk-fr
Hi Tessel,

In case you didn't find a way out yet..
I have experienced the same, working with macOS 11 on an Intel mac.
Just using config.gcc seems to work so far.

Cheers,
Twan
Op maandag 8 maart 2021 om 09:49:55 UTC+1 schreef Stephane Popinet:

Arthur Ghigo

unread,
Mar 9, 2021, 5:03:13 PM3/9/21
to Twan Heijink, basilisk-fr
Hi everyone,

You can find attached the scripts I use to install basilisk on my mac.
I have not included in the scripts the declaration of the variable $BASILISK, which you should put in your .bashrc or .zshrc, ...

Note that I have recently changed macs and I am now working on the Mac M1 with an ARM chip.
So for those running Basilisk on intel, small modifications are required.

I hope this helps!

Best,
Arthur Ghigo


--
You received this message because you are subscribed to the Google Groups "basilisk-fr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to basilisk-fr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/e1d8b51a-c1ea-4057-b528-c5d3c24289a4n%40googlegroups.com.


--
Best,
Arthur Ghigo
basilisk_with_macport_ARM.zip

Stephane Zaleski

unread,
Mar 10, 2021, 3:02:34 AM3/10/21
to Arthur Ghigo, Twan Heijink, basilisk-fr
Dear Arthur

  Thank you for you help ! 

  Your patch is a bit mysterious to me since you mention adaptation to Intel but there is no much that is ARM-specific ? You also say 
" Note here that the macport packages need to be read before the native packages.
If not, a problem occurs with bison and parser.y"   I have not clue what the "native packages" are ? I do have problems with bison I just 

% sudo port install bison

 Best

Stéphane


Stephane Popinet

unread,
Mar 10, 2021, 3:29:07 AM3/10/21
to basil...@googlegroups.com
Hi Arthur,

Thanks for your feedback on this. If Mac users are serious about still
using a Mac and using Basilisk, I believe it would be good if "somebody"
(you? :) ) took care to reorganise / update / maintain the existing docs
on the wiki. Given that the main issue with Macs seems to be that
versions/upgrades of MacOSX/other packages seem to be incompatible with
one another, this will probably involve coordinating with a large enough
pool of Mac users who can test the installation procedure on a range of
versions.

cheers,

Stephane

PS: another solution based on Docker was proposed a while ago by Stefan
Llewellyn Smith (look in the mailing list archives). This could also be
included in the docs.

Arnaud Antkowiak

unread,
Mar 10, 2021, 9:06:40 AM3/10/21
to basilisk-fr
Hi,

Out of shame, I confess using Basilisk on a Mac. My experience is that installing the core of basilisk is a cinch, but the real difficulty lies in linking with the graphical libraries to get view/bview working. Because of several Apple non-standard libraries (eg openGL) I took the radical decision of recompiling Mesa, and everything is now working as expected.
Recently I helped a student in the install process, and asked him to take notes all along: http://basilisk.fr/sandbox/M2_MSH/2020_2021/ELEGBEDE_THEO/install_MACOs.c

PS: another solution based on Docker was proposed a while ago by Stefan Llewellyn Smith (look in the mailing list archives). This could also be included in the docs.

I'm note sure how Docker would be helpful with the graphical rendering, as you would still need to communicate with the outside world (the damned Mac) to display anything (or maybe the latest web oriented bview version alleviates this issue?). Probably Stefan has an opinion on this.

Best wishes

Arnaud

Arthur Ghigo

unread,
Mar 10, 2021, 10:56:39 AM3/10/21
to Stephane Zaleski, Twan Heijink, basilisk-fr
Hi Stephane,

Thanks for your feedback!

Your patch is a bit mysterious to me since you mention adaptation to Intel but there is no much that is ARM-specific ?
 
That is true, I think the only things in my installation scripts that are ARM specific are:
- darcs is not supported for ARM so I have installed it from source.
- in compile_basilisk_arm64.sh, I have added arch -x86_64 .

You also say " Note here that the macport packages need to be read before the native packages.
If not, a problem occurs with bison and parser.y"   I have not clue what the "native packages" are ? I do have problems with bison I just 

By native package I meant packages that are included with the "Command Line Tools" of mac. I have tried to make the Basilisk install using a minimum of packages from MacPorts.

In that sense, for graphical visualization, I have only installed the GLEW library using MacPorts and I am using the "native" opt/X11 libraries I have installed using XQuartz. This is why when I compile the GL libraries I add the flag: CFLAGS="-I/opt/X11/include -I/opt/local/include -Wno-deprecated-declarations"

--
Best,
Arthur Ghigo

Stefan Llewellyn Smith

unread,
Mar 12, 2021, 12:38:09 PM3/12/21
to Arnaud Antkowiak, basilisk-fr
Hi all,

Sorry for the delay in answering. Docker interacts pretty well with X, so I was able to get graphical programs to work. I haven't updated the docker file  to more recent versions of basilisk. I should do that if there is interest.

The docker image is basilisk-docker (or possibly sgls/basilisk-docker). I attach a script to run it. You need to check the "Allow connections from network clients" box in the Xquartz Preferences/Security menu.

Whatever I put on the basilisk site has been lost, so I should put something there again.

Stefan

PS Script attached. It doesn'' have a -h flag. You can pass 2 arguments, the first being the name of a folder to share on your Mac and the second the name it will have inside the image.

--
You received this message because you are subscribed to the Google Groups "basilisk-fr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to basilisk-fr...@googlegroups.com.


--
Stefan LLEWELLYN SMITH
Department of Mechanical and Aerospace Engineering
Scripps Institution of Oceanography
UCSD
9500 Gilman Drive
La Jolla CA 92093-0411
USA
Tel: +1 858 822 3475
Fax: +1 858 534 7599
E-mail: sg...@ucsd.edu
WWW: http://web.eng.ucsd.edu/~sgls
dbasilisk

Stephane Popinet

unread,
Mar 15, 2021, 4:16:38 AM3/15/21
to basil...@googlegroups.com
Hi Stefan,

> Whatever I put on the basilisk site has been lost, so I should put
> something there again.

I don't think there ever was a page on the site describing how to use
your docker setup (if there was and it has been removed by mistake, we
should be able to dig it up again using darcs), but yes it would be good
to gather the info you sent on the mailing list on such a page.

cheers,

Stephane

Stephane Zaleski

unread,
Mar 15, 2021, 2:06:00 PM3/15/21
to basilisk-fr
If Mac users are serious about still using a Mac and using Basilisk, I believe it would be good if "somebody" (you? :) ) took care to reorganise / update / maintain the existing docs on the wiki.

Dear all, 

  that would obviously very good, and I am tempted to do it as well, but an even better option IMHO  would be to create a MacPorts port. If I find some free time I will do it. 

  Best

Stephane

Stephane Zaleski

unread,
Mar 17, 2021, 2:15:59 PM3/17/21
to basilisk-fr
Dear all

I managed to install Basilisk succesfully, including the js-based view server on my old Mac, running macOS version 11.2 "Big Sur" and
Xcode 12.4. I used a combination of Arnaud's and Arthur's recommendations, so it could be called the AA method. I adapted Arnaud's method to use macports instead of brew.

In my case, I did not need to recompile Mesa, but I had to build gcc-mp-9 from source ( it is called gcc-mp-9 on macports
and gcc-9 on brew apparently ) which took me two or three hours.

I also need to tweak the compilation flags, for example I compile karman.c like this :

% qcc -autolink -DDISPLAY=-1 -O2 -fopenmp -g -Wall -pipe -L/opt/local/lib -o karman karman.c -lfb_osmesa -lGLU -lGLEW -lOSMesa -lm

both -autolink and -L/opt/local/lib are required for some reason that I do not understand. I needed to install GLU and GLEW using macports. OSMesa was already installed.

I attach the config file I used.

Next I am going to install "from scratch" on a new mac.

Hope it helps

Stéphane

PS I am not going to comment on whether it is a good idea to use a mac or not. However my personal experience is that I the time I spend configuring my mac is not insufferable.

config_AA_macports.osx

Stephane Popinet

unread,
Mar 18, 2021, 4:17:16 AM3/18/21
to basil...@googlegroups.com
Hi Stephane,

> In my case, I did not need to recompile Mesa, but I had to build
> gcc-mp-9 from source ( it is called gcc-mp-9 on macports and gcc-9
> on brew apparently ) which took me two or three hours.

This is very strange. I assume that if you built gcc-mp-9 from source,
you already had a C99 compliant compiler installed on your system? Why
could you not just use this compiler to compile qcc?

cheers,

Stephane

Stephane Zaleski

unread,
Mar 18, 2021, 4:46:04 AM3/18/21
to basilisk-fr
Hi Stephane

I can do almost everything with clang, the C and C++ compiler provided by Xcode, which is Macosx's developing environment. However the -fopenmp compiler option, which is required when you do for example

% CFLAGS=-DDISPLAY=-1 make karman.tst

which the displays

qcc -autolink -DDISPLAY=-1 -O2 -fopenmp -g -Wall -pipe -I/usr/include -L/usr/lib -o karman/karman karman.c -lm

(I guess it is somewhat related to the javascript based visualisation ( should it be called jview ? It sounds simpler ))
is not supported. So I switched to gcc.

There is this discussion:

https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave

where several answers recommend installing llvm and omp using brew. It may be possible to use that route but I found the option of using gcc instead more consistent with the AA approach.

Cheers

Stephane

PS if you just type

% qcc -autolink -DDISPLAY=-1 -O2 -fopenmp -g -Wall -pipe -I/usr/include -L/usr/lib -o karman/karman karman.c -lm

that is if you try to compile directly, not by

% CFLAGS=-DDISPLAY=-1 make karman.tst

then the compilation fails. I should be able to figure out why, but I could not and all I coud to is to use the fix I described above in the thread:

% qcc -autolink -DDISPLAY=-1 -O2 -fopenmp -g -Wall -pipe -L/opt/local/lib -o karman karman.c -lfb_osmesa -lGLU -lGLEW -lOSMesa -lm

It may be related to the switch in compilers, or to the way I did things in config, or to my environment variables.

PPS very happy to see jview working on my machine, it is a great way to do simulations, thanks !

PPPS I saw your recorded talk on jview, very useful, my perturbation of the meeting is there for all eternity, now that is a reason to be ashamed ! Never try to use Zoom and Teams simultaneously :D :D

Stephane Popinet

unread,
Mar 18, 2021, 6:13:43 AM3/18/21
to basil...@googlegroups.com
> I can do almost everything with clang, the C and C++ compiler
> provided by Xcode, which is Macosx's developing environment. However
> the -fopenmp compiler option, which is required when you do for
> example
>
> % CFLAGS=-DDISPLAY=-1 make karman.tst

You can run the examples without OpenMP: just edit src/examples/Makefile
and remove the '-fopenmp' flags in CFLAGS.

> (I guess it is somewhat related to the javascript based visualisation
> ( should it be called jview ? It sounds simpler )) is not supported.
> So I switched to gcc.

I don't really understand your comment, but no, jview has nothing to do
with OpenMP. So the karman example and jview should work fine (but more
slowly) without the -fopenmp flag.

Note also that jview does not rely on OSMesa, so there should probably
be two/three ways to install Basilisk on osx:

1) simplest install: no OSMesa, no OpenMP: just use xcode/clang to
compile qcc and any Basilisk code. Jview should work.

2) with OpenMP: install llvm or gcc etc.

3) with OSMesa and any combination of compilers above.

> There is this discussion:
>
> https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave
>
> where several answers recommend installing llvm and omp using brew.

I see. So it seems that OpenMP is not supported "out-of-the-box" on
Xcode/macosx. Can this really be true?! If so this is bad... and another
good practical reason not to use osx.

cheers,

Stephane

PS: the page to edit is

http://basilisk.fr/sandbox/INSTALL_MACOS

Stephane Zaleski

unread,
Mar 18, 2021, 8:25:10 AM3/18/21
to basilisk-fr
Thank you for your answer, it is super useful. The Mac vs ...[ I do not know how to call it, linux on PC hardware ?] issue is probably outside the scope of this mailing list ? But I reflected on it and I must admit it is very hard to rationalise.

I will update the installation instructions.

Stephane Zaleski

unread,
Mar 31, 2021, 10:07:56 AM3/31/21
to basilisk-fr
Hi

  I am trying to edit/improve the page: http://basilisk.fr/sandbox/INSTALL_MACOS

  I wonder why you recommend flex, make and gawk in the line:

sudo apt install darcs flex bison make gawk

  in the page  http://basilisk.fr/src/INSTALL#using-darcs . Are flex, make and gawk not installed by default or do they have desirable characteristics for the basilisk installation ? Should I install gmake on the mac and recommend its use instead of make ? 

  Actually

- when I install flex using MacPorts it replaces the original flex of MacOSX and an error unsues:

lex.yy.c:1935:12: error: static declaration of 'yyget_leng' follows non-static declaration

I then needed to uninstall flex ! I had the same problem two years ago. 

- gmake seems to make no difference

- gawk seems to make no difference but it is too soon to tell. 

Hope it helps

Best

Stephane

Stephane Zaleski

unread,
Mar 31, 2021, 10:15:23 AM3/31/21
to basilisk-fr
- when I install flex using MacPorts it replaces the original flex of MacOSX and an error unsues:

lex.yy.c:1935:12: error: static declaration of 'yyget_leng' follows non-static declaration

I then needed to uninstall flex ! I had the same problem two years ago. 

In addition to uninstalling flex I had to obliterate the basilisk directory and download (get) it again using darcs. 
Saying this if anyone has the same problem. 

Stephane Popinet

unread,
Mar 31, 2021, 11:42:49 AM3/31/21
to basil...@googlegroups.com
Hi Stephane

> Are flex,
> make and gawk not installed by default or do they have desirable
> characteristics for the basilisk installation ?

Both. flex and make may not be installed by default (since they are
specific to programming which not all people do).

gawk is a version of 'awk', there are several available and they may
have different characteristics. Some of the scripts in the default
makefiles of Basilisk rely on some features of gawk. But if you don't
use Basilisk makefiles (against my advice) then gawk is not required to
compile qcc.

> Should I install gmake
> on the mac and recommend its use instead of make ?

Again if you want to use the default Makefiles then gmake is required.

Note that the default 'make' is often 'gmake'. To check do:

% make --version
GNU Make 4.1
...

so that you should not need to 'reinstall it'.

> - when I install flex using MacPorts it replaces the original flex of
> MacOSX and an error unsues:
>
> *lex.yy.c:1935:12: **error: **static declaration of 'yyget_leng' follows
> non-static declaration*
>
> I then needed to uninstall flex ! I had the same problem two years ago.

Well, tell the MacPorts guys, not me... :) But why do you reinstall flex
(with a broken one) if you already have it?!

> - gmake seems to make no difference

See above.

> - gawk seems to make no difference but it is too soon to tell

also do:

% awk --version
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2)

cheers,

Stephane

Stephane Popinet

unread,
Mar 31, 2021, 11:46:04 AM3/31/21
to basil...@googlegroups.com
> In addition to uninstalling flex I had to obliterate the basilisk
> directory and download (get) it again using darcs.
> Saying this if anyone has the same problem.

You should not need to obliterate the basilisk directory. Just doing

rm lex.yy.c

will force the makefile to regenerate it using the (non-broken) flex.

cheers,

Stephane

PS: note also that if you use the tarball install, rather than darcs,
you should not need flex at all (the tarball already includes lex.yy.c)

Stephane Popinet

unread,
Apr 1, 2021, 5:37:16 AM4/1/21
to Stephane Zaleski, basilisk-fr
> - Allof the commands discussed above are installed by default on
> macosx and are gnu except lex/flex

OK, sounds good.

> - Do you use sed in basilisk installation / operation ? There are
> (important??) differences between gnu/linux and macosx sed, the
> macosx sed is based on FreeBSD:

Yes, sed is used in Makefile recipes. If the sed scripts of Basilisk do
not work with a POSIX sed, then the scripts in Basilisk need to be fixed
(not sed) i.e. Basilisk should aim to be POSIX compliant for
portability. Otherwise this can be considered a bug in Basilisk.

cheers,

Stephane

"Pierre-Yves Lagrée (PYL)"

unread,
Apr 4, 2022, 12:36:40 PM4/4/22
to Twan Heijink, basilisk-fr

Dear all

My experience (of course I forgot to read Arthur’s mail, my mistake!):

So I started from scratch an installation on a M1 arm on macOS 12.3.1 with "brew" 
I installed just like on the install page http://basilisk.fr/src/INSTALL
changing the "sudo apt install" by "brew Install" for all the packages

this was OK to install qcc itself.

to compile the examples : 
I have to add: 
brew install md5sha1sum 
brew install pandoc

and set the proper path to python.

and more important, I had to change the default CFLAGS in config file (which is used by Makefile).
 As pointed by Arthur there is a problem with "x86_64", I just added "-target  x86_64-apple-darwin "  in the file "config" 
# other useful (non-standard) flags
CFLAGS += -g -Wall -pipe  -target  x86_64-apple-darwin 



my next move: installing bview….


cheers 
  





----> ----> ----> ----> ----> ----> ----> ----> 
--->  ---> Pierre-Yves Lagrée (PYL) ----> ---->
//////////////////////////////////////////////

Reply all
Reply to author
Forward
0 new messages