Compiling C++ library under OS X 10.5 (version 1.6.9)

I just downloaded the 1.6.9 sources and I have been trying to compile
the C++ library in addition to the regular libraries. This is the
configure line that I am using:

./configure --prefix=/Users/Shared/Toolkits/hdf5 --enable-cxx==yes
--enable-shared=yes --enable-static=yes --enable-hl=yes
--enable-filters=no

and then make, make install. But the C++ library is not getting built.
Is anyone else having this problem? I was also trying to build a 64
bit version of the library by exporting CPPFLAGS="-arch x86_64" but
when I start that compiling I get the following error:

587:[mjackson@Shepard:hdf5-169]$ make
make lib
rm -f .libs/H5.lo
gcc -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer
-finline-functions -I. -I. -UH5_DEBUG_API -DNDEBUG x86_64 -arch -c
H5.c -fno-common -DPIC -o .libs/H5.lo
gcc-4.0: Invalid arch name : -c
i686-apple-darwin9-gcc-4.0.1: make[2]: *** [H5.lo] Error 1
x86_64: No such file or directory
make[1]: *** [lib] Error 1
make: *** [all] Error 2

This is the output at the end of the configure stage:

               Compilation Mode: Production
                     C Compiler: gcc
                         CFLAGS: -arch x86_64 -std=c99
-Wno-long-long -O -fomit-frame-pointer -finline-functions
                       CPPFLAGS: -UH5_DEBUG_API -DNDEBUG x86_64 -arch
                        LDFLAGS:
                     Debug Mode: None
               Shared Libraries: Yes
               Static Libraries: Yes
  Statically Linked Executables: No
                        Tracing: No
   Optimization Instrumentation: No

I exported the following before configuring:

export CFLAGS="-arch x86_64"
export CPPFLAGS="-arch x86_64"

Note the reversal of the CPPFLAGS in the configure output?

Any help on this would be greatly appreciated.

Mike Jackson

···

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

OK. I started with a clean shell and here are the relevant exports:

export CPPFLAGS="-arch x86_64"
export CXXFLAGS="-arch x86_64"
export CFLAGS="-arch x86_64"
export CC=/usr/bin/gcc

./configure --prefix=/Users/Shared/Toolkits/hdf5 --enable-cxx
--enable-shared --enable-static --enable-hl --enable-filters=no

the last part of the configure output is the following:

CFLAGS: -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer
-finline-functions
CPPFLAGS: -UH5_DEBUG_API -DNDEBUG x86_64 -arch

which will obviously cause compiler errors. It would seem like there
is some sort of parsing of the CPPFLAGS going on instead of using them
verbatim from the command line environment.

Mike Jackson

···

On Thu, Jun 11, 2009 at 10:39 PM, Binh-Minh Ribler<bmribler@hdfgroup.org> wrote:

It seemed that the correct compiler is not specified. I don't know anything
about the system you're using. You might need to "setenv CXX" to the
correct compiler. Also, did you try removing the "==yes" from all the other
options? I'm not aware that you need the "==yes."

Sorry if I can't be more help!

-----Original Message-----
From: Mike Jackson [mailto:mike.jackson@bluequartz.net]
Sent: Thursday, June 11, 2009 10:21 PM
To: Binh-Minh Ribler
Subject: Re: [hdf-forum] Compiling C++ library under OS X 10.5 (version
1.6.9)

Now that gives the following:
'
checking for g++... g++
checking for C++ compiler default output file name...
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
configure: error: ./configure failed for c++

Looking through the config.log doesn't really reveal much.

Mike

On Thu, Jun 11, 2009 at 10:04 PM, Binh-Minh Ribler<bmribler@hdfgroup.org> > wrote:

Hi Mike,

Did you try just --enable-cxx, not --enable-cxx==yes?

Just a thought...
Binh-Minh

-----Original Message-----
From: Mike Jackson [mailto:mike.jackson@bluequartz.net]
Sent: Thursday, June 11, 2009 10:00 PM
To: hdf-forum
Subject: [hdf-forum] Compiling C++ library under OS X 10.5 (version 1.6.9)

I just downloaded the 1.6.9 sources and I have been trying to compile
the C++ library in addition to the regular libraries. This is the
configure line that I am using:

./configure --prefix=/Users/Shared/Toolkits/hdf5 --enable-cxx==yes
--enable-shared=yes --enable-static=yes --enable-hl=yes
--enable-filters=no

and then make, make install. But the C++ library is not getting built.
Is anyone else having this problem? I was also trying to build a 64
bit version of the library by exporting CPPFLAGS="-arch x86_64" but
when I start that compiling I get the following error:

587:[mjackson@Shepard:hdf5-169]$ make
make lib
rm -f .libs/H5.lo
gcc -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer
-finline-functions -I. -I. -UH5_DEBUG_API -DNDEBUG x86_64 -arch -c
H5.c -fno-common -DPIC -o .libs/H5.lo
gcc-4.0: Invalid arch name : -c
i686-apple-darwin9-gcc-4.0.1: make[2]: *** [H5.lo] Error 1
x86_64: No such file or directory
make[1]: *** [lib] Error 1
make: *** [all] Error 2

This is the output at the end of the configure stage:

          Compilation Mode:  Production
                C Compiler:  gcc
                    CFLAGS:   \-arch x86\_64 \-std=c99

-Wno-long-long -O -fomit-frame-pointer -finline-functions
CPPFLAGS: -UH5_DEBUG_API -DNDEBUG x86_64 -arch
LDFLAGS:
Debug Mode: None
Shared Libraries: Yes
Static Libraries: Yes
Statically Linked Executables: No
Tracing: No
Optimization Instrumentation: No

I exported the following before configuring:

export CFLAGS="-arch x86_64"
export CPPFLAGS="-arch x86_64"

Note the reversal of the CPPFLAGS in the configure output?

Any help on this would be greatly appreciated.

Mike Jackson

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to
hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.549 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008
2:14 PM

--
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.549 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008
2:14 PM

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Isn't CPPFLAGS for preprocessor flags? If so, you don't want to pass -
arch there.

···

On 6/11/09 10:55 PM, Mike Jackson said:

export CPPFLAGS="-arch x86_64"

--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Well, OK. But I still need to get the -arch flag into the C++ compile commands. Just setting CFLAGS isn't good enough for this build system.

···

---
Mike Jackson www.bluequartz.net

On Jun 12, 2009, at 2:51 PM, Sean McBride wrote:

On 6/11/09 10:55 PM, Mike Jackson said:

export CPPFLAGS="-arch x86_64"

Isn't CPPFLAGS for preprocessor flags? If so, you don't want to pass -
arch there.

--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Right; so set arch in CFLAGS and CXXFLAGS (but not CPPFLAGS). I think
you are confusing CXXFLAGS and CPPFLAGS.

···

On 6/12/09 2:55 PM, Michael Jackson said:

Well, OK. But I still need to get the -arch flag into the C++ compile
commands. Just setting CFLAGS isn't good enough for this build system.

--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

That gets me farther. Now I get the error:

make lib
make[1]: Nothing to be done for `lib'.
make progs
rm -f .libs/h5diff_main.lo
gcc -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer -finline-functions -I. -I. -I../../src -I../../src -I../../tools/lib -UH5_DEBUG_API -DNDEBUG -c h5diff_main.c -fno-common -DPIC -o .libs/h5diff_main.lo
h5diff_main.c: In function 'main':
h5diff_main.c:106: warning: passing argument 3 of 'parse_command_line' from incompatible pointer type
h5diff_main.c:106: warning: passing argument 4 of 'parse_command_line' from incompatible pointer type
h5diff_main.c:106: warning: passing argument 5 of 'parse_command_line' from incompatible pointer type
h5diff_main.c:106: warning: passing argument 6 of 'parse_command_line' from incompatible pointer type
gcc -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer -finline-functions -I. -I. -I../../src -I../../src -I../../tools/lib -UH5_DEBUG_API -DNDEBUG -c h5diff_main.c -o h5diff_main.o >/dev/null 2>&1
mv -f .libs/h5diff_main.lo h5diff_main.lo
libtool: link: warning: `AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support.
rm -f .libs/h5diff.nm .libs/h5diff.nmS .libs/h5diff.nmT
creating .libs/h5diffS.c
generating symbol list for `h5diff'
sort: open failed: +2: No such file or directory
(cd .libs && gcc -c -fno-builtin "h5diffS.c")
rm -f .libs/h5diffS.c .libs/h5diff.nm .libs/h5diff.nmS .libs/h5diff.nmT
gcc .libs/h5diffS.o -arch x86_64 -std=c99 -Wno-long-long -O -fomit-frame-pointer -finline-functions -o .libs/h5diff h5diff_main.o ../lib/.libs/libh5tools.a -L../../src/.libs -lhdf5 -lz -lm
ld warning: in .libs/h5diffS.o, file is not of required architecture
ld warning: in ../../src/.libs/libhdf5.dylib, file is not of required architecture
Undefined symbols:

Some how something is still being built as 32 bit. Odd.

···

_________________________________________________________
Mike Jackson mike.jackson@bluequartz.net
             www.bluequartz.net

On Jun 12, 2009, at 2:58 PM, Sean McBride wrote:

On 6/12/09 2:55 PM, Michael Jackson said:

Well, OK. But I still need to get the -arch flag into the C++ compile
commands. Just setting CFLAGS isn't good enough for this build system.

Right; so set arch in CFLAGS and CXXFLAGS (but not CPPFLAGS). I think
you are confusing CXXFLAGS and CPPFLAGS.

--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.