deiniol
deiniol

Reputation: 21

gcc: fatal error: no input files

I am trying to compile some source code but I presented with the following error output after entering "make":

mpicc -c -O3 -I        func_pointer.c
gcc: fatal error: no input files
compilation terminated.
make: *** [func_pointer.o] Error 4

I have seen other threads on this website relating to this error output (1, 2, 3). I was in fact experiencing a similar problem previously, which I think I may have solved, where the "make" command was producing:

make: Circular mod_prec.o <- mod_prec.o dependency dropped.
make: Circular mod_prec.o <- mod_prec.o dependency dropped.
make: Circular mod_prec.o <- mod_prec.o dependency dropped.
/usr/bin/cpp -P -C -traditional  -DIFORT -P -C -traditional    -DWET_DRY -DMULTIPROCESSOR    -DLIMITED_NO  -DGCN                                        mod_prec.F > mod_prec.f90
mpif90  -c  -O3 -I        mod_prec.f90
gfortran: fatal error: no input files
compilation terminated.
make: *** [mod_prec.o] Error 4

I followed the steps suggested on this website, which I think may have addressed that issue (I believe I am progressing further through the makefile). Those steps are as follows:

dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ which mpif90
/usr/local/bin/mpif90
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpif90 -show
gfortran -I/usr/local/include -pthread -I/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi_usempi -lmpi_mpifh -lmpi
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpif90 -V
gfortran: error: unrecognized command line option ‘-V’
gfortran: fatal error: no input files
compilation terminated.
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_LOC=/usr/local
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_INCLUDE="$MPI_LOC"/includedan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_LIB="$MPI_LOC"/lib
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ export LD_LIBRARY_PATH=$MPI_LIB:$LD_LIBRARY_PATH
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ export LIBMPI="-pthread -Wl -rpath -Wl -Wl,--enable-new-dtags -lmpi -lmpi_usempi -lmpi_mpifh -lmpi"

With an additional step of:

dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ make clean
/bin/rm -f *.o *.mod *.f90

Which brought me to where I am currently. My instinct is that the solution to my current problem will be similar to that of my previous problem. However, I am new to linux/c/fortran so I am not sure I fully follow the previous solution. As such the following commands produce the following output:

dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ which mpicc
/usr/local/bin/mpicc
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpicc -show
gcc -I/usr/local/include -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi
dan@Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpicc -V
gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files
compilation terminated.

Have I failed to correctly define some variables which is leading to this problem? I am conscious that this question is becoming rather long but I can add additional information if it is required such as the makefile (this is long though).

Upvotes: 0

Views: 25671

Answers (1)

deiniol
deiniol

Reputation: 21

Answering my own question after encountering it again whilst compiling FVCOM on a new hard drive. The issue is, as raised by Etan, the -I flag. In the make.inc file uncomment the LIBDIR and INCDIR variables under local install and comment out the same variables directly above.

Upvotes: 1

Related Questions