Problem of compilation with view.h since the last apt update

2,368 views
Skip to first unread message

Quentin Magdelaine

unread,
Jul 8, 2019, 11:31:32 AM7/8/19
to basilisk-fr
Hi all,

When I try to compile with the standard Basilisk Makefile (1) any code (2) including view.h, I receive this error:

qcc -autolink -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test/test test.c -lm
/usr/bin/ld: /home/quentinm/basilisk/src/gl/libglutils.a(utils.o): undefined reference to symbol 'glLightfv'
//usr/lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [test.s] Error 1

The error happens on the three Ubuntu (18.04 LTS) computers that I have, the message varies only slightly.
It happens since the last apt update I have done (which I have done simultaneously on the three computers).
Doing "make clean" and "make" in src/ and src/gl/ does not solve the problem. 

Has anyone encountered the same problem?
Any help is welcomed!
Cheers,
Quentin


(1) this Makefile:

CFLAGS += -O2


include $
(BASILISK)/Makefile.defs


(2) for example this code :

#include "saint-venant.h"
#include "view.h"


int main() {
 init_grid
(32);
 run
();
}

Michael Kreitmeir

unread,
Jul 8, 2019, 3:09:58 PM7/8/19
to basilisk-fr
Hi Quentin,

I can confirm your issue with the update (also Ubuntu 18.04):
qcc -autolink -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o sphereTest/sphereTest sphereTest.c  -lm
/usr/bin/ld: [...]/basilisk/src/gl/libglutils.a(gl2ps.o): undefined reference to symbol 'glGetFloatv'

//usr/lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2
: error: ld returned 1 exit
status
make
: *** [sphereTest.s] Error 1

using the same Makefile and the same code. Unfortunatly, I don't have a solution either. Would also be happy for any help!

Best regards,
Michael

Nelson Joubert

unread,
Jul 9, 2019, 10:15:41 AM7/9/19
to basilisk-fr
Hello,

I had the same problem on my laptop. I found a quick fix to this by using the graphics-acceleration hardware instead of off-screen rendering. After compilation and change in the config file, bview-servers can now be compile.
I tested it with src/test/view.c, inline and offline in 2D and 3D are working

Cheers

Nelson

Michael Kreitmeir

unread,
Jul 9, 2019, 1:36:35 PM7/9/19
to basilisk-fr
Hi Nelson,

this worked for me! Thank you very much!

Best regards,
Michael

Michael Negus

unread,
Jul 10, 2019, 8:23:23 AM7/10/19
to basilisk-fr
Hi Nelson,

I'm getting the same error as Michael posted above. Could you please perhaps elaborate a little more on what you mean by "using the graphics-acceleration hardware" and what to change in the config file to achieve this?

Thank you very much,
Michael

richard...@163.com

unread,
Jul 10, 2019, 9:27:25 AM7/10/19
to basilisk-fr
Hi Michael,
I encountered similar problem before. Now I have fixed it. 
I think you can look at the instruction in http://basilisk.fr/src/gl/INSTALL and follow the instructions in "Using graphics-acceleration hardware". 
Then you can run test with : qcc -autolink -O2 -Wall -o $NAME $NAME.c -L$BASILISK/gl -lfb_glx -lGLU -lGLEW -lGL -lX11 -lm
Also, as suggested by Popinet, make $NAME.tst may help.
As I am new to Basilisk, my answer may be not very correct.

good luck,


Richard LIU 


在 2019年7月10日星期三 UTC+8下午8:23:23,Michael Negus写道:

Quentin Magdelaine

unread,
Jul 11, 2019, 9:43:37 AM7/11/19
to basilisk-fr

Thanks Nelson for your answer!

I had the same problem on my laptop. I found a quick fix to this by using the graphics-acceleration hardware instead of off-screen rendering. After compilation and change in the config file, bview-servers can now be compile.
I tested it with src/test/view.c, inline and offline in 2D and 3D are working

It worked for me too.
To complete the answer of Richard Liu, to use Makefile, it is necessary to modify the config file in basilisk/src/,
by commenting the line which calls OSmesa
# OPENGLIBS = -lfb_osmesa -lGLU -lOSMesa
and by uncommenting the line which calls GLX :
OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL -lX11
as explained in the installation tutorial of the bview-server, even if the off-line visualization is not used.

Cheers,
Quentin

Quentin Magdelaine

unread,
Jul 12, 2019, 5:08:53 AM7/12/19
to basilisk-fr
Hi,

I am sorry to bother everyone again. The problem is still not completely solved on my side.
It works directly on my computer but not through ssh because of the X11 forwarding (which I don't need).
It compiles but crashes immediately.

Why the use of graphics-acceleration hardware (with lfb_glx) is associated to X11 forwarding?
In the installation tutorial of the bview-server, the line using GLX also calls X11, whereas the line using OSmeso doesn't.
Is it possible to use GLX without X11 forwarding?

I tried to do it, using this line in the config file :

OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL
but the code does not compile anymore, because it needs the X11 library.

I copy here the detail of the errors I received:

Using this line in the config file:

OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL -lX11
--------------------------------------------------------------------------------
Unable to open a connection to the X server.
DISPLAY=
Unable to open a connection to the X server.
DISPLAY=
OffscreenContextGLX.c:237:error: [Thread debugging using libthread_db enabled]
OffscreenContextGLX.c:237:error: Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
OffscreenContextGLX.c:237:error: Program received signal SIGSEGV, Segmentation fault.
/home/quentinm/basilisk/src/Makefile.defs:45: recipe for target 'fall_video_simple.tst' failed
make: *** [fall_video_simple.tst] Error 1
--------------------------------------------------------------------------------

Using this line in the config file:
OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL
--------------------------------------------------------------------------------
/usr/bin/ld: /home/quentinm/basilisk/src/gl/libfb_glx.a(OffscreenContextGLX.o): undefined reference to symbol 'XGetErrorText'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status
make: *** [fall_video_simple.s] Error 1
/home/quentinm/basilisk/src/Makefile.defs:59: recipe for target 'fall_video_simple.s' failed
make: *** [fall_video_simple.s] Error 1
--------------------------------------------------------------------------------

Thanks everyone for your help,
Cheers,
Quentin

Quentin Magdelaine

unread,
Jul 18, 2019, 5:45:13 AM7/18/19
to basilisk-fr
Hi,

Some updates on this problem concerning the use of hardware acceleration libraries through a SSH connection. 
If I launch the SSH connection with the X forwarding, the code still crashes but the error message changes:
----------------------------------------------------------------------------------------
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 37
Current serial number in output stream: 36
----------------------------------------------------------------------------------------

The same code runs without any problem if I launch it directly on the computer (not through SSH).
The X-forwarding works for simple tasks (as opening gedit), but the GLX test case
LIBGL_DEBUG=verbose glxgears 
sends a similar error:
----------------------------------------------------------------------------------------
libGL: screen 0 does not appear to be DRI2 capable
libGL: Can't open configuration file /home/quentinm/.drirc: No such file or directory.
libGL: Can't open configuration file /home/quentinm/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  39
  Current serial number in output stream:  38
----------------------------------------------------------------------------------------

My problem goes beyond Basilisk, but if someone has any clue, I would be grateful.

I go back to the initial problem, more linked to Basilisk. To sum-up:
1. Since the last update of OSmesa on Ubuntu 18, including view.h makes the compilation fail.
2. A solution is to use graphics-acceleration hardware (with lfb_glx), and it works like a charm if the code is launched directly on the computer.
3. Trough SSH, the compilation is successful but, on my computers, the simulation crashes (with the message above).

This makes me ask two questions:
1. Is there another solution, to continue to use OSmesa?
2. Is there a way to use graphics-acceleration hardware without X forwarding? They seem to be two very different things, right?

Thank everyone again,
Kind regard,
Quentin

Alexis Berny

unread,
Jul 18, 2019, 8:09:06 AM7/18/19
to basilisk-fr
Hi Quentin,

I do have the same kind of error message in X forwarding for another application. I want to use meshlab to display some STL made by basilisk. It works fine on my laptop, it is fine as well on the distant computer when I'm physically connected to it. However, when doing X forwarding it doesn't work. I have the same error message:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error: GLXBadContext 170
  Extension:    155 (Uknown extension)
  Minor opcode: 6 (Unknown request)
  Resource id:  0x8000004
X Error: BadValue (integer parameter out of range for operation) 2
  Extension:    155 (Uknown extension)
  Minor opcode: 3 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 170
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x8000004
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
QGLContext::makeCurrent(): Failed.
X Error: GLXBadContext 170
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x8000004
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
QGLContext::makeCurrent(): Failed.
meshlab: glarea.cpp :168 : virtual void GLArea::initializeGL():  l'assertion « 0 » a échoué.
Abandon

For bview, I'm using OSMesa on the distant computer, and it works fine locally and via X-Forwarding. The IT from my lab explain me that this problem lies in a missmatch of GL library between the host (the distant server) and the client (your computer). However, I'm not good enough to give you more information.

Wojciech Aniszewski

unread,
Jul 18, 2019, 8:40:10 AM7/18/19
to Alexis Berny, basilisk-fr
Hello there.
This entire thread is very amusing. I mostly enjoy two elements:

1. This line from Alexis:
"it is fine as well on the distant computer when I'm physically connected to it."

I gotta say this really stretched my imagination.

2. The fact that actually the original problem of the thread has never been solved.

All the talk of the Makefiles, configuration files, remote connections (and Ubuntu upgrades) actually helps bury the problem of ln not finding the correct libraries for linking.
It all comes down to the question whether this (for a person using X11/GLX a.k.a. graphics hardware):

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -lglutils -lfb_glx -lGLU -lGLEW -lGL -lX11

or this (for OSMesa):

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -lfb_osmesa -lGLU -lOSMesa

works.
As of now, I've only seen (in the opening post of Quentin) a line:

qcc -autolink -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test/test test.c -lm

which is guaranteed to fail as it doesn't provide any links to any GL. So it failed, no surprise.
best
w
> --
> 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 post to this group, send email to basil...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/1460f0d9-c7f8-4cad-b1bd-c56475c457f7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
/^..^\ Wojciech (Wojtek) ANISZEWSKI
( (••) ) ► Post-doctoral Researcher
(|)_._(|)~ [Fr: vôitek anichévsky] ► Sorbonne University
GPG key [Eng: voyteck aanishevsky] ► Institut ∂'Alembert
ID:AC66485E https://orcid.org/0000-0002-4248-1194
signature.asc

Quentin Magdelaine

unread,
Jul 18, 2019, 10:30:49 AM7/18/19
to basilisk-fr
Hi Wojciech,

Thank you to refocus the discussion on the initial problem.

The line you cite from my opening post:


qcc -autolink -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test/test test.c -lm


is generated by the Makefile, and I really think it links to GL (thanks to -autolink as far as I understand).
I had tried direct compilations (without Makefile), but I got similar results so I have only reported here the results corresponding to the way I was the most familiar with (with Makefiles).

With the compilation line you propose for OSMesa user:


qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -lfb_osmesa -lGLU -lOSMesa
 
the compilation fails on my computer, because it doesn't find lfb_osmesa:

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -lfb_osmesa -lGLU -lOSMesa
/usr/bin/ld: cannot find -lfb_osmesa

collect2: error: ld returned 1 exit status


As far as I understand, this is because libfb_osmesa is not with the other libraries, but in $BASILISK/gl/.
Does it work on your computer?
I tried to indicate to the compiler where is this library adding -L/$BASILISK/gl/:

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -L/$BASILISK/gl/ -lfb_osmesa -lGLU -lOSMesa

and I receive this error:

/usr/bin/ld: /tmp/ccLi75Gc.o: undefined reference to symbol 'glNormal3d'
//usr/lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

which is quite the same as with the Makefile.

Conclusion: I think we link to GL libraries, but something would be broken between them.
Since the problem began with the last update of OSMesa, I tried to downgrade libosmesa6-dev to the previous version but without success (it caused dependency problems with other packages.)

Cheers,
Quentin

Wojciech Aniszewski

unread,
Jul 18, 2019, 10:45:21 AM7/18/19
to Quentin Magdelaine, basilisk-fr
Ok thanks.
What's your specific version of OSmesa before and after the upgrade?
w
> --
> 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 post to this group, send email to basil...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/b903a12c-47b9-471b-8ab2-9cc8241549b9%40googlegroups.com.
signature.asc

Quentin Magdelaine

unread,
Jul 18, 2019, 12:21:54 PM7/18/19
to basilisk-fr
For libosmesa6-dev, I had the version 18.2.8-0ubuntu0~18.04.2 and get the 19.0.2-1ubuntu1.1~18.04.1.
Other "mesa" packages has been upgraded during the same update and all of them has been upgraded from 18.2.8-0ubuntu0~18.04.2 to 19.0.2-1ubuntu1.1~18.04.1.

Quentin
> To unsubscribe from this group and stop receiving emails from it, send an email to basil...@googlegroups.com.

Wojciech Aniszewski

unread,
Jul 18, 2019, 12:22:28 PM7/18/19
to Quentin Magdelaine, basilisk-fr
I should have mentioned this can be quickly checked in Debian derivatives via (examples from my laptop):


,----
| $ dpkg --get-selections |grep -i libosmesa6-dev
|
| libosmesa6-dev:amd64 install
|
| $ apt -s install libosmesa6-dev
| NOTE: This is only a simulation!
| apt needs root privileges for real execution.
| Keep also in mind that locking is deactivated,
| so don't depend on the relevance to the real current situation!
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| libosmesa6-dev is already the newest version (18.3.6-2).
| 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
`----


best
w
> To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/20190718144514.GA31880%40orion.
signature.asc

Wojciech Aniszewski

unread,
Jul 19, 2019, 7:57:47 AM7/19/19
to Quentin Magdelaine, basilisk-fr
OK thank you. Before plunging into what's changed between 18.04 and 19.02,
could you please do one more thing. Using one of your Ubuntu machines, could
you attempt compilation of test.c, but this time, use explicit flags for osmesa,
similar to what I put in my previous email.

I know this is generally a solution inferior to the Makefiles of SP, but i cannot
reproduce your error. If you conveyed link flags to qcc explicitly, I could be sure
they fail (and moreover, which one)

best
w
> > an email to basil...@googlegroups.com <javascript:>.
> > > To post to this group, send email to basil...@googlegroups.com
> > <javascript:>.
> > > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/basilisk-fr/b903a12c-47b9-471b-8ab2-9cc8241549b9%40googlegroups.com.
> >
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > /^..^\ Wojciech (Wojtek) ANISZEWSKI
> > ( (••) ) ► Post-doctoral Researcher
> >
> > (|)_._(|)~ [Fr: vôitek anichévsky] ► Sorbonne University
> > GPG key [Eng: voyteck aanishevsky] ► Institut ∂'Alembert
> > ID:AC66485E https://orcid.org/0000-0002-4248-1194
> >
>
> --
> 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 post to this group, send email to basil...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/basilisk-fr/7c11c9e1-8bc4-4d68-9f2c-482418c2a04e%40googlegroups.com.
signature.asc

Quentin Magdelaine

unread,
Jul 19, 2019, 8:47:39 AM7/19/19
to basilisk-fr
Before plunging into what's changed between 18.04 and 19.02,
could you please do one more thing. Using one of your Ubuntu machines, could
you attempt compilation of test.c, but this time, use explicit flags for osmesa,
similar to what I put in my previous email.

I think it is what I have reported two messages before, I sum-up it here.

Trying:

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -lfb_osmesa -lGLU -lOSMesa
I got:

/usr/bin/ld: cannot find -lfb_osmesa
collect2
: error: ld returned 1 exit status

Adding -L/$BASILISK/gl/ :

qcc -O2 -g -Wall -pipe -D_FORTIFY_SOURCE=2 -o test test.c -lm -L/$BASILISK/gl/ -lfb_osmesa -lGLU -lOSMesa
I got:

/usr/bin/ld: /tmp/ccLi75Gc.o: undefined reference to symbol 'glNormal3d'
//usr/lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2
: error: ld returned 1 exit status

Thanks for looking into this problem!
And do not hesitate to ask me to do other tests.
Quentin

Antoon van Hooft

unread,
Jul 23, 2019, 3:07:33 AM7/23/19
to basilisk-fr
Hallo,

you can use an older version in stand-alone mode


This has fixed the issue for me.

Antoon

Antoon van Hooft

unread,
Jul 23, 2019, 3:08:48 AM7/23/19
to basilisk-fr

Quentin Magdelaine

unread,
Jul 23, 2019, 1:30:22 PM7/23/19
to basilisk-fr
Hi Antoon,

Thanks for your help!

The installation of osmesa seems to go fine.

For glu, the options for the configuration step are not specified in the tutorial
and I am quite a newbie in installing the library from sources.
I tried : ./configure --prefix=/home/[username]/local.
"make" and "make install" seemed to work.

But then when I compile the libraries in basilisk/src/gl with : make libglutils.a libfb_osmesa.a,
I receive this error:
-------------------------------------------------------------
> make libglutils.a libfb_osmesa.a
cc -g -Wall -pipe -D_FORTIFY_SOURCE=2 -O2   -c -o trackball.o trackball.c
cc -g -Wall -pipe -D_FORTIFY_SOURCE=2 -O2 -Igl2ps -c gl2ps/gl2ps.c -o gl2ps.o
cc -g -Wall -pipe -D_FORTIFY_SOURCE=2 -O2   -c -o utils.o utils.c
In file included from utils.c:5:0:
utils.h:6:12: fatal error: GL/glu.h: No such file or directory
 #  include <GL/glu.h>
            ^~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'utils.o' failed
make: *** [utils.o] Error 1
-------------------------------------------------------------

I suppose the error comes from my installation of glu and the configuration options I have chosen,
but I may be wrong. Do you know which options I should write?

Thank you again for your help!
Quentin 

Antoon van Hooft

unread,
Jul 24, 2019, 10:00:47 AM7/24/19
to basilisk-fr
Hallo Quintin,

The original issue was only with the system-maintained OSMesa
library. As such, only that needs to be rebuild and relinked, not
GLU.

You could try and use the package manager again for libglu1-mesa-dev?

Antoon







Quentin Magdelaine

unread,
Jul 25, 2019, 8:53:38 AM7/25/19
to basilisk-fr
Hi Antoon,

You could try and use the package manager again for libglu1-mesa-dev?

Yes, thanks!

I can now compile fb_osmesa in src/gl/, the bview-servers and any code using view.h.
But view.h creates black images or videos, for example with the test case "view.c".

To compile, I needed to specify the links toward both the osmesa library
and the header file in the config file of basilisk/src/ and in fb_osmesa.c.
----------------------------------------------------------------------------------------------
config file in basilisk/src/:

OPENGLIBS = -L/home/[username]/local/lib -lfb_osmesa -lGLU -lOSMesa

fb_osmesa.c in basilisk/src/gl/:

#include <./../../home/[username]/local/include/GL/osmesa.h>
----------------------------------------------------------------------------------------------
At first, it looked like a messy but working way to force the links.
But the error could come from there.
What is the right way to fix the paths of the library and the header file?

I tried on two different computers, with two different versions of OSmesa and get the same result.

Thanks again for your help,
Quentin 

Antoon van Hooft

unread,
Jul 25, 2019, 10:16:08 AM7/25/19
to basilisk-fr
Hallo Quintin,

Did you manage to get a working executable before automating the steps via config/Makefile/?

If not, Lets do that first, I did:

$ qcc test.c -lm -L/home/antoon/mesa/lib/ -L$BASILISK/gl/ -lOSMesa -lglutils -lfb_osmesa -lGLU
$ ldd a.out | grep OSMesa
 libOSMesa.so.8 => /home/antoon/local/lib/libOSMesa.so.8 (0x00007f8caf0a7000)

Notice that you also should set your LD_LIBRARY_PATH correspondingly:


Antoon

Quentin Magdelaine

unread,
Jul 25, 2019, 1:04:37 PM7/25/19
to basilisk-fr

Notice that you also should set your LD_LIBRARY_PATH correspondingly:


Thanks again! This time it works.

I sum up here the steps for the others which have the problem.
-----------------------------------------------------------------
Instructions.
First, remove the new OSmesa library which does not work:

sudo apt remove libosmesa6-dev

Then download an older version:
wget mesa3d.org/archive/mesa-18.2.8.tar.gz

Then decompress it (change [username] for yours):
tar xzvf mesa-18.2.8.tar.gz
cd mesa
-18.2.8
./configure --prefix=/home/[username]/local --enable-osmesa \
           
--with-gallium-drivers=swrast                \
           
--disable-driglx-direct --disable-dri --disable-gbm --disable-egl

If it doesn't find zlib, install zlib1g-dev with:
 
sudo apt install zlib1g-dev

and try again.

Compile the library:
make

(This step is quite long.) And install it:
make install

The library is not installed in the standard path (/usr/lib/), so you need to tell gcc and basilisk about it.
First, enter in your terminal:
export LD_LIBRARY_PATH=/home/[username]/local/lib:$LD_LIBRARY_PATH

and, to not have to do it again as soon as you open a new terminal:
echo "export LD_LIBRARY_PATH=/home/[username]/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc

Then in the config file in basilisk/src/, change the line
OPENGLIBS = -lfb_osmesa -lGLU -lOSMesa
for
OPENGLIBS = -L/home/[username]/local/lib -lfb_osmesa -lGLU -lOSMesa

And in fb_osmesa.c in basilisk/src/gl/, change the line
#include <GL/osmesa.h>
for
#include <./../../home/[username]/local/include/GL/osmesa.h>

You can now compile the libraries provided by basilisk in basilisk/src/gl:
make libglutils.a libfb_osmesa.a

and the bview-servers in basilisk/src/:
make bview-servers

You should be able to compile and run successfully all your codes.

If you do not use makefiles, you have to add -L/home/[username]/local/lib/
and -L$BASILISK/gl/ in the compilation line:
qcc test.c -lm -L/home/[username]/local/lib/ -L$BASILISK/gl/ -lOSMesa -lglutils -lfb_osmesa -lGLU
-----------------------------------------------------------------

Thousand thanks to Antoon for the solution and the support!

Cheers,
Quentin 

koorosh kazemi

unread,
Sep 9, 2019, 4:26:41 AM9/9/19
to basilisk-fr
Hallo Quintin

I have a problem with bview. It worked on my computer but suddenly, it is not working any more. When I use it, I get such an error:


line 158: 16113 Floating point exception(core dumped) bview-server$dimension $args < $fifo
     16117 Terminated              | python2.7 $BASILISK/bview-client.py > $fifo


I removed basilisk and bview and re install them. But when I do the following line:

./configure --prefix=/home/[username]/local --enable-osmesa \
           
--with-gallium-drivers=swrast                \
           
--disable-driglx-direct --disable-dri --disable-gbm --disable-egl

I get such an error:

configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables ZLIB_CFLAGS
and ZLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I use a new version of pkg-config and this error has been solved. However, when I used make and then, make install, the following errors occur:


/bin/mkdir: cannot create directory ‘/home/[username]’: Permission denied
Makefile:521: recipe for target 'install-binPROGRAMS' failed
make[2]: *** [install-binPROGRAMS] Error 1
make[2]: Leaving directory '/home/
username/mesa-18.2.8'
Makefile:1012: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/
username/mesa-18.2.8'
Makefile:707: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1


Do you have any suggestion?

Quentin Magdelaine

unread,
Sep 9, 2019, 4:39:32 AM9/9/19
to basilisk-fr
Dear Koorosh,

Reading your error line :

/bin/mkdir: cannot create directory ‘/home/[username]’: Permission denied

It seems you haven't change "[username]" for your own username, as indicated in my previous message :
 
Then decompress it (change [username] for yours):
tar xzvf mesa-18.2.8.tar.gz
cd mesa
-18.2.8
./configure --prefix=/home/[username]/local --enable-osmesa \
           
--with-gallium-drivers=swrast                \
           
--disable-driglx-direct --disable-dri --disable-gbm --disable-egl

It should fix the error. You may have to use a fresh "mesa-18.2.8" folder, by deleting the current one and by starting from this line :
tar xzvf mesa-18.2.8.tar.gz

Cheers,
Quentin

koorosh kazemi

unread,
Sep 9, 2019, 4:48:24 AM9/9/19
to basilisk-fr
Dear Quentin

Thanks for your prompt response.

I just changed in when I wanted put it here. In my PC, I put my username but the error is still alive!!



/bin/mkdir: cannot create directory ‘/home/[koorosh]’: Permission denied

Makefile:521: recipe for target 'install-binPROGRAMS' failed
make[2]: *** [install-binPROGRAMS] Error 1
make[2]: Leaving directory '/home/koorosh/mesa-18.2.8'

Makefile:1012: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/koorosh/mesa-18.2.8'

Makefile:707: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

Regards

Quentin Magdelaine

unread,
Sep 9, 2019, 5:13:37 AM9/9/19
to basilisk-fr
I just changed in when I wanted put it here. In my PC, I put my username but the error is still alive!!

/bin/mkdir: cannot create directory ‘/home/[koorosh]’: Permission denied

Your username without the brackets. Just as here :
 
make[2]: Leaving directory '/home/koorosh/mesa-18.2.8'

Cheers,
Quentin 

koorosh kazemi

unread,
Sep 9, 2019, 6:04:12 AM9/9/19
to basilisk-fr
Many thanks. I am sorry but there is another error:

when I enter  make libglutils.a libfb_osmesa.a, I get:

make: 'libglutils.a' is up to date.
cc -g -Wall -pipe -D_FORTIFY_SOURCE=2 -O2   -c -o fb_osmesa.o fb_osmesa.c
fb_osmesa.c:1:10: fatal error: ./../../home/koorosh/local/include/GL/osmesa.h: No such file or directory
 #include <./../../home/koorosh/local/include/GL/osmesa.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'fb_osmesa.o' failed
make: *** [fb_osmesa.o] Error 1



Best

Quentin Magdelaine

unread,
Sep 9, 2019, 8:57:05 AM9/9/19
to basilisk-fr
fb_osmesa.c:1:10: fatal error: ./../../home/koorosh/local/include/GL/osmesa.h: No such file or directory

Did you check if the file was there ?
If not, can you find where it is ?

For example with
find ~/ -type f -name osmesa.h

or, if it doesn't find anything, with
sudo find ./ -type -f -name osmesa.h

koorosh kazemi

unread,
Sep 9, 2019, 9:01:14 AM9/9/19
to basilisk-fr
I could solve that problem and reinstall the bview. However, when I want to open a damp file, the error is still there.


home/koorosh/basilisk/src/bview3D: line 106: 19130 Floating point exception(core dumped) bview-server$dimension $args < $fifo
     19131 Terminated              | python2.7 $BASILISK/bview-client.py > $fifo

Quentin Magdelaine

unread,
Sep 11, 2019, 9:54:43 AM9/11/19
to basilisk-fr
Hi,


I could solve that problem and reinstall the bview. However, when I want to open a damp file, the error is still there.

home/koorosh/basilisk/src/bview3D: line 106: 19130 Floating point exception(core dumped) bview-server$dimension $args < $fifo
     19131 Terminated              | python2.7 $BASILISK/bview-client.py > $fifo

Does the 2D test case of view run ? http://basilisk.dalembert.upmc.fr/src/test/view.c

koorosh kazemi

unread,
Sep 12, 2019, 3:26:17 AM9/12/19
to basilisk-fr
Hi

Yes, 2D has the same problem:

home/koorosh/basilisk/src/bview2D: line 104:  6638 Terminated              bview-server$dimension $args < $fifo
      6639                       | python2.7 $BASILISK/bview-client.py > $fifo
[1]+  Done                    touch view.bv && emacs view.bv


Best

Mitansh Tripathi

unread,
Feb 3, 2020, 3:26:02 PM2/3/20
to basilisk-fr
Hi Quentin,

I followed the procedure as you summarized but i get the following error when i use "make bview-servers"


Makefile:116: /home/tripatmn/Makefile.defs: No such file or directory
make: *** No rule to make target '/home/tripatmn/Makefile.defs'.  Stop

On Friday, July 12, 2019 at 5:08:53 AM UTC-4, Quentin Magdelaine wrote:
Hi,

I am sorry to bother everyone again. The problem is still not completely solved on my side.
It works directly on my computer but not through ssh because of the X11 forwarding (which I don't need).
It compiles but crashes immediately.

Why the use of graphics-acceleration hardware (with lfb_glx) is associated to X11 forwarding?
In the installation tutorial of the bview-server, the line using GLX also calls X11, whereas the line using OSmeso doesn't.
Is it possible to use GLX without X11 forwarding?

I tried to do it, using this line in the config file :
OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL
but the code does not compile anymore, because it needs the X11 library.

I copy here the detail of the errors I received:

Using this line in the config file:
OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL -lX11
--------------------------------------------------------------------------------
Unable to open a connection to the X server.
DISPLAY=
Unable to open a connection to the X server.
DISPLAY=
OffscreenContextGLX.c:237:error: [Thread debugging using libthread_db enabled]
OffscreenContextGLX.c:237:error: Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
OffscreenContextGLX.c:237:error: Program received signal SIGSEGV, Segmentation fault.
/home/quentinm/basilisk/src/Makefile.defs:45: recipe for target 'fall_video_simple.tst' failed
make: *** [fall_video_simple.tst] Error 1
--------------------------------------------------------------------------------

Using this line in the config file:
OPENGLIBS = -lfb_glx -lGLU -lGLEW -lGL
--------------------------------------------------------------------------------
/usr/bin/ld: /home/quentinm/basilisk/src/gl/libfb_glx.a(OffscreenContextGLX.o): undefined reference to symbol 'XGetErrorText'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status
make: *** [fall_video_simple.s] Error 1
/home/quentinm/basilisk/src/Makefile.defs:59: recipe for target 'fall_video_simple.s' failed
make: *** [fall_video_simple.s] Error 1
--------------------------------------------------------------------------------

Thanks everyone for your help,
Cheers,
Quentin

Quentin Magdelaine

unread,
Feb 4, 2020, 3:04:24 AM2/4/20
to basilisk-fr
Hi Mitansh,


I followed the procedure as you summarized but i get the following error when i use "make bview-servers" 
 
 Makefile:116: /home/tripatmn/Makefile.defs: No such file or directory
make: *** No rule to make target '/home/tripatmn/Makefile.defs'.  Stop

Can you give a little more details?
- What is your OS? which distribution?
- Is it a fresh installation?
- Before following the procedure I propose, had you encountered the initial problem of this thread ?
  (i.e. a compatibility problem with the libGL library)

Cheers,
Quentin

Mitansh Tripathi

unread,
Feb 4, 2020, 10:34:41 PM2/4/20
to basilisk-fr
Hi, sorry about that.

- Im using ubuntu (linux) and I am accessing basilisk via ssh.

- I have run some basic test cases, however I have an issue every time I run the view.h file and cannot get a video output through bview

HUI WANG

unread,
Mar 22, 2020, 6:32:43 AM3/22/20
to basilisk-fr
Hello Quentin,

I have the same problem with view.h, and the code does not run as long as there is view.h.

I followed the instruction you made here to solve this, but i got the warning:

>>hui@hui-Lenovo-ideapad-310S-14IKB:~/basilisk/src$  make bview-servers
>>make: Nothing to be done for 'bview-servers'.

And the problem is still there. Do you have any suggestions about this? 

Thanks
Hui

在 2019年7月25日星期四 UTC+2下午7:04:37,Quentin Magdelaine写道:

Quentin Magdelaine

unread,
Mar 25, 2020, 3:00:46 AM3/25/20
to basilisk-fr
Hi Mitansh and Hui,

I begin with Mitansh:

Hi, sorry about that.
- Im using ubuntu (linux) and I am accessing basilisk via ssh.
- I have run some basic test cases, however I have an issue every time I run the view.h file and cannot get a video output through bview

- Is the problem still there?
- When did the problem appear?
- Is it a new installation of Basilisk?
- Which distribution of ubuntu do you have?

And then Hui:

I have the same problem with view.h, and the code does not run as long as there is view.h.

I followed the instruction you made here to solve this, but i got the warning:

>>hui@hui-Lenovo-ideapad-310S-14IKB:~/basilisk/src$  make bview-servers
>>make: Nothing to be done for 'bview-servers'.

And the problem is still there. Do you have any suggestions about this?

"Nothing to be done done for 'bview-servers'." is not supposed to be a problem.

- What happens if you do: "make clean" before "make bview-servers"?
- Did you get any error message following the instructions?
- When did the problem with view.h appear?
- Is it a new installation of Basilisk?
- Which distribution of linux do you have?

Cheers,
Quentin

HUI WANG

unread,
Mar 31, 2020, 8:56:45 AM3/31/20
to basilisk-fr
Hi Quentin,

It works now, thanks for your instruction here

Hui

在 2020年3月25日星期三 UTC+1上午8:00:46,Quentin Magdelaine写道:
Message has been deleted

sahil akhtar

unread,
May 12, 2021, 3:56:04 AM5/12/21
to basilisk-fr
Day 3 of struggling with view.h
Any help is appreciate.
I got the same error as Quentin and thereafter followed his solution,
Even after all that i am getting this error,
I guess i might be calling the file with a wrong method or something since i  am pretty new to Basilisk.
Any advice on how to run the "view.h" file along with my code.
ERROR:Screenshot from 2021-05-12 13-22-37.png

j.a.v...@gmail.com

unread,
May 12, 2021, 6:26:12 AM5/12/21
to basilisk-fr
Hallo Sahila....

Please read this entry in the FAQ:

The error you show seems to have nothing to do with view.h. A valuable section of the tutorial reads:

So why did we start with such a simple program? Because it is always a good idea to start simple and add complexity step-by-step. If a problem occurs in a single line of code, which you have just added, it is trivial to correct it. If this same line is buried within ten other (correct) lines, finding the problem can take (much) longer. This rule is true whether you are an experienced programmer or a beginner.

A more related tip: Setting up OSMesa from source may not be the most easy starting point (note the discussion above). Why not use the hardware-accelerated libraries? they should work well. 

Antoon
Op woensdag 12 mei 2021 om 09:56:04 UTC+2 schreef sahila...@gmail.com:

sahil akhtar

unread,
May 12, 2021, 7:05:51 AM5/12/21
to basilisk-fr
Thank you j.a.v for the valuable inputs,
I guess i wanted to use view.h so badly that i was bound to make OSmesa work and true it was and is still a pain.
Can you recommend me some hardware accelared libraries that i should dig into.
I'm a 2nd year Bachelor of Technology student and was doing a research on simulation of Faraday's Waves and that's how i came across Basilisk.
Another topic:The code that showed the following error had nothing but a statement to include the view file and a main body to call the run function. 

j.a.v...@gmail.com

unread,
May 12, 2021, 7:25:27 AM5/12/21
to basilisk-fr
Hallo,

> Can you recommend me some hardware accelared libraries that i should dig into.

see the documentation:


> The code that showed the following error had nothing but a statement to include the view file and a main body to call the run function.

This does not sound like a minimal example of this problem: if you remove the "#include view.h" line, I think you get the same error that indicates that the the run() function is not defined.

It is best to try an example or test case if you want to verify your installation

e.g. :

which you can also run in serial.

Antoon
Op woensdag 12 mei 2021 om 13:05:51 UTC+2 schreef sahila...@gmail.com:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages