Salvador
Salvador

Reputation: 1549

How to compile a Fortran subroutine

I have a small fortran subroutine that I got from here: How to call a Fortran program from R I saved it on C:\Fortran\horner.f90, however, when I try compile it using the command line I get an error saying that R is not recognized. See screenshots below. I do have Rtools installed and on my PATH. Am I missing something? Thanks for any pointers.enter image description here

And this is the error I get: enter image description here

Here is the horner.f90 file as well:

subroutine horner(n, a, x, y)
implicit none
integer :: n, i
double precision :: a(n), x, y

y = a(n)
do i = n - 1, 1, -1
    y = y * x + a(i)
end do
end subroutine

UPDATE: Here is a screenshot of where my R icon properties look like: enter image description here

Upvotes: 0

Views: 321

Answers (1)

user13963867
user13963867

Reputation:

In the "Edit environment variable" window, it should be one entry per path, and not several paths separated by a ;.

This window was enhanced in Windows 10, in previous versions of Windows you had to type everything as one line, managing the ; separator yourself. But this no longer holds.

When you type, say C:\a;C:\b as one entry here, then in a command line the path will have ...;"C:\a;C:\b", that is it will consider "C:\a;C:\b" as one single string describing a path, which is of course wrong, and the Console won't find anything in these directories.

Upvotes: 2

Related Questions