I try to build the Fortran code containing several fortran files with modules. I run it like this :
ifort -c constant.f90 CommonSub.f90 typedef.f90 globals.f90 output.f90 Prepro.f90 mesh3d.f90 ccfluids.f90 RMHD3D.f90
ifort -o MHD constant.o CommonSub.o typedef.o globals.o output.o Prepro.o mesh3d.o ccfluids.o RMHD3D.o
It open the following error:
ld: can't link with a main executable file 'constant.o' for architecture x86_64
How can I fix this problem ??
The version of Intel Fortran compiler on Mac machine :
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 184.108.40.206 Build 20180804
Copyright (C) 1985-2018 Intel Corporation. All rights reserved.
A bit of Googling suggests that constant.o is already linked as an executable file. How sure are you that you used -c on the first line?