Installing on windows 10 and gfortran compiler

194 views
Skip to first unread message

Shahid Maqbool

unread,
Aug 3, 2022, 3:03:32 AM8/3/22
to dislin-users

Dear all,

I had worked with the Dislin library for Linux and I have been ever since using it.

Now I want to work on windows 10 using gfortran compiler.

Following the steps on https://www.dislin.de/downloads/win64/README.WIN

I have got this:

unnamed.png

And after step d) I have the following output:

compilation.png

gfortran (without dislin) is working fine. So my question here is:

Is there something missing on the installation or the path? (Actually, I have never done

path inclusion previously for any package so I am not sure if it is done in the right way.)

or linking and compiling is not right?

Thank you for your consideration.

Best regards,

Shahid

Helmut Michels

unread,
Aug 3, 2022, 4:39:03 AM8/3/22
to dislin-users
Hi Shahid,

the only problem seems to be that you are using the command 'gfortran -a' instead of
'f90link -a'. f90link is a Dislin script  for compiling and linking Dislin programs. It is
mentioned in the README file.
You can also use gfortran directly with the commands:

      gfortran -c -Ic:\dislin\gf   exa_f90.f90       for compiling
      gfortran -o exa_f90.exe  exa_f90.o  c:\dislin\dismg.a   -luser32  -lgdi32  -lopengl32

With best regards,

Helmut

Shahid Maqbool

unread,
Aug 3, 2022, 9:14:17 AM8/3/22
to dislin-users
Hi Helmut,

I have tried both ways and got this:

fl.PNG

flink.PNG

Best Regards,
Shahid

Helmut Michels

unread,
Aug 3, 2022, 9:36:05 AM8/3/22
to dislin-users
Hi,

you can take a look at the directory c:\dislin\gf. There should be the file 'dislin.mod'. Your compiler
version of gfortran may be different to the version that I have used to create dislin.mod.
For that case you have to recreate it with the command 'gfortran -c dislin.f90' in the directory
c:\dislin\gf. By the way, the option -lc:\dislin\gf has a capital i at the beginning (for Include), not a
small L.

Perhaps, the directory c:\dislin\win is not included correctly in your PATH environment. You can try
the full path of f90link:

             c:\dislin\win\f90link -a  exa_f90

Shahid Maqbool

unread,
Aug 9, 2022, 12:04:09 PM8/9/22
to dislin-users
Hey,

I tried, but still not working!
Maybe it has to do with the compiler  I installed from this link:
But for other programs(without Dislin), I do not see any error so far!

Best regards
Shahid

Helmut Michels

unread,
Aug 9, 2022, 12:24:57 PM8/9/22
to dislin-users
Hi,

I will check. Which version do you have installed? 10.3.0, 11.3.0 or 12.1.0,
and 32-bit or 64-bit?

With best regards,

Helmut

Shahid Maqbool

unread,
Aug 9, 2022, 12:42:13 PM8/9/22
to dislin...@googlegroups.com
Hi,

11.3.0 and 64-bit.

Best regards
Shahid


--
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/Zc2sY-AQYyc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dislin-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dislin-users/eff339a3-8ec4-4438-bf7a-329e8cdb95bfn%40googlegroups.com.

Helmut Michels

unread,
Aug 9, 2022, 12:52:37 PM8/9/22
to dislin-users
Hi,

for me the gfortran version is working fine with Dislin. Please, make sure that you have installed the 64-bit
distribution of Dislin for Mingw. Here is what I have done:

     -   cd \dislin64\gf
         gfortran -c dislin.f90

     -  cd \dislin64\examples
        gfortran -c -I..\gf    exa_f90.f90
        gfortran  -o exa_f90.exe  exa_f90.o   ..\dismg.a   -luser32   -lgdi32  -lopengl32

     -  exa_f90.exe is created and working fine

Regards,

Helmut 

Carl Kleffner

unread,
Aug 9, 2022, 4:04:58 PM8/9/22
to dislin...@googlegroups.com
Hi,

as there are different versions of mingw-based gfortran versions around. I propose to be more specific which distribution should be used.

There are the msys2 based environments: mingw64 (CRT is msvcrt), mingw32 (CRT is msvcrt) and ucrt64 (CRT is UCRT); for all gcc, gfortran version is 12.0. These distributions are seen by many as the standard distribution of mingw-w64 gcc, gfortran today

There is still the old original mingw32 distribution; there are the tdm; equation, r-tools; winlibs distributions (and more of them) containing 32-bit or 64-bit toolchains. 32-bit toolchains may be based on the original headers and libraries or the one from mingw-w64.

As there are different gcc, gfortran versions in use, the Fortran ABI may be different. Also CRT incompatibilities may play a role (msvcrt, msvcr90, msvcr100, msvcr120, ucrt).

Cheers

Carl

You received this message because you are subscribed to the Google Groups "dislin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dislin-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dislin-users/c40d01a0-42fd-427d-af35-042153b7921fn%40googlegroups.com.

Jerzy Wrobel

unread,
Aug 10, 2022, 4:24:30 AM8/10/22
to dislin...@googlegroups.com
I use Simply Fortran 3 IDE which currently delivers Gnu Fortran 12.1.0.
Unfortunately the IDE is not free, but I am not using command line anymore.
To use dislin, I initially do the following:

1. I create folder, say \dislin11,
2. to this location I copy files dislin.f90 and dislin_d.f90 from
dl_11_mg.zip archive, then I create subfolder \lib,
3. there I copy files dismg.a and dismg_d.a from dl_11_mg distribution,
4. I rename those files to libdismg.a and libdismg_d.a respectively,
5. to selected folder, say \dislin11\examples, I copy file exa_f90.f90,
6. in Simply Fortran IDE I create New Project,
7. in Project Options/Compiler flags I add the line
-ldismg -luser32 -lgdi32 -lopengl32
to the Linker field, which is initially empty,
8. in Project Options/File location I add .\lib at Library Directories tab,
9. in Project Outline I add files dislin.f90 and exa_f90.f90 to the project,
10. then I Save Project and Build (F6) or Launch (F5) it, during building
process, the subfolders \build and \modules are automatically created.

This is of course not the most elegant way, but it works for me. Moreover
You will need only four files (dismg.a, dismg_d.a, dislin.f90 and
dislin_d.f90) from Dislin distribution.

Regards,
Jerzy

> Hi,
>
> 11.3.0 and 64-bit.
>
> Best regards
> Shahid
>
>
> On Wed, 10 Aug 2022 at 01:24, Helmut Michels <mic...@dislin.de> wrote:
>
>> Hi,
>>
>> I will check. Which version do you have installed? 10.3.0, 11.3.0 or
>> 12.1.0,
>> and 32-bit or 64-bit?
>>
>> With best regards,
>>
>> Helmut
>>
>>
>> shah...@gmail.com schrieb am Dienstag, 9. August 2022 um 18:04:09 UTC+2:
>>
>>> Hey,
>>>
>>> I tried, but still not working!
>>> Maybe it has to do with the compiler I installed from this link:
>>> *http://www.equation.com/servlet/equation.cmd?fa=fortran
>>> <http://www.equation.com/servlet/equation.cmd?fa=fortran>*
>>>>>>> And after *step d) *I have the following output:
>>>>>>>
>>>>>>> [image: compilation.png]
>>>>>>>
>>>>>>> gfortran (*without dislin*) is working fine. So my question here
>>>>>>> is:
>>>>>>>
>>>>>>> Is there something missing on the installation or the path?
>>>>>>> *(Actually,
>>>>>>> I have never done*
>>>>>>>
>>>>>>> *path inclusion previously for any package so I am not sure if it
>>>>>>> is
>>>>>>> done in the right way.)*
>>>>>>>
>>>>>>> or linking and compiling is not right?
>>>>>>>
>>>>>>> Thank you for your consideration.
>>>>>>>
>>>>>>> Best regards,
>>>>>>>
>>>>>>> Shahid
>>>>>>>
>>>>>> --
>> 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/Zc2sY-AQYyc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> dislin-users...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/dislin-users/eff339a3-8ec4-4438-bf7a-329e8cdb95bfn%40googlegroups.com
>> <https://groups.google.com/d/msgid/dislin-users/eff339a3-8ec4-4438-bf7a-329e8cdb95bfn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "dislin-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dislin-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dislin-users/CAN2XBSKvokYXLZug4yW-v98FyogMLQa4mX3eDdxtvAh%2Byawf4Q%40mail.gmail.com.
>


Helmut Michels

unread,
Aug 10, 2022, 7:35:59 AM8/10/22
to dislin-users
Hi Carl,

thank you for the detailed explanation. You are right, gfortran distributions that use the newer UCRT runtime library
will not work with Dislin. They will produce linker errors. I think that I will add an additional library to the Dislin
distribution for Mingw that is compatible to UCRT. At the moment, all tdm and equation versions of gfortran, the
winlib distributions for MSVCRT and the included gfortran versions in some IDEs are working with Dislin.
Perhaps, I should write a note to the FAQ.

With best regards,
 
Helmut

Shahid Maqbool

unread,
Aug 10, 2022, 8:39:03 AM8/10/22
to dislin-users
Hey Jerzy,

That looks helpful; i will give it a shot; i do have Simply Fortran too.
I will let you know. Thanks for the detailed steps.

Best regards,
Shahid

Shahid Maqbool

unread,
Aug 10, 2022, 8:46:12 AM8/10/22
to dislin-users
Hi Helmut,

I have done it again from the beginning with these steps:

Setting Environment Variable.PNG

Path.PNG

Environment.PNG

Fatal_error.PNG

gf.PNG
dismg.PNG
mod.PNGdismg.PNGmod.PNG

Undefined reference.PNG

I am trying to figure it out but so far I do not find the reason.

Best regards,
Shahid

Helmut Michels

unread,
Aug 10, 2022, 10:14:02 AM8/10/22
to dislin-users
Dear Shahid,

you have installed the wrong Dislin distribution. It looks like that you have installed the distribution
dl_11_gc.zip, which is the Cygwin port of gcc/gfortran. You need the distribution dl_11_mg.zip (64-bit)
for Mingw64.

With best regards,

Helmut

Shahid Maqbool

unread,
Aug 15, 2022, 3:17:19 AM8/15/22
to dislin-users
Dear Helmut,

I have installed the Mingw64 now. Looks like it is installed correctly:

New_Installation.PNG

The only problem I face now is how to compile, link, and include it for my codes. 
Which command is right to do it? I am using 

gfortran heat.f90 -o heat -L/C/dislin -I/C/dislin/gf -ldislin

new.PNG

Best regards,
Shahid

Helmut Michels

unread,
Aug 15, 2022, 11:51:17 AM8/15/22
to dislin-users
Hi Shahid,

you can compile your own code in the same way as the Dislin example exa_f90.f90.
Either with the Dislin script  f90link:

       f90link -a  heat

or directly with gfortran:

      gfortran heat.f90 -o heat  -Ic:\dislin\gf  c:\dislin\dismg.a -luser32 -lgdi32  -lopengl32

The term 'c:' is only necessary if you have multiple disks and your program is not located
on  the c disk.

With best regards,

Helmut  

Shahid Maqbool

unread,
Aug 16, 2022, 9:53:24 PM8/16/22
to dislin-users
Hi Helmut,

It is working fine now. Just one last thing:

How to compile my code for double precision? Apparently, I can not do it with 
the same commands and I have compiled the dislin file in the real64 directory too.

Best regards,
Shahid

Helmut Michels

unread,
Aug 17, 2022, 8:38:06 AM8/17/22
to dislin-users
Hi Shahid,

since you have already recompiled the file 'dislin.f90' in the real64 subdirectory, you have just to
use the directory \dislin\gf\real64 as include directory for compiling and the Dislin double precision library
dismg_d.a for linking:

    gfortran heat.f90 -o heat  -Ic:\dislin\gf\real64  c:\dislin\dismg_d.a -luser32 -lgdi32  -lopengl32

There is also the option -r8 in the script f90link for compiling and linking with double precision variables.

With best regards,

Helmut

Shahid Maqbool

unread,
Aug 18, 2022, 11:25:28 AM8/18/22
to dislin...@googlegroups.com
Hi Helmut,

It is working fine now. Many thanks!

Best regards,
Shahid

Reply all
Reply to author
Forward
Message has been deleted
0 new messages