(George, thanks for the good information.)
Pat,
I copied a copy of libhdf5.7.dylib I generated in a Darwin 11.4.2 (Lion)
to a Darwin 10.8.0 (Snow Leopard) and did
$ strings libhdf5.7.dylib > /dev/null
strings: object: libhdf5.dylib malformed object (unknown load command 8)
Puzzled, I read "man strings" and found this:
Description
Strings looks for ASCII strings in a binary file or standard
input.
Strings is useful for identifying random object files and many
other
things. A string is any sequence of 4 (the default) or more
printing
characters ending with a newline or a null. Unless the -
flag is
given, strings looks in _all sections of the object files_
except the
(__TEXT,__text) section. If no files are specified standard
input is
read.
So, I guess strings detects libhdf5.7.dylib is an object and tries to
find the sections. But since the object file is generated in a newer
OS (Lion), the older strings in Snow Leopard does not understand the
newer format.
I then tried this in the Snow Leopard system:
$ strings < libhdf5.dylib | grep SUMMARY
SUMMARY OF THE HDF5 CONFIGURATION
My suggestions to you:
1. Ask your system support staff to update the strings command in your
system;
Or
2. Edit the test/testlibinfo.sh file by changing this line:
if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" >
/dev/null; then
to
if strings < $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" >
/dev/null; then
^
Meanwhile, I will update the future release of HDF5 to use this
solution. It will take
a micro seconds to run it but it avoids this system versions issue.
Hope this helps.
-Albert
On 2/3/13 12:37 PM, George N. White III wrote:
It looks like you have an old version of the strings program.
On Snow Leopard with Xcode 3.2 I have:
$ /usr/bin/strings /usr/bin/strings | grep cctools
cctools-750
$ /usr/bin/strings /opt/local/bin/strings | grep cctools
cctools-836
$ port provides /opt/local/bin/strings
/opt/local/bin/strings is provided by: cctools
$ port info cctools
cctools @836 (devel)
Variants: llvm29, llvm30, [+]llvm31, llvm32, universal
Description: A set of essential tools to support development
on Mac OS
X and Darwin. Conceptually similar similar to
binutils on
other platforms.
Homepage: http://opensource.apple.com/source/cctools/
Build Dependencies: ld64
Library Dependencies: cctools-headers
Runtime Dependencies: llvm-3.1
Platforms: darwin
License: APSL-2 GPL-2+
Maintainers: [email protected] <mailto:[email protected]>,
[email protected] <mailto:[email protected]>
cctools-836 works, but cctools-750 fails.
$ /opt/local/bin/strings /opt/local/lib/libhdf5.7.dylib | grep SUMMARY
SUMMARY OF THE HDF5 CONFIGURATION
$ /usr/bin/strings /opt/local/lib/libhdf5.7.dylib | grep SUMMARY
/usr/bin/strings: object: /opt/local/lib/libhdf5.7.dylib malformed
object (unknown load command 8)
I have also run into situations where Apple's ld64 fails but macports
build of the Apple open source tool worked
(e.g.,LDFLAGS=-B/opt/local/libexec/ld64).
On Fri, Feb 1, 2013 at 11:53 AM, <[email protected]
<mailto:[email protected]>> wrote:
Thanks for the advice, Albert.
I get the same error when I execute the if statement from the command
line. However, I get no error when I execute
$ strings /etc/group > /dev/null
So, any idea why libhdf5.7.dylib would be a 'malformed object'?
I have included the output from make below with the hope that it
may help.
-Pat
Making all in src
make[1]: Entering directory
`/Users/pkablick/Downloads/tarballs/hdf5-1.8.10-patch1-intel-serial/src'
make all-am
make[2]: Entering directory
`/Users/pkablick/Downloads/tarballs/hdf5-1.8.10-patch1-intel-serial/src'
...[skipped]
> On 1/30/13 4:36 PM, acheng at hdfgroup.org <http://hdfgroup.org>
wrote:
> The testlibinfo.sh does something simple in the first test. It just
does this:
> if strings ../src/.libs/libhdf5.7.dylib | grep "SUMMARY OF THE HDF5
CONFIGURATION" > /dev/null; then
> echo " PASSED"
> else
> echo " FAILED"
> nerrors=`expr $nerrors + 1`
> fi
> From the message you showed, I think the error was from the command
> "strings".
> Can you "cd test" and hand run the above commands? (They are
Bourn sh
style commands.
> So, if you use cshell, do a "sh" first.)
> If you see the same error message, try this:
> $ strings /etc/group > /dev/null
> If you see the same error message again, something
> is wrong with the command "strings" executable.
> In that case, check with your system support staff.
> Let me know how it turns out.
> -Albert Cheng
> > On 1/28/13 12:02 PM, pkablick at atmos.umd.edu
<http://atmos.umd.edu> wrote:
> > Hello,
> > I'm trying to build HDF5 on Mac OS X 10.7.5, but I've run into a
problem that I haven't been able to fix. Any help or suggestions are
appreciated.
> > I've tried to build with both GNU and Intel compilers, and I
get the
same failure with both compiler suites on make check:
> > ============================
> > ============================
> > Testing testlibinfo.sh
> > *** Error ignored
> > Finished testing testlibinfo.sh
> > ============================
> > testlibinfo.sh Test Log
> > ============================
> > Check file ../src/.libs/libhdf5.7.dylib
strings: object: ../src/.libs/libhdf5.7.dylib malformed object
(unknown load command 15)
> > FAILED
> > Check file ../src/.libs/libhdf5.a
PASSED
> > Check file testhdf5
-SKIP-
> > ***1 errors encountered***
> > 0.31 real 0.03 user 0.05 sys
> > Finished testing testlibinfo.sh
> > ============================
> > ============================
> > Based on suggestions from other fora, here is some information
about
the dynamic library using file, otool and lipo:
> > $ file src/.libs/libhdf5.7.dylib
> > src/.libs/libhdf5.7.dylib: Mach-O 64-bit dynamically linked shared
library x86_64
> > $ otool -L src/.libs/libhdf5.7.dylib
> > src/.libs/libhdf5.7.dylib:
> > /usr/local/lib/libhdf5.7.dylib (compatibility version
8.0.0, current
version 8.4.0)
> > /usr/lib/libz.1.dylib (compatibility version 1.0.0,
current version
1.2.5)
> > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current
version 159.1.0)
> > mac64/libcilkrts.5.dylib (compatibility version 0.0.0, current
version 0.0.0)
> > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0,
current
version 52.0.0)
> > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current
version 1094.0.0)
> > $ lipo -info src/.libs/libhdf5.7.dylib
> > Non-fat file: src/.libs/libhdf5.7.dylib is architecture:
x86_64 I run
the following build script:
> > ############################################################
> > #!/bin/bash
> > # version of HDF5
> > export HDF5=hdf5-1.8.10-patch1
> > # location of installation
> > export PREFIX=/usr/local
> > # location of compiler
> > export COMPREFIX=/usr
> > # c preprocessor
> > export CPP='icc -E'
> > # c compiler
> > export CC=$COMPREFIX/bin/icc
> > # archiver and linker
> > export AR=$COMPREFIX/bin/xiar
> > export LD=$COMPREFIX/bin/xild
> > # c flags
> > export CFLAGS='-O0'
> > # linker flags
> > export LDFLAGS=-L$COMPREFIX/lib
> > # compression libraries used by HDF5
> > export ZLIB=$COMPREFIX
> > rm -rf $HDF5-intel-serial
> > tar xzf $HDF5.tar.gz
> > mv $HDF5 $HDF5-intel-serial
> > cd $HDF5-intel-serial
> > ./configure --prefix=$PREFIX --with-zlib=$ZLIB
> > # tell make to continue even if errors are encountered
> > export HDF5_Make_Ignore=yes
> > # use shared libraries
> > export HDF5_USE_SHLIB=yes
> > make all
> > make check
> > ############################################################
> > Also, here is some system information that may be helpful:
> > $uname -a
> > Darwin kestrel.local 11.4.2 Darwin Kernel Version 11.4.2: Thu
Aug 23
16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
> > $ which icc && which ifort && which icpc
> > /usr/bin/icc
> > /usr/bin/ifort
> > /usr/bin/icpc
> > $ icc --version && ifort --version && icpc --version
> > icc (ICC) 13.0.1 20121010
> > Copyright (C) 1985-2012 Intel Corporation. All rights
reserved. ifort
(IFORT) 13.0.1 20121010
> > Copyright (C) 1985-2012 Intel Corporation. All rights
reserved. icpc
(ICC) 13.0.1 20121010
> > Copyright (C) 1985-2012 Intel Corporation. All rights reserved. $
which gcc && which gfortran && which g++
> > /usr/local/bin/gcc
> > /usr/local/bin/gfortran
> > /usr/local/bin/g++
> > $ gcc --version && gfortran --version && g++ --version
> > gcc (GCC) 4.8.0 20120603 (experimental)
> > Copyright (C) 2012 Free Software Foundation, Inc.
> > GNU Fortran (GCC) 4.8.0 20120603 (experimental)
> > Copyright (C) 2012 Free Software Foundation, Inc.
> > g++ (GCC) 4.8.0 20120603 (experimental)
> > Copyright (C) 2012 Free Software Foundation, Inc.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected] <mailto:[email protected]>
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
--
George N. White III <[email protected] <mailto:[email protected]>>
Head of St. Margarets Bay, Nova Scotia
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org