Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

DISLIN

JohnNichols
Valued Contributor III
1,124 Views

DISLIN is quick and easy to set up a simple XY plot of some results.  The developer gives us a 64 bit version with Fortran wrappers for the C functions. 

His instructions for MSVS version is less than easy to find, but after some struggling, I got the latest example to work with the latest VS 2022 and the latest oneapi.  I  did not test IFX - yes I did and it compiles and runs.  

However when I mixed it with other Fortran code i.e. PARDISO - it gives me a not found fprintf error message, so then after a bit of looking I needed the legacy..libs,  which I now remember Steve advised for some other code. 

Can I ask why?  

The real problem is the poor developer is doing so many languages his compiler set is behind. Changing the names of the libraries did not help. 

0 Kudos
6 Replies
Andreas_Z_
New Contributor I
1,070 Views

Hi John, I am unsure whether the issue you found when using PARDISO is directly a result or problem connected to Dislin. When using Dislin from VS, you need to set a few extra options (such as path to files for single- or double-precision Dislin libraries), but since you were able to run a simple plot case, you probably know that. Are you sure you didn't forget one of those options in the project with PARDISO?
Anyways, you might find this simplified Dislin-based plotting module helpful, which includes a VS project for examples.

0 Kudos
JohnNichols
Valued Contributor III
1,024 Views

@Andreas_Z_ , thank you for the response.  The plotting module looks really good.  

I have DISLIN working now, I use it every couple of years and so with MSVS updates and minor changes in DISLIN naming, it just takes a few days to work out the correct items to set. 

The libs also need gdi32 and user32 to run correctly and now legacy_stdio...dll's need to be added.  Just takes a while to sort out the string of error messages.  

The examples do not run as shown without correcting graph calls, to pass variables instead of reals.  But now I can see the answer and compare it to the book.   InterScreenshot 2023-04-25 090827.png

Interestingly, the sample from the original Thesis problem did not have an output sample, it turns out the problem has the loads to high for the column, so it would fail.  

 

0 Kudos
Andreas_Z_
New Contributor I
972 Views

Hi John and all interested in using Dislin,

I think the *fprintf error* message is often a symptom of a VS solution that applies linking to dynamic libraries rather than static ones. I've just updated some info about this for my example program (https://github.com/andizuend/Dislin_x_y_plot#how-to-link-your-program-to-the-dislin-library). So, the typically necessary steps in terms of settings in VS to successfully link to Dislin on Windows are as follows.

Navigate in VS to menu Project > Properties > Fortran, then

  1. under General > Additional Include Directories, set c:\dislin\ifc\real64. If necessary, adjust the c:\dislin path part to point to your installation directory.
  2. check that under Fortran > Libraries > Runtime Library: Debug Multithreaded (\libs:static /threads /dbglibs) or simply Multithreaded is set (depending on Debug vs Release mode); the point is to have linking with static libraries rather than with DLLs selected.
  3. under Project > Properties > Linker > Input > Additional Dependencies, set the following: c:\dislin\disifl_d.lib c:\dislin\disifd_d.lib user32.lib gdi32.lib. Again, if necessary, adjust in all cases the c:\dislin path parts on that line.

The above applies to the use of the Dislin distribution for Windows 64-bit, for compiler: "Intel compilers icl, ifort 64-bit" found here

0 Kudos
JohnNichols
Valued Contributor III
968 Views

For the latest MSVS you need to add the following libraries as well as the ones shown above.  

Screenshot 2023-04-26 110635.png

I put them in the solution, exceedingly bad practice, but it means I know about them without having to hunt through the property pages. 

/NODEFAULTLIB:LIBCMT.lib

You also need to add this to the linker options. 

Unfortunately the DISLIN manual does not enumerate these steps.  

0 Kudos
Andreas_Z_
New Contributor I
950 Views

Hi John,

I cannot reproduce the need for some other libraries that you mention (for working with Dislin). What you state about needing legacy stdio libs may have to do either with other needs of your project or your VS installation may be missing a package (?). Also, if you don't add the /NODEFAULTLIB:LIBCMT.lib switch, you get a link warning (no error) in a Debug build (no warning/error in a Release build), which I tend to simply ignore; nothing new with VS 2022, that was already the case years ago. 

I've tested my Dislin_x_y_plot example program on a machine with to date the latest MS VS 2022 community (version 17.5.4) with the latest oneAPI Fortran compilers (ifort 2021.9.0 and ifx 2023.1.0). It works fine and as intended with both ifort and ifx using the VS settings for linking with Dislin I listed previously in this thread. It also works the same way in VS 2019 community. I note that my VS 2022 and oneAPI installations are pretty lean, but not quite the bare minimum. 

Cheers,

Andi

0 Kudos
Andreas_Z_
New Contributor I
946 Views

I should add: I am also using this recent Dislin version (just released on April 25, 2023), not sure if there are issues with older versions of Dislin.

0 Kudos
Reply