Toolbox w IntelFortran + VS

Forums Questions on and problems with the toolbox Toolbox w IntelFortran + VS

This topic contains 10 replies, has 5 voices, and was last updated by Fabian Kindermann January 12, 2021 at 5:16 pm.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1737

    helena b
    User

    Hi,
    My problem is similar to this one: https://www.ce-fortran.com/forums/topic/toolbox-for-plotting-with-visual-studio/

    I am using an Intel Fortran compiler and Microsoft VS17. I have installed the gnuplot package and checked that it is on the path, i.e. if I type echo %PATH% in cmd, then I find a line that says C:\Program Files (x86)\gnuplot\bin. C:\Program Files (x86) is also where my Intel Fortran and MS VS17 is installed (not sure whether this is relevant).

    However, when I try to run program01_17, it comes up with the following: ‘gnuplot’ is not recognized as an operable program or batch file.

    Also, when I try to run install_toolbox.bat, it comes with an error message that says:
    …COMPILING TOOLBOX…
    ‘gfortran’ is not recognized as an internal or external command,
    operable program or batch file.
    …DONE…

    …COPYING TO INCLUDE DIRECTORY…
    The system cannot find the file specified.
    The system cannot find the file specified.
    1 file(s) copied.
    …DONE…

    …TOOLBOX INSTALLATION COMPLETED.

    Could someone kindly help me with this?
    Thank you!!

    #1739

    Fabian Kindermann
    Moderator

    Hi Helena,

    this is strange. So, when using MS VS17, you will not be able to use install_toolbox.bat, because this batch is taylored to gfortran. Instead, you want to include the toolbox into your resource files within the Visual Studio project. Yet, since you error message is

    ‘gnuplot’ is not recognized as an operable program or batch file

    it seems that you already did this and the program is running. (correct me if this is wrong)

    So the problem is somehow associated with the installation of gnuplot. The first thing you could do is open a windows command terminal (type cmd into your start meue). Once the command terminal is open, type gnuplot and see what happens.

    Best,
    Fabian

    #1742

    helena b
    User

    Hi Fabian,

    I don’t know what happened, but I restarted my computer and it’s working perfectly now.

    Thanks a lot for your help and this really great book+code.

    Helena

    #1743

    Jay Kang
    User

    Hi I think I have a similar problem. I am using ifortran and I am not quite understanding how to install toolbox. When I try the automatic installation, it did not go through, which means the screen shows

    …COMPILING TOOLBOX…
    ‘gfortran’ is not recognized as an internal or external command,
    operable program or batch file.
    …DONE…

    …COPYING TO INCLUDE DIRECTORY…
    The system cannot find the file specified.
    The system cannot find the file specified.
    1 file(s) copied.
    …DONE…

    …TOOLBOX INSTALLATION COMPLETED.

    I also tried with moving toolbox.f90 to the source folder. It did not work. It seems like my coding fails to load it from src folder. (In my understanding, src folder is “”C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.5.281\windows\compiler\include””). Could you help me with this? Thank you

    #1749

    Fabian Kindermann
    Moderator

    Dear Jay,

    how to use the toolbox with ifort depends on the way you are compiling your programs. There are in general three ways of doing it.

    1. If you are using Microsoft Visual Studio together with the Intel Fortran integration, then it is the easiest way to just take the original source code in toolbox.f90 and include it with your all your .f90 source files into your Visual Studio project. Then the compiler will generate a fresh compilation of the toolbox and include it directly into your compiled project code, so you can reference to any toolbox routine.
    2. If you are compiling your code from the command line using the ifort command, then a quick-and-dirty way is to just put the toolbox.f90 file into the same folder as the program you want to work with and write to the very beginning of each program the line include toolbox.f90, in the same way as we include other modules (like e.g. include "prog01_16m.f90" in prog01_16.f90).
    3. Choosing solution 2 is very easy, but might be inconvenient. As an alternative you can download the toolbox installation package for windows and modify the install_toolbox.bat file such that it works with ifort instead of gfortran (the GNU compiler). The only thing you’ll have to search for is the word gfortran and replace it by ifort. Everything else should be the same. What the toolbox installation package does is to precompile the toolbox and generate a file toolbox.mod as well as a file toolbox.o. These files are then copied to the folder c:\cygwin\include from which you can reference it when compiling a program. Please refer to the ifort compiler description on how to include libraries and precompiled routines.

    I hope this helps. Let me know if you have more questions.

    Best,
    Fabian

    #1854

    Jay Kang
    User

    Sorry for the late thanks. Now it works perfectly!

    Great book. Great resources. It’s been a great help for the progress of my dissertation.

    Best,
    Jay Kang

    #1862

    Joon Choi
    User

    Dear Fabian,

    I installed intel compiler and MS visual studio.

    As you explained, I changed all ‘gfortran’ of ‘install_toolbox.bat’ to ‘ifort’, but the message below appears.

    …COMPILING TOOLBOX…
    ‘ifort’ is not recognized as an internal or external command,
    operable program or batch file.
    …DONE…

    …COPYING TO INCLUDE DIRECTORY…
    The system cannot find the file specified.
    The system cannot find the file specified.
    1 file(s) copied.
    …DONE…

    …TOOLBOX INSTALLATION COMPLETED.

    What should I do to solve the problem?

    Best regards,

    Joon Choi

    #1863

    Joon Choi
    User

    Dear Fabian,

    When I type gnuplot command terminal, there is a message like below.

    ‘gnuplot’ is not recognized as an operable program or batch file.

    Do you know how to fix it?

    Best,

    Joon Choi

    #1864

    Joon Choi
    User

    The problems are solved by referring to your explanation in other questions.

    Thank you so much!

    Best regards,

    Joon Choi

    #1894

    Ak Am
    User

    Hi Fabian,

    It is my first weeks of using Fortran. I am following the intro to comp economics book by Hans and Fabian. The challenge is the toolbox source code. I want to replicate the graphs in the textbook but I keep getting an error in the toolbox source code. I am using include toolbox.f90 at the start of the program and this is the error I’m getting:

    C:\cygwin\include\toolbox.f90(1548) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7019) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7105) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7234) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7273) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7273) : error 326 – FUNCTION ASSERT_EQ2 has been called with too few arguments (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7299) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\toolbox.f90(7318) : error 374 – The first argument (N1) to ASSERT_EQ2 is missing (In include file C:\cygwin\include\toolbox.f90)
    C:\cygwin\include\graph.F95(28) : error 773 – Variable ROOT follows another operand (possible unexpected space?)
    C:\cygwin\include\graph.F95(33) : error 773 – Variable ROOT follows another operand (possible unexpected space?)
    C:\cygwin\include\graph.F95(36) : error 768 – EXECPLOT has an implicit interface and cannot have keyword arguments (possible spurious ‘=’?)
    C:\cygwin\include\graph.F95(41) : error 773 – Variable ROOT follows another operand (possible unexpected space?)
    C:\cygwin\include\graph.F95(45) : error 174 – Unexpected ‘#’ in expression
    C:\cygwin\include\graph.F95(50) : error 768 – EXECPLOT has an implicit interface and cannot have keyword arguments (possible spurious ‘=’?)

    Can you please help me?

    Thank you.

    AK

    #1908

    Fabian Kindermann
    Moderator

    Dear AK,

    what development environment are you using? Just to be sure, you posted this question under Intel Fortran + Visual Studio. If this is not your development environment, then I will move this post to a new thread. If it is, then I would need a bit of more information. If you are working with our standard setup, then you don’t need to use “include toolbox.f90”.

    Best,
    Fabian

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.