# C compiler cannot create executables

**URL:** <https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815>\
**Category:** HDF5 Library\
**Created:** [February 9, 2023, 5:32pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815 "2023-02-09T17:32:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkhodada](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@mkhodada](https://forum.hdfgroup.org/u/mkhodada)\
**Post date:** [February 9, 2023, 5:32pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/1 "2023-02-09T17:32:18Z")

</div>

Hello everyone,  
I am trying to install HDF5 (1.14.0) on Ubuntu 22.04 (intel) system with the following command (enabling the parallel and using mpi):  
./configure CC=mpicc FC=mpif90 --prefix="/home/user/PHDF5PATH" --enable-fortran --enable-parallel  
but I got error: C compiler cannot create executables, when I looked at the log file the error starts as soon as ‘-V’ and ‘-qversion’ did not recognized for the mpicc and gcc and resulted in fatal error.  
Following you can see part of log file that encounters the errors:

gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)  
… rest of stderr output deleted …  
configure:4839: $? = 0  
configure:4828: mpicc -V \>&5  
gcc: error: unrecognized command-line option ‘-V’  
gcc: fatal error: no input files  
compilation terminated.  
configure:4839: $? = 1  
configure:4828: mpicc -qversion \>&5  
gcc: error: unrecognized command-line option ‘-qversion’; did you mean ‘–version’?  
gcc: fatal error: no input files  
compilation terminated.  
configure:4839: $? = 1  
configure:4859: checking whether the C compiler works  
configure:4881: mpicc /home/user/OMPIPATH/include/ /home/user/OMPIPATH/include/ /home/user/OMPIPATH/lib/ conftest.c \>&5  
/usr/bin/ld: cannot find /home/user/OMPIPATH/include/: file format not recognized  
/usr/bin/ld: cannot find /home/user/OMPIPATH/include/: file format not recognized  
/usr/bin/ld: cannot find /home/user/OMPIPATH/lib/: file format not recognized  
collect2: error: ld returned 1 exit status  
configure:4885: $? = 1  
configure:4923: result: no

---

<div class="post-metadata">

**Author:** ![dave.allured](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/8e8cbc/32.png) [@dave.allured](https://forum.hdfgroup.org/u/dave.allured)\
**Post date:** [February 9, 2023, 7:04pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/2 "2023-02-09T19:04:31Z")

</div>

This sounds like a recent known problem with Intel compilers. Do you have config.log? Does it contain “cannot find -loopopt”?

If not, then please post config.log and full console output, as text file attachments (not in message body).

---

<div class="post-metadata">

**Author:** ![mkhodada](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@mkhodada](https://forum.hdfgroup.org/u/mkhodada)\
**Post date:** [February 9, 2023, 10:49pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/3 "2023-02-09T22:49:43Z")

</div>

Hello Dave,  
Thank you for your reply, there is no “cannot find -loopopt” in the log file.  
Of course, I have attached the log file and console output.  
[config.log](https://hdf-discourse-1.s3.amazonaws.com/original/2X/b/b8db545a19246887acdf714364abed373cb6cc62.log) (37.8 KB)  
[output.txt](https://hdf-discourse-1.s3.amazonaws.com/original/2X/f/f6cd8a96a7cac7f3767b3f9398d39c8b1fc7ef6b.txt) (1.4 KB)

---

<div class="post-metadata">

**Author:** ![dave.allured](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/8e8cbc/32.png) [@dave.allured](https://forum.hdfgroup.org/u/dave.allured)\
**Post date:** [February 10, 2023, 1:39am UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/4 "2023-02-10T01:39:26Z")

</div>

> [@mkhodada](#):
>
> Of course, I have attached the log file and console output.  
> [config.log](https://dbkt.hdfgroup.org/original/2X/b/b8db545a19246887acdf714364abed373cb6cc62.log) (37.8 KB)  
> [output.txt](https://dbkt.hdfgroup.org/original/2X/f/f6cd8a96a7cac7f3767b3f9398d39c8b1fc7ef6b.txt) (1.4 KB)

Thanks. My first guess was wrong, this has nothing to do with Intel. In config.log lines 103-156, these settings don’t seem right. These should be compiler option strings, not simple paths with no options in front of them such as -I or -L. This is causing the compile failure at line 1042.

> CFLAGS=/home/maryam/OMPIPATH/include/  
> CPPFLAGS=/home/maryam/OMPIPATH/include/  
> FFLAGS=/home/maryam/OMPIPATH/include/  
> LDFLAGS=/home/maryam/OMPIPATH/lib/

If you have set these in your environment before “configure”, try unsetting them, and run configure again. You might also need to keep these paths but put -I in front of the include paths, and -L in front of the lib path, to correctly build HDF5 parallel.

---

<div class="post-metadata">

**Author:** ![mkhodada](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@mkhodada](https://forum.hdfgroup.org/u/mkhodada)\
**Post date:** [February 10, 2023, 2:43am UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/5 "2023-02-10T02:43:54Z")

</div>

Yes I have set them in .bashrc file so the correct path would be like following?

> export CFLAGS=“/home/maryam/OMPIPATH/include/ -I”

I have attached my .bashrc related lines too. [bash-lines.txt](https://hdf-discourse-1.s3.amazonaws.com/original/2X/5/510bd4a8173d88177325e75816f040fed615fe85.txt) (397 Bytes)

---

<div class="post-metadata">

**Author:** ![dave.allured](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/8e8cbc/32.png) [@dave.allured](https://forum.hdfgroup.org/u/dave.allured)\
**Post date:** [February 10, 2023, 3:20am UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/6 "2023-02-10T03:20:23Z")

</div>

> [@mkhodada](#):
>
> export CFLAGS=“/home/maryam/OMPIPATH/include/ -I”

No. Like this:

> export CFLAGS=“-I /home/maryam/OMPIPATH/include/”  
> export CPPFLAGS=“-I /home/maryam/OMPIPATH/include/”  
> export FFLAGS=“-I /home/maryam/OMPIPATH/include/”  
> export LDFLAGS=“-L /home/maryam/OMPIPATH/lib/”

If that doesn’t work, just try setting all four to blank. Actually, try that first. This depends on the requirements of your mpicc installation, which I do not understand.

For more details on the use of FLAGS variables, please see part 4.3.6 in hdf5-1.14.0/release\_docs/INSTALL.

---

<div class="post-metadata">

**Author:** ![mkhodada](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@mkhodada](https://forum.hdfgroup.org/u/mkhodada)\
**Post date:** [February 10, 2023, 2:22pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/8 "2023-02-10T14:22:17Z")

</div>

Thank you, I am reviewing the release doc now, but by setting to blank or using -I -L in front of the path both result in following error:

```
configure: error: Fortran could not compile .f90 files

```

which is the case that I am not sure with following command (using mpi and parallel installing), what path for F77, F90 or any other fortran prefix I have to set in .bashrc.

```
./configure CC=mpicc FC=mpif90 --prefix="/home/maryam/PHDF5PATH" --enable-fortran --enable-parallel

```

Here is new log file  
[config.log](https://hdf-discourse-1.s3.amazonaws.com/original/2X/f/f968388f8f0858087351f1770f16d1901f429347.log) (58.4 KB)

---

<div class="post-metadata">

**Author:** ![dave.allured](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/8e8cbc/32.png) [@dave.allured](https://forum.hdfgroup.org/u/dave.allured)\
**Post date:** [February 10, 2023, 7:45pm UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/9 "2023-02-10T19:45:13Z")

</div>

Good, the C compiler problem is solved. Now it looks like there is a problem with your fortran compiler.

```
configure:6857: mpif90 --version >&5
--------------------------------------------------------------------------
No underlying compiler was specified in the wrapper compiler data file
(e.g., mpicc-wrapper-data.txt)
--------------------------------------------------------------------------

```

If you do not need fortran, the simplest solution would be to remove “–enable-fortran”, and make a C-only, parallel build.

If you _do_ need fortran, then this looks like a configuration problem with the fortran compiler itself, not HDF5. Please confirm that you can compile a simple fortran program such as Hello World, with mpif90.

---

<div class="post-metadata">

**Author:** ![mkhodada](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@mkhodada](https://forum.hdfgroup.org/u/mkhodada)\
**Post date:** [February 11, 2023, 1:42am UTC](https://forum.hdfgroup.org/t/c-compiler-cannot-create-executables/10815/10 "2023-02-11T01:42:19Z")

</div>

Thank you in advance Dave.  
Yes it seemed the mpi did not install by fortran correctly. It solved my problem.  
I appreciate your time and help.  
Bests,  
Maryam
