0

I am trying to compile fortran 90 code using gfortran compiler in vscode in macOS Catalina. When I use the command, gfortran -o ./main Hello.f90, in vscode terminal, it works. However, if I try to add task.json and try to 'Run Task’ it throws an error. gfortran: fatal error: cannot execute 'f951': execvp: No such file or directory compilation terminated. I have tried several things including one with find/usr/local/ -name f951 in this link gfortran: error trying to exec 'f951': execvp: No such file or directory, but no luck. Please help.

My task.json

{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build", "type": "shell", "command": "gfortran", "args": [ "-o", "./main", "Hello.f90" ], "group": { "kind": "build", "isDefault": true } } ] } 
2
  • Please use tag fortran for all Fortrsn questions. Your question is not specific to the very old Fortran 90 revision. Commented Aug 10, 2020 at 6:04
  • Ok, I will do that from next time. Commented Aug 10, 2020 at 20:10

1 Answer 1

0

here is my task.json see if it helps you out. Mind the commented line ".exe". Maybe there you can paste the relevant extension for macOS.

{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "_runner": "terminal", "tasks": [ { "label": "build_gfortran", "type": "shell", "windows": { "command": "gfortran" }, "linux": { "command": "gfortran" }, "osx": { "command": "gfortran" }, "args": [ "${file}", "-g", "-o", // "${workspaceRoot}\\${fileBasenameNoExtension}.exe" "${fileBasenameNoExtension}" ], "problemMatcher": [], "group": { "kind": "build", "isDefault": true } } ] } 

BTW, very first time posting in here. Cheers.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.