[hdf-forum] Build problem HDF5 1.8.2 on Solaris 2.8
Richard Corden
richard.corden at gmail.com
Mon Mar 23 14:54:21 EDT 2009
Hi,
2009/3/23 Robert Latham <robl at mcs.anl.gov>
On Mon, Mar 23, 2009 at 12:39:06PM +0100, Richard Corden wrote:
> Running "../hdf-1.8.2/configure" from build results in the following:
...
> checking for gcc... cc
> checking for C compiler default output file name...
> configure: error: C compiler cannot create executables
> See `config.log' for more details.
>
> The above error occurs even though gcc is directly in the path. To get
> round this, I set the environment variables CC=gcc and CXX=g++. The
> configure step now appears to pass successfully with the
following "STATUS"
> at the end:
OK, so what if you don't set CC and CXX? What did config.log say?
Sometimes config.log shows that it is trying to link in additional
libraries or do something else unexpected.
I've made progress in a different direction, but to answer your
question first, here's the relevant section from the config.log:
configure:2947: checking for gcc
configure:2974: result: cc
configure:3212: checking for C compiler version
configure:3219: cc --version >&5
../hdf5-1.8.2/configure: cc: command not found
configure:3222: $? = 127
configure:3229: cc -v >&5
../hdf5-1.8.2/configure: cc: command not found
configure:3232: $? = 127
configure:3239: cc -V >&5
../hdf5-1.8.2/configure: cc: command not found
configure:3242: $? = 127
configure:3265: checking for C compiler default output file name
configure:3292: cc conftest.c -lsocket >&5
../hdf5-1.8.2/configure: cc: command not found
configure:3295: $? = 127
configure:3333: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "HDF5"
| #define PACKAGE_TARNAME "hdf5"
| #define PACKAGE_VERSION "1.8.2"
| #define PACKAGE_STRING "HDF5 1.8.2"
| #define PACKAGE_BUGREPORT "help at hdfgroup.org"
| #define PACKAGE "hdf5"
| #define VERSION "1.8.2"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
So we don't have 'cc' installed on that machine anywhere, and in fact
the only compilers on the machine are different versions of gcc/g++.
*PROGRESS*
I have managed to make some progress on this however using the
following small test case:
// t.c
#include <inttypes.h>
uint64_t i;
> gcc -c t.c
The above compiles cleanly. But adding "-std=c99" to the command line
causes the error:
> gcc -std=c99 -c t.c
t.c:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ui'
This is caused by "-std=c99" defining __STDC__ in the compiler and
that in turn defines __STRICT_ANSI__ and the "int_types.h" header (or
at least the gcc stubbed version) has the following:
/*
* intmax_t and uintmax_t are to be the longest (in number of bits) signed
* and unsigned integer types supported by the implementation.
*/
#if defined(_LP64) || ( !defined(__STRICT_ANSI__) && !defined(_NO_LONGLONG))
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
#else
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
#endif
I added CFLAGS and CXXFLAGS with them set to "-U__STRICT_ANSI__". And
reconfigured with the following command:
../hdf5-1.8.2/configure --enable-cxx --enable-zlib
CXXFLAGS="-U__STRICT_ANSI__" CFLAGS="-U__STRICT_ANSI__"
Running make then eventually fails at this point:
make[2]: Entering directory `/data/HDF5/build/c++/src'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
-I. -I../../../hdf5-1.8.2/c++/src -I../../src
-I../../../hdf5-1.8.2/src -LANG:std -DNDEBUG -UH5_DEBUG_API
-U__STRICT_ANSI__ -instances=static -O -s -MT H5Exception.lo -MD -MP
-MF .deps/H5Exception.Tpo -c -o H5Exception.lo
../../../hdf5-1.8.2/c++/src/H5Exception.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I.
-I../../../hdf5-1.8.2/c++/src -I../../src -I../../../hdf5-1.8.2/src
-LANG:std -DNDEBUG -UH5_DEBUG_API -U__STRICT_ANSI__ -instances=static
-O -s -MT H5Exception.lo -MD -MP -MF .deps/H5Exception.Tpo -c
../../../hdf5-1.8.2/c++/src/H5Exception.cpp -fPIC -DPIC -o
.libs/H5Exception.o
cc1plus: error: unrecognized command line option "-instances=static"
make[2]: *** [H5Exception.lo] Error 1
make[2]: Leaving directory `/data/HDF5/build/c++/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/HDF5/build/c++'
make: *** [all-recursive] Error 1
After removing the "--enable-cxx" option, I have been able to build
and install the libraries. Tomorrow I will check if theyŕe working!
Aside from the build error with "--enable-cxx", what is the best
approach to getting HDF5 to build out of the box on this machine?
It appears to me, that if "-std=c99" is required, then this option
should be used when testing for other features like "uint64_t". Is
c99 support really required?
Regards,
Richard
----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe at hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe at hdfgroup.org.
More information about the Hdf-forum
mailing list