This seems like it would be so simple, but yet it doesn’t seem to work and I cannot find instructions for this anywhere.
All I want to do is compile all files with a .FOR extension in a directory. Every time I try using:
pgfortran -c *.FOR
I get this result:
PGF90-F-0002-Unable to open source input file: *.FOR
PGF90/x86 Windows 12.10-0: compilation aborted
Is there some other way I should be batch compiling? I have over 1700 files that need to be compiled into a static library and really don’t want to write a windows batch file with the name of each file listed.
Thanks for your help!
Justin
I figured out how to batch process using a batch file:
for /f %%f in (‘dir /b c:<folder path>*.FOR’) do pgfortran -c %%f
I guess I’m still surprised that simply using *.FOR in the pgfortran command wouldn’t work.
“*” is a UNIX shell command, not part of the compiler.
Interesting. I noticed that the command worked in Cygwin, but strange that all the other Fortran compilers that I have been testing handled the command in the Windows cmd prompt. Also, after I use the batch script to compile, I can use the Microsoft Library Manager to create a static library in the same cmd prompt using:
lib /out:<name_of_library>.lib *.obj
and it works just fine. Oh well, I have a path forward on that item, on to bigger and better problems… see my post on DATE_AND_TIME intrinsic link problems.
Justin C.