Undefined externals in Mac OS X v10.6.2

Problem:

Build Hdf5Test of project Hdf5Test with configuration Debug

Ld build/Debug/Hdf5Test normal x86_64
cd /Users/mdw/Bivariate/Projects/Hdf5Test
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug -L/Users/mdw/opt/local/lib -L/Users/mdw/Bivariate/Projects/Hdf5Test/../../../opt/local/lib -F/Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug -filelist /Users/mdw/Bivariate/Projects/Hdf5Test/build/Hdf5Test.build/Debug/Hdf5Test.build/Objects-normal/x86_64/Hdf5Test.LinkFileList -mmacosx-version-min=10.6 -framework Foundation -lhdf5 -lsz -lz -o /Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug/Hdf5Test

Undefined symbols:
  "__intel_fast_memcpy", referenced from:
      _SZ_BufftoBuffCompress in libsz.a(sz_api.o)
      _SZ_Decompress in libsz.a(sz_api.o)
      _SZ_Decompress in libsz.a(sz_api.o)
      _SZ_Compress in libsz.a(sz_api.o)
      _SZ_Compress in libsz.a(sz_api.o)
      _rice_decode in libsz.a(rice.o)
      _rice_decode in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
  "__intel_fast_memset", referenced from:
      _rice_decode in libsz.a(rice.o)
      _rice_decode in libsz.a(rice.o)
      _fix_last_scanline in libsz.a(rice.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Background Info:

  On 2010.03.06, downloaded and installed hdf5-1.8.4-patch1-macosx64-static.
  Prior to installing hdf5-1.8.4-patch1-macosx64-static, downloaded and installed SZIP from HDF5 link.
  Copied HDF5 sample code to XCODE Hdf5Test project. Refer to code below.
  Included applicable libraries, ref., libsz and libz.
  Encountered undefined externals as outlined above.

Code:

#import <Foundation/Foundation.h>
#import <hdf5.h>

#define FILE "SDS.h5"
#define DATASETNAME "IntArray"
#define NX 5 /* dataset dimensions */
#define NY 6
#define RANK 2

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  
    hid_t file, dataset; /* file and dataset handles */
    hid_t datatype, dataspace; /* handles */
    hsize_t dimsf[2]; /* dataset dimensions */
    herr_t status;
    int data[NX][NY]; /* data to write */
    int i, j;
  
    /*
     * Data and output buffer initialization.
     */
    for (j = 0; j < NX; j++) {
    for (i = 0; i < NY; i++)
      data[j][i] = i + j;
    }
    /*
     * 0 1 2 3 4 5
     * 1 2 3 4 5 6
     * 2 3 4 5 6 7
     * 3 4 5 6 7 8
     * 4 5 6 7 8 9
     */
  
    /*
     * Create a new file using H5F_ACC_TRUNC access,
     * default file creation properties, and default file
     * access properties.
     */
    file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
  
    /*
     * Describe the size of the array and create the data space for fixed
     * size dataset.
     */
    dimsf[0] = NX;
    dimsf[1] = NY;
    dataspace = H5Screate_simple(RANK, dimsf, NULL);
  
    /*
     * Define datatype for the data in the file.
     * We will store little endian INT numbers.
     */
    datatype = H5Tcopy(H5T_NATIVE_INT);
    status = H5Tset_order(datatype, H5T_ORDER_LE);
  
    /*
     * Create a new dataset within the file using defined dataspace and
     * datatype and default dataset creation properties.
     */
    dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
            H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  
    /*
     * Write the data to the dataset using default transfer properties.
     */
    status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
            H5P_DEFAULT, data);
  
    /*
     * Close/release resources.
     */
    H5Sclose(dataspace);
    H5Tclose(datatype);
    H5Dclose(dataset);
    H5Fclose(file);
  
    NSLog(@"Hello, World!");
    [pool drain];
    return 0;
}

Question:

What am I missing?

···

--
Regards,
MDW

Hi,

The problem is that SZIP you downloaded is for PPC and not for Intel. We are in the process of updating out web pages and link to the new SZIP binaries is not there yet.

You may build SZIP from the source found at ftp://ftp.hdfgroup.org/lib-external/szip/2.1/src/, or download from ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/szip-MacOSX/. Binary is a universal binary for i386 and x86_64 and includes SZIP encoder.

But please be aware about SZIP license. See http://www.hdfgroup.org/doc_resource/SZIP/Commercial_szip.html.

If you cannot use SZIP, it is easy to build HDF5 without SZIP library.
Just use
./configure --prefix=....
make
make check
make install

Elena

···

On Mar 6, 2010, at 6:39 PM, MDW wrote:

Problem:

Build Hdf5Test of project Hdf5Test with configuration Debug

Ld build/Debug/Hdf5Test normal x86_64
cd /Users/mdw/Bivariate/Projects/Hdf5Test
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug -L/Users/mdw/opt/local/lib -L/Users/mdw/Bivariate/Projects/Hdf5Test/../../../opt/local/lib -F/Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug -filelist /Users/mdw/Bivariate/Projects/Hdf5Test/build/Hdf5Test.build/Debug/Hdf5Test.build/Objects-normal/x86_64/Hdf5Test.LinkFileList -mmacosx-version-min=10.6 -framework Foundation -lhdf5 -lsz -lz -o /Users/mdw/Bivariate/Projects/Hdf5Test/build/Debug/Hdf5Test

Undefined symbols:
  "__intel_fast_memcpy", referenced from:
      _SZ_BufftoBuffCompress in libsz.a(sz_api.o)
      _SZ_Decompress in libsz.a(sz_api.o)
      _SZ_Decompress in libsz.a(sz_api.o)
      _SZ_Compress in libsz.a(sz_api.o)
      _SZ_Compress in libsz.a(sz_api.o)
      _rice_decode in libsz.a(rice.o)
      _rice_decode in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
      _encode_scanline in libsz.a(rice.o)
  "__intel_fast_memset", referenced from:
      _rice_decode in libsz.a(rice.o)
      _rice_decode in libsz.a(rice.o)
      _fix_last_scanline in libsz.a(rice.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Background Info:

  On 2010.03.06, downloaded and installed hdf5-1.8.4-patch1-macosx64-static.
  Prior to installing hdf5-1.8.4-patch1-macosx64-static, downloaded and installed SZIP from HDF5 link.
  Copied HDF5 sample code to XCODE Hdf5Test project. Refer to code below.
  Included applicable libraries, ref., libsz and libz.
  Encountered undefined externals as outlined above.

Code:

#import <Foundation/Foundation.h>
#import <hdf5.h>

#define FILE "SDS.h5"
#define DATASETNAME "IntArray"
#define NX 5 /* dataset dimensions */
#define NY 6
#define RANK 2

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  
    hid_t file, dataset; /* file and dataset handles */
    hid_t datatype, dataspace; /* handles */
    hsize_t dimsf[2]; /* dataset dimensions */
    herr_t status;
    int data[NX][NY]; /* data to write */
    int i, j;
  
    /*
     * Data and output buffer initialization.
     */
    for (j = 0; j < NX; j++) {
    for (i = 0; i < NY; i++)
      data[j][i] = i + j;
    }
    /*
     * 0 1 2 3 4 5
     * 1 2 3 4 5 6
     * 2 3 4 5 6 7
     * 3 4 5 6 7 8
     * 4 5 6 7 8 9
     */
  
    /*
     * Create a new file using H5F_ACC_TRUNC access,
     * default file creation properties, and default file
     * access properties.
     */
    file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
  
    /*
     * Describe the size of the array and create the data space for fixed
     * size dataset.
     */
    dimsf[0] = NX;
    dimsf[1] = NY;
    dataspace = H5Screate_simple(RANK, dimsf, NULL);
  
    /*
     * Define datatype for the data in the file.
     * We will store little endian INT numbers.
     */
    datatype = H5Tcopy(H5T_NATIVE_INT);
    status = H5Tset_order(datatype, H5T_ORDER_LE);
  
    /*
     * Create a new dataset within the file using defined dataspace and
     * datatype and default dataset creation properties.
     */
    dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
            H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
  
    /*
     * Write the data to the dataset using default transfer properties.
     */
    status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
            H5P_DEFAULT, data);
  
    /*
     * Close/release resources.
     */
    H5Sclose(dataspace);
    H5Tclose(datatype);
    H5Dclose(dataset);
    H5Fclose(file);
  
    NSLog(@"Hello, World!");
    [pool drain];
    return 0;
}

Question:

What am I missing?

--
Regards,
MDW

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org