Opened 8 years ago

Closed 6 years ago

#51584 closed defect (fixed)

kealib @1.4.4_2 dyld: lazy symbol binding failed: Symbol not found:

Reported by: ForTozs Owned by: Veence (Vincent)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: kealib

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I am trying to install kealib on my computer (OS X 10.11.5, Xcode 7.3). It installs fine, but once I try to open a file in Python using gdal I get the message:

dyld: lazy symbol binding failed: Symbol not found: __ZN2H56H5FileC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEjRKNS_17FileCreatPropListERKNS_15FileAccPropListE
  Referenced from: /opt/local/lib/libkea.1.4.4.dylib
  Expected in: /opt/local/lib/libhdf5_cpp.100.dylib

dyld: Symbol not found: __ZN2H56H5FileC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEjRKNS_17FileCreatPropListERKNS_15FileAccPropListE
  Referenced from: /opt/local/lib/libkea.1.4.4.dylib
  Expected in: /opt/local/lib/libhdf5_cpp.100.dylib

and Python quits "unexpectedly". I have the following dependencies installed:

hdf5 @1.10.0_0+cxx+fortran+gcc5+hl+szip
gdal @2.0.1_0+expat+hdf4+hdf5+netcdf

I would use gdal 2.1, but the current py27-gdal port is version 2.0.1_0. I'm not sure if it could be related. I was getting the message:

NUMPY driver was compiled against GDAL 2.0 but current library version is 2.1

and unable to open anything until I reactivated the old 2.0.1 port. Does anyone know what my issue is?

Attachments (2)

Portfile-kealib.diff (1.6 KB) - added by ForTozs 6 years ago.
Portfile-kealib.diff
Portfile-kealib-gcc7.diff (1.5 KB) - added by ForTozs 6 years ago.
Portfile-kealib-gcc7.diff

Download all attachments as: .zip

Change History (15)

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: vince@… removed
Owner: changed from macports-tickets@… to vince@…

Does rebuilding kealib help?

sudo port -ns upgrade --force kealib

If so, we may need to increase kealib's revision to rebuild it on the server.

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

Wait... you have deliberately downgraded gdal to version 2.0.1? We can't help you if you do that. Please upgrade gdal back to the latest version provided by MacPorts, and upgrade all other ports shown by port outdated, then test kealib again.

If py-gdal needs to be updated to a newer version, please file a separate ticket about that.

comment:3 in reply to:  1 Changed 8 years ago by ForTozs

Replying to ryandesign@…:

Does rebuilding kealib help?

sudo port -ns upgrade --force kealib

If so, we may need to increase kealib's revision to rebuild it on the server.

Rebuilding did not help. I will get a ticket going on py-gdal if there still isn't an upgraded port and get back with you. Thanks.

comment:4 in reply to:  2 Changed 8 years ago by ForTozs

Replying to ryandesign@…:

Wait... you have deliberately downgraded gdal to version 2.0.1? We can't help you if you do that. Please upgrade gdal back to the latest version provided by MacPorts, and upgrade all other ports shown by port outdated, then test kealib again.

If py-gdal needs to be updated to a newer version, please file a separate ticket about that.


It looks like I might need to wait for an update to py-gdal. I was able to install the python gdal 2.1.0 bindings through pip. Then I reinstalled kealib. However, in Python I get a similar message as before this time complaining about kealib:

ERROR 1: KEA was compiled against GDAL 2.0 but current library version is 2.1

This is strange to me. I did attempt to compile kealib from source before, so I've looked all over my computer but haven't found any traces of previous kealib or gdal installations. Now when I try

sudo port -ns upgrade --force kealib

I get build failure with:

Error: org.macports.build for port kealib returned: command execution failed
Please see the log file for port kealib for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_kealib/kealib/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

I'm not sure if that is expected or not.

comment:5 Changed 8 years ago by ForTozs

I patched py27-gdal to 2.1.0. I am still receiving the same error in Python.

comment:6 Changed 7 years ago by ForTozs

Is is possible this is related to HDF5? I am able to get it to compile further by deactivating hdf5, specifying the depend as hdf5-18 in the port file, and setting

configure.args-append   -DGDAL_INCLUDE_DIR=${prefix} \
                        -DGDAL_LIB_PATH=${prefix} \
                        -DHDF5_INCLUDE_DIR=${prefix}/lib/hdf5-18/include \
                        -DHDF5_LIB_PATH=${prefix}/lib/hdf5-18/lib

However, I still get an error starting here...

[ 38%] Linking CXX shared library libkea.dylib
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_kealib/kealib/work/kealib-1.4.4/trunk/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/kea.dir/link.txt --verbose=ON
/usr/bin/clang++ -pipe -Os -stdlib=libc++ -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -DNDEBUG -DNDEBUG -arch x86_64 -mmacosx-version-min=10.12 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -compatibility_version 1.4.4 -current_version 1.4.4 -o libkea.1.4.4.dylib -install_name /opt/local/lib/libkea.1.4.4.dylib CMakeFiles/kea.dir/libkea/KEAImageIO.cpp.o CMakeFiles/kea.dir/libkea/KEAAttributeTable.cpp.o CMakeFiles/kea.dir/libkea/KEAAttributeTableInMem.cpp.o CMakeFiles/kea.dir/libkea/KEAAttributeTableFile.cpp.o -Wl,-rpath,/opt/local/lib -L/opt/local/lib/hdf5-18/lib -lhdf5 -lhdf5_hl -lhdf5_cpp 
Undefined symbols for architecture x86_64:
  "H5::H5File::H5File(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)", referenced from:
      kealib::KEAImageIO::createKEAImage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, kealib::KEADataType, unsigned int, unsigned int, unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*, kealib::KEAImageSpatialInfo*, unsigned int, unsigned int, int, unsigned long long, unsigned long long, double, unsigned long long, unsigned long long, unsigned int) in KEAImageIO.cpp.o

And perhaps the fact that kealib is broke is part of the problem with rsgislib. I'd love to get these ports up and running again.

comment:7 Changed 6 years ago by ForTozs

I think there was something related to hdf, along with a few other things since the latest version of kealib. Please find my attached patch to see what I have done. I can get it to build now, but unfortunately, it is still not working with gdal. I have set GDAL_DRIVER_PATH to /opt/local/lib/gdalplugins.

$ gdalinfo --formats | grep KEA
 KEA -raster- (w+): KEA Image Format (.kea)

$ gdalinfo test.kea
ERROR 4: `test.kea' not recognized as a supported file format.

I am not a port developer, so please excuse my manual assignments for the linker. Perhaps you have a more elegant way. Also, it would not build with clang so I had to use gcc instead. Maybe what I've done can be of some help getting this port going again. Please let me know if you have any ideas. I will try some newer versions of gcc and see if I have any better luck.

Changed 6 years ago by ForTozs

Attachment: Portfile-kealib.diff added

Portfile-kealib.diff

comment:8 Changed 6 years ago by ForTozs

Well, I can't say for sure if it was a compiler issue, because I also realized that I was missing the fftw dependency, but reinstalling all dependencies with the same gcc compiler seems to have done the trick! The earlier patch was specific to gcc 5, but I decided to switch to gcc 7.2 while I was at it. I'm attaching the gcc7 version of the patch here. Hopefully, someone can implement this in a much more elegant way than this rough patch, but I'm happy to have kealib back.

Changed 6 years ago by ForTozs

Attachment: Portfile-kealib-gcc7.diff added

Portfile-kealib-gcc7.diff

comment:9 Changed 6 years ago by Veence (Vincent)

I’m going to dive into this in the very next days. Life has been really hectic for me lately, but I’m beginning to see the light out of the tunnel, so I think I’ll be able to devote a couple of hours to fixing KEA this weekend or next week at worse. Thanks for all the work.

comment:10 Changed 6 years ago by ForTozs

Sounds great. Thank you.

comment:11 Changed 6 years ago by Veence (Vincent)

I have committed a new Portfile (1.4.7). It seems to work

gdalinfo --formats | grep KEA
  KEA -raster- (rw+): KEA Image Format (.kea)

and

gdalinfo /Users/vincent/Downloads/utm.kea
Driver: KEA/KEA Image Format (.kea)
Files: /Users/vincent/Downloads/utm.kea
Size is 512, 512
Coordinate System is:
PROJCS["NAD27 / UTM zone 11N",
    GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke 1866",6378206.4,294.9786982139006,
                AUTHORITY["EPSG","7008"]],
            AUTHORITY["EPSG","6267"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4267"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26711"]]
Origin = (440720.000000000000000,3751320.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  (  440720.000, 3751320.000) (117d38'28.21"W, 33d54' 8.47"N)
Lower Left  (  440720.000, 3720600.000) (117d38'20.79"W, 33d37'31.04"N)
Upper Right (  471440.000, 3751320.000) (117d18'32.07"W, 33d54'13.08"N)
Lower Right (  471440.000, 3720600.000) (117d18'28.50"W, 33d37'35.61"N)
Center      (  456080.000, 3735960.000) (117d28'27.39"W, 33d45'52.46"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Gray
  Metadata:
    LAYER_TYPE=athematic
    STATISTICS_HISTONUMBINS=0

comment:12 Changed 6 years ago by ForTozs

This is great! I had to reinstall all the dependencies (hdf, gdal) with the default compiler to get it to work, but it is working now. Thanks a ton.

comment:13 Changed 6 years ago by Veence (Vincent)

Resolution: fixed
Status: newclosed

You’re most welcome. Happy it works.

Note: See TracTickets for help on using tickets.