Problem with installation

57 views
Skip to first unread message

Alessandro

unread,
Nov 3, 2025, 5:58:10 AMNov 3
to dislin-users

Hello, I am moving my code to a new machine (from SUSE-SLES12 to Debian 13).
In the original version I was using gfortran-8, on the new machine I have gfortran-14.
The version of Dislin I'm using is 11.2.
If I remember correctly, after installation of dislin I should go under $DISLIN/gf, compile dislin.f90 (using gfortran-14) and generate the corresponding library libdislin.a, which should go under $DISLIN. Is this correct? Thanks.

A.V.

Helmut Michels

unread,
Nov 3, 2025, 8:43:47 AMNov 3
to dislin-users
Hi Alessandro,

I have tested the latest Dislin distribution 11.5 with Debian 13.1 and gcc/gfortran 14.2. It should work fine.
Yes, you have to compile the file dislin.f90 in the directory $DISLIN/gf with the command  
gfortran -c dislin.f90. After that you can compile and link Dislin programs with

gfortran -c -I$DISLIN/gf    xxx.f90              ! for compiling
gfortran -o xxx xxx.o -L$DISLIN -ldislin     ! for linking

With best regards,

Helmut

Alessandro

unread,
Nov 3, 2025, 9:10:43 AMNov 3
to dislin-users

Hello Helmut, when I execute my makefile I get a number of errors of this kind from the link step (just copying the first 5 of them):

/usr/bin/ld: /home/picplus/PIC3D/LIBRARIES/libpthread.so.0: undefined reference to `__libc_dlclose@GLIBC_PRIVATE'
/usr/bin/ld: /home/picplus/PIC3D/LIBRARIES/libpthread.so.0: undefined reference to `__libc_current_sigrtmax_private@GLIBC_PRIVATE'
/usr/bin/ld: /home/picplus/PIC3D/LIBRARIES/libpthread.so.0: undefined reference to `_dl_make_stack_executable@GLIBC_PRIVATE'
/usr/bin/ld: /home/picplus/PIC3D/LIBRARIES/libpthread.so.0: undefined reference to `__libc_thread_freeres@GLIBC_PRIVATE'
/usr/bin/ld: /home/picplus/PIC3D/LIBRARIES/libpthread.so.0: undefined reference to `__libc_pthread_init@GLIBC_PRIVATE'

Please note that I am trying to link dislin using  -L$DISLIN -ldislin, while I am using static linking for the following graphics libraries:
 
   libXm.so.4
   libXt.so.6
   libX11.so.6
   libGL.so.1

Actually I also would like to use static linking for dislin which is what I had on the old machine (I attach my makefile, in case it can be clearer...).
Thanks.

A.
MakePic

Helmut Michels

unread,
Nov 3, 2025, 9:52:18 AMNov 3
to dislin-users
Dear Alessandro,

static linking with the Dislin library libdislin.a is working  on Debian 13 with the command

 gfortran -o xxx xxx.o  $DISLIN/libdislin.a -lX11 -lXt -lXm -lGL

It looks like that the error messages are caused by the library libpthread.so.0, not by Dislin.
Are you using your own version of libpthread.so.0?

With best regards,

Helmut

Alessandro

unread,
Nov 3, 2025, 10:39:37 AMNov 3
to dislin-users

Ok, I think I have fixed the problem with libpthread.

The error which I get now is: 
libdislin.a(texmod_.o): relocation R_X866_64_32 against  `.text' can not be used when making a PIE object; recompile with -fPIE

Does this mean that under  $DISLIN/gf I should compile dislin.f90 with this option? If I do so, and then create the .a library using:
ar rcs libdislin.a dislin.o

I get a libdislin.a file of size 940, while the one under $DISLIN has a size of 4231828....

Helmut Michels

unread,
Nov 3, 2025, 11:19:18 AMNov 3
to dislin-users
Hi Alessandro,

the file dislin.f90 has nothing to do with the Dislin library libdislin.a. dislin.f90 contains just the
definitions of all Dislin routines and functions how they must be called in Fortran 90 programs.
It helps the compiler to detect errors during the compilation process
libdislin.a and libdislin.so contain the compiled Dislin source code.

Does the error also appear with the current version 11.5 of Dislin? Since version 11.3.3 of Dislin
the static libraries of Dislin are also created with the compiler option -fPIC for creating  
position-independent code.

With best regards,

Helmut

Alessandro

unread,
Nov 4, 2025, 3:14:40 AMNov 4
to dislin-users

Hello Helmut, I installed latest version of Dislin, and now the code compiles with no errors. Thank you.
However, I have an error now when I launch the code:
 
XmGetDefaultDisplay cannot be used prior to Vendors.Initialize, returns NULL
Error: Couldn't find per display information

This should not be related with Dislin, but maybe with the fact that I'm working on a remote virtual machine and I need 
X11 to redirect output on my screen...

A.

Helmut Michels

unread,
Nov 4, 2025, 9:55:11 AMNov 4
to dislin-users
Hi,

I haven't had this error message until yet. Do you get the same error message if you start another
X11 application on the Debian system, for example xclock? What kind of operating system has the
machine from which you connect to Debian? Is it a macOS system? 

With best regards,

Helmut

Alessandro

unread,
Nov 4, 2025, 10:12:32 AMNov 4
to dislin-users

xclock works fine... :-)
My pc has windows enterprise v11, and I connect to the Debian (virtual) machine using remote desktop.

Helmut Michels

unread,
Nov 5, 2025, 6:24:14 AMNov 5
to dislin-users
Hi Alessandro,

I could now reproduce the XmGetDefaultDisplay  error for static linking on my Debian system. I think 
that the problem is caused by a bad sequence of link libraries. You should first link the Dislin library
to your program, and then the libXm, libXt and libX11 libraries. 

The following link command was working for me:

gfortran -o map_f90 map_f90.o  $DISLIN/libdislin.a -lXm -lXt -lX11 -lGL

The command

gfortran -o map_f90 map_f90.o  $DISLIN/libdislin.a  -lX11 -lXt -lXm -lGL
   
produces the  error message above at runtime. 

With best regards,

Helmut

Alessandro

unread,
Nov 5, 2025, 9:22:43 AMNov 5
to dislin-users
Hello Helmut, you got it, it works fine if I link the libraries in the right order. 
Thank you very much for your support, you are always very helpful!
As I originally developed the code using Dislin 11.2 and now I switched to 11.5, can I expect full compatibility or there's a possibility of a different behaviour of some of the calls?

A.

Alessandro

unread,
Nov 6, 2025, 3:00:58 AMNov 6
to dislin-users
On the new machine text appears with a worse resolution (as if the font is not defined), below you can see screenshots showing the difference. In the code the font is set with the following call:

CALL SWGFNT('-adobe-courier-bold-r-normal-*-14-*-*-*-*-*-*-*',10)

Where does Dislin look for fonts? I see there's a directory fonts under $DISLIN/, which only contains complx, helve and simplx (in bdf format). Should I change the argument in the call to  SWGFNT?

This is what I get in the original machine:

GUI_before.png

And this is what I get with the new machine:

GUI_after.png

Helmut Michels

unread,
Nov 6, 2025, 6:23:21 AMNov 6
to dislin-users
Hi Alessandro,

good to hear that the XmGetDefaultDisplay problem is solved. The current Dislin version 11.5 should
be compatible to older versions of Dislin. This is one of my preferred destinations.  The routine swgfnt
loads an X11 system font, which is normally stored in the directory /usr/share/fonts/X11. It has nothing
to do with the Dislin fonts which are only used for graphical output. The program xfontsel is a good tool
to see which X11 font  is available on your system. What about the statement

CALL SWGFNT('-*-courier-bold-r-normal-*-17-*-*-*-*-*-*-*',10)

Does it give a better result?

With best regards,

Helmut

Alessandro

unread,
Nov 6, 2025, 6:38:53 AMNov 6
to dislin-users
Ok, sure, now I remember that back in the days I used xfontsel to look for XLFD fonts coding to use in the SWGFNT calls. So I'll play a bit with that.
Thank you!

Alessandro

unread,
Nov 10, 2025, 5:11:40 AMNov 10
to dislin-users

Hello... It happens with some of the windows of my GUI that when I close it (using the OK button created with WGOK) the code crashes with the following error message:

X Error of failed request:  BadPixmap (invalid Pixmap parameter)
  Major opcode of failed request:  54 (X_FreePixmap)
  Resource id in failed request:  0x1000134
  Serial number of failed request:  21010
  Current serial number in output stream:  21010


Do you have any hint about what could be the problem?
In particular I have noted that when I open a particular GUI window (say win_1) and then press OK it is closed correctly; but if from win_1 I access to another GUI windows and then close it, at that point when I try to close win_1 I get the error above. Hope I have been clear...





Alessandro

unread,
Nov 10, 2025, 5:51:31 AMNov 10
to dislin-users

One step forward: what described in my previous post happens when the window that I open from win_1 (say win_2) displays a gif picture. In this case,  I can close win_2, but when I then close win_1 I get the error.
I use the following code to display a picture:

   allocate (iray(imgdim))
   allocate (cray(2*imgdim))
   picture(1:) = trim(path)//'/img/sigma.gif'
   call LDIMG(trim(picture),iray,imgdim,-1,N)
   cray = transfer(iray,cray)
   call SWGPOS(160,SEP*iw+10)
   call SWGSIZ(imgw+6,imgh+6)
   call WGIMG(ipmat,' ',cray,imgw,imgh,id_pic1)
   deallocate (iray)
   deallocate (cray)

If I comment this lines I do not get the error.

Helmut Michels

unread,
Nov 10, 2025, 11:23:30 AMNov 10
to dislin-users
Hi Alessandro,

I will make some tests and try to reproduce the problem. If you have a short code that shows
the error, it would be helpful.

With best regards,

Helmut

Alessandro Vicini

unread,
Nov 10, 2025, 11:27:46 AMNov 10
to dislin...@googlegroups.com
I’ll be back to you tomorrow

--
You received this message because you are subscribed to a topic in the Google Groups "dislin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dislin-users/vgeW5NrjDrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dislin-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dislin-users/ede2226a-f938-44d5-9427-1a43b7202a52n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages