compiling for the first time from source code

Hello,

This is my first attempt of building some software from source, so please
bear with me. On a Ubuntu 16.04 installation I issued the following command:

./configure --prefix=/usr/local/HDF5 --enable-parallel

in the config.log I see these lines

configure:4603: error: in `/home/.../packages/hdf5-1.10.1':
configure:4605: error: C compiler cannot create executables
See `config.log' for more details

the C compiler exists, as I have compiled zlib-1.2.11 and boost_1_64_0

Kindly guide me.

Thanks in advance,
MI

···

Can you post a few more lines from config.log? In a failure case it should contain a lot more information, possibly further up.

I one of my examples, output (hopefully close to what you see) looks like:

configure:4112: checking for gcc
configure:4139: result: gcc
configure:4368: checking for C compiler version
configure:4377: gcc --version >&5
gcc (Debian 4.9.2-10) 4.9.2

...

configure:4408: checking whether the C compiler works
configure:4430: gcc conftest.c >&5
configure:4434: $? = 0
configure:4482: result: yes
configure:4485: checking for C compiler default output file name
configure:4487: result: a.out
configure:4493: checking for suffix of executables
configure:4500: gcc -o conftest conftest.c >&5
configure:4504: $? = 0
configure:4526: result:

But then - in my case it succeeds.

Frank

···

On Fri, Jun 16, 2017 at 11:06:18PM +0500, Muhammad ILYAS wrote:

./configure --prefix=/usr/local/HDF5 --enable-parallel

in the config.log I see these lines

configure:4603: error: in `/home/.../packages/hdf5-1.10.1':
configure:4605: error: C compiler cannot create executables
See `config.log' for more details

the C compiler exists, as I have compiled zlib-1.2.11 and boost_1_64_0

Do you have MPI installed?

Dana Robinson
Software Developer
The HDF Group

···

From: Hdf-forum <hdf-forum-bounces@lists.hdfgroup.org> on behalf of Muhammad ILYAS <milyas7@gmail.com>
Reply-To: HDF List <hdf-forum@lists.hdfgroup.org>
Date: Friday, June 16, 2017 at 11:06
To: HDF List <hdf-forum@lists.hdfgroup.org>
Subject: [Hdf-forum] compiling for the first time from source code

Hello,

This is my first attempt of building some software from source, so please bear with me. On a Ubuntu 16.04 installation I issued the following command:

./configure --prefix=/usr/local/HDF5 --enable-parallel

in the config.log I see these lines

configure:4603: error: in `/home/.../packages/hdf5-1.10.1':
configure:4605: error: C compiler cannot create executables
See `config.log' for more details

the C compiler exists, as I have compiled zlib-1.2.11 and boost_1_64_0

Kindly guide me.

Thanks in advance,
MI

Do you have MPI installed?

Dana Robinson

Software Developer

The HDF Group

after reading you message I did issue

sudo apt-get install mpich mpich-doc

this did some :slight_smile:

and now the first search for "error":

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

configure:4514: $? = 0

configure:4503: mpicc -V >&5

gcc: error: unrecognized command line option '-V'

gcc: fatal error: no input files

compilation terminated.

configure:4514: $? = 1

configure:4503: mpicc -qversion >&5

gcc: error: unrecognized command line option '-qversion'

gcc: fatal error: no input files

compilation terminated.

configure:4514: $? = 1

configure:4534: checking whether the C compiler works

configure:4556: mpicc conftest.c >&5

configure:4560: $? = 0

configure:4608: result: yes

···

______________________________________________________
and a few lines down

configure:5370: mpicc -E conftest.c
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:5370: $? = 1
configure: failed program was:

/* confdefs.h */
#define PACKAGE_NAME "HDF5"
#define PACKAGE_TARNAME "hdf5"
#define PACKAGE_VERSION "1.10.1"
#define PACKAGE_STRING "HDF5 1.10.1"
#define PACKAGE_BUGREPORT "help@hdfgroup.org"
#define PACKAGE_URL ""
#define PACKAGE "hdf5"
#define VERSION "1.10.1"
/* end confdefs.h. */
#include <ac_nonexistent.h>

configure:5399: checking for grep that handles long lines and -e
configure:5457: result: /bin/grep
configure:5462: checking for egrep
configure:5524: result: /bin/grep -E
configure:5529: checking for ANSI C header files
configure:5549: mpicc -c conftest.c >&5
configure:5549: $? = 0
configure:5622: mpicc -o conftest conftest.c >&5
configure:5622: $? = 0
configure:5622: ./conftest
configure:5622: $? = 0
configure:5633: result: yes

______________________________________________________________

configure:5669: mpicc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:57:21: error: expected expression before ')' token
if (sizeof ((size_t)))
                     ^
configure:5669: $? = 1

On Fri, Jun 16, 2017 at 11:36 PM, Dana Robinson <derobins@hdfgroup.org> wrote:

*From: *Hdf-forum <hdf-forum-bounces@lists.hdfgroup.org> on behalf of
Muhammad ILYAS <milyas7@gmail.com>
*Reply-To: *HDF List <hdf-forum@lists.hdfgroup.org>
*Date: *Friday, June 16, 2017 at 11:06
*To: *HDF List <hdf-forum@lists.hdfgroup.org>
*Subject: *[Hdf-forum] compiling for the first time from source code

Hello,

This is my first attempt of building some software from source, so please
bear with me. On a Ubuntu 16.04 installation I issued the following command:

./configure --prefix=/usr/local/HDF5 --enable-parallel

in the config.log I see these lines

configure:4603: error: in `/home/.../packages/hdf5-1.10.1':

configure:4605: error: C compiler cannot create executables

See `config.log' for more details

the C compiler exists, as I have compiled zlib-1.2.11 and boost_1_64_0

Kindly guide me.

Thanks in advance,

MI

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

and now the first search for "error":

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

configure:4514: $? = 0

configure:4503: mpicc -V >&5

gcc: error: unrecognized command line option '-V'

gcc: fatal error: no input files

compilation terminated.

configure tries lots of things to see what works, so seeing errors in the log is expected. Usually it is the last error you are interested in, the one that in the end is fatal and lets configure abort.

configure:5669: mpicc -c conftest.c >&5
conftest.c: In function 'main':
conftest.c:57:21: error: expected expression before ')' token
if (sizeof ((size_t)))
                    ^
configure:5669: $? = 1

Is this the last error in your config.log? This seems to be part of the 'ac_fn_c_check_type' check, in this case checking the existence of size_t. So, this indicates that size_t is not known at compile time. size_t comes from stdlib.h Those should have been detected by configure beforehand. Check for ia line:

checking for ANSI C header file

It should say "yes" there. This is a good example of why attaching the complete config.log would be helpful.

Frank

···

On Sat, Jun 17, 2017 at 12:00:31AM +0500, Muhammad ILYAS wrote:

It should say "yes" there. This is a good example of why attaching the
complete config.log would be helpful.

config.log is attached with message

config.log (1.39 MB)

···

Hi Muhammad

···

On Sat, Jun 17, 2017 at 07:57:20AM +0500, Muhammad ILYAS wrote:

config.log is attached with message

Hi,

That log indicates to me that everything went well. It exited with a '0' exit code. The check for a working C compiler, that you said failed last time, passes here, too.

Frank