I have a bat file running a command :
C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\path\to\the\compilers\script.bat" option1 option2"
It basically opens a cmd windows for which different commands (intel compilers etc) are already in the path. Then, in this command window I cd
to a specific location and I use these intel commands as follows :
ifort -c -fpp file1.f90
ifort -c -fpp file2.f90
ifort -c -fpp file3.f90
ifort -dll -o libfinal.dll file1.obj file2.obj file3.obj
lib /out:./libfinal.lib file1.obj file2.obj file3.obj
xcopy /s .\libfinal.dll "..\libfinal.dll*" /Y
xcopy /s .\libfinal.lib "..\libfinal.lib*" /Y
which compile (with ifort
intel fortran compiler, but the question doesn't depend on it) libraries and copies them somewhere.
I would to wrap all above into a single bat file doing the whole job. I came up with :
call ""C:\Program Files (x86)\path\to\the\compilers\script.bat" option1 option2"
ifort -c -fpp file1.f90
ifort -c -fpp file2.f90
ifort -c -fpp file3.f90
ifort -dll -o libfinal.dll file1.obj file2.obj file3.obj
lib /out:./libfinal.lib file1.obj file2.obj file3.obj
xcopy /s .\libfinal.dll "..\libfinal.dll*" /Y
xcopy /s .\libfinal.lib "..\libfinal.lib*" /Y
but running it gives me the following :
'""C:\Program' is not recognized as an internal or external command
I checked Command Prompt Error 'C:\Program' is not recognized as an internal or external command, operable program or batch file but did not succeed in adapting to my situation
Remark. option1
and option2
don't have spaces or anything requiring quoting, and if I use call "C:\Program Files (x86)\path\to\the\compilers\script.bat" option1 option2
I have the following error :
The input line is too long.
The syntax of the command is incorrect.
Remark. The true content of the call
line is :
call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\bin\ipsxe-comp-vars.bat" intel64 vs2015