From: Peter K. <pet...@wa...> - 2013-11-22 18:58:35
|
Hi Ryan, dylib is the equivalent of so files on other unix systems. The linker should find the library just fine if it is indeed located under /opt/local/lib/libmfhdf.dylib. I don't know why it does not. The best I can think of is to add a verbose flag to the linker to get a more detailed error report. A patch is attached. It can be applied with: patch < ccplot-verbose-link.diff in the ccplot directory. If you can send me the build output that would be great. Regards, Peter On 11/22/2013 06:47 PM, Ryan Scott wrote: > Hi Peter, > > After receiving the same error with the up-to-date ccplot-master, I > checked /opt/local/lib and I have the following libmfhdf* files > > libmfhdf.0.dylib > libmfhdf.a > libmfhdf.dylib > libmfhdf.la <http://libmfhdf.la> > > The lack of the libmfhdf.so file is presumably then the root of the > error. Do you know where this can be obtained? > > Best, Ryan > > > > On Thu, Nov 21, 2013 at 11:53 PM, Peter Kuma <pet...@wa... > <mailto:pet...@wa...>> wrote: > > Hi Ryan, > > I think this could be a similar problem as with the include path. The > solution depends on where the libmfhdf.so library is, I assume it is > /opt/local/lib. Please try adding the path to hdf_library_dirs in > setup.py: > > - hdf_library_dirs = [] > + hdf_library_dirs = ['/opt/local/lib'] > > (line 25) > > Or, if it does not work, please try locate libmfhdf.so. > > The current master incorporates both fixes for the include path and > MAX_VAR_DIMS. > > Regards, > > Peter > > On 11/22/2013 01:38 AM, Ryan Scott wrote: > > Hello Peter, > > > > I have attempted to build both ccplot-master as well as > ccplot-1.5-rc7, > > ensuring that hdf.c everywhere reads H4_MAX_VAR_DIMS where necessary. > > However, still no luck on the build. > > > > Here is the output from my latest try: > > > > bash-3.2$ python setup.py build > > running build > > running build_py > > running build_ext > > skipping 'ccplot/hdf.c' Cython extension (up-to-date) > > building 'ccplot.hdf' extension > > clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe > -fno-common > > -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX > > -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os > > -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 > > -I/Users/ryan/Desktop/src/boost_1_53_0 -pipe -I/usr/include/hdf > > -I/usr/local/include/hdf -I/opt/local/include > > > -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include > > > -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 > > -c ccplot/hdf.c -o build/temp.macosx-10.8-intel-2.7/ccplot/hdf.o > > clang: warning: argument unused during compilation: '-mno-fused-madd' > > In file included from ccplot/hdf.c:314: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:14: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:26: > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__multiarray_api.h:1532:1: > > warning: > > unused function '_import_array' [-Wunused-function] > > _import_array(void) > > ^ > > In file included from ccplot/hdf.c:315: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ufuncobject.h:152: > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__ufunc_api.h:226:1: > > warning: > > unused function '_import_umath' [-Wunused-function] > > _import_umath(void) > > ^ > > 2 warnings generated. > > In file included from ccplot/hdf.c:314: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:14: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:26: > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__multiarray_api.h:1532:1: > > warning: > > unused function '_import_array' [-Wunused-function] > > _import_array(void) > > ^ > > In file included from ccplot/hdf.c:315: > > In file included from > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ufuncobject.h:152: > > > /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__ufunc_api.h:226:1: > > warning: > > unused function '_import_umath' [-Wunused-function] > > _import_umath(void) > > ^ > > 2 warnings generated. > > clang -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch > x86_64 > > -L/Users/ryan/Desktop/src/hdf5-1.8.10/hdf5/lib > > -I/Users/ryan/Desktop/src/boost_1_53_0 > > build/temp.macosx-10.8-intel-2.7/ccplot/hdf.o -lmfhdf -ldf -ljpeg > -lz -o > > build/lib.macosx-10.8-intel-2.7/ccplot/hdf.so > > ld: library not found for -lmfhdf > > clang: error: linker command failed with exit code 1 (use -v to see > > invocation) > > error: command 'clang' failed with exit status 1 > > > > Hopefully this is also an easy fix. Best, > > > > Ryan > > > > > > On Thu, Nov 21, 2013 at 2:10 PM, Peter Kuma > <pet...@wa... <mailto:pet...@wa...> > > <mailto:pet...@wa... <mailto:pet...@wa...>>> > wrote: > > > > Hi Ryan, > > > > Thanks for the follow-up. It is nice to hear you find ccplot > useful. > > > > I was afraid there may be more problems. I'm sure other mac > users will > > be happy to see this sorted out. > > > > The reason is that MAX_VAR_DIMS is only available when HDF4 > was compiled > > with netcdf-3 compatibility. It should be easy to fix by > replacing all > > occurrences of MAX_VAR_DIMS with H4_MAX_VAR_DIMS. > > > > Please try an updated version from github: > > > > https://github.com/peterkuma/ccplot/archive/master.zip > > > > Regards, > > > > Peter > > > > On 11/21/2013 09:37 PM, Ryan Scott wrote: > > > Hello Peter, > > > > > > I very much appreciate the timely response and your > willingness to > > help. > > > I was happy to see that a new version of ccplot was > available without > > > the PyNIO dependency, which has prevented me from using it > in the > > past. > > > ccplot appears to be far superior than what is possible using > > Matlab and > > > NCAR Command Language! > > > > > > I have modified line 24 of setup.py to reflect > '/opt/local/include' as > > > well, and I no longer receive the error regarding hntdefs.h. > > > > > > Unfortunately, though I'm presented with a new error. To > give you as > > > much detail as possible, here's the new issue: > > > > > > "bash-3.2$ python setup.py build > > > running build > > > running build_py > > > running build_ext > > > skipping 'ccplot/hdf.c' Cython extension (up-to-date) > > > building 'ccplot.hdf' extension > > > clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe > > -fno-common > > > -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE > -DMACOSX > > > -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 > -DNDEBUG -g -Os > > > -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch > x86_64 > > > -I/Users/ryan/Desktop/src/boost_1_53_0 -pipe -I/usr/include/hdf > > > -I/usr/local/include/hdf -I/opt/local/include > > > > > > -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include > > > > > > -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 > > > -c ccplot/hdf.c -o build/temp.macosx-10.8-intel-2.7/ccplot/hdf.o > > > clang: warning: argument unused during compilation: > '-mno-fused-madd' > > > ccplot/hdf.c:5266:30: error: use of undeclared identifier > > 'MAX_VAR_DIMS' > > > __pyx_t_1 = PyInt_FromLong(MAX_VAR_DIMS); if > (unlikely(!__pyx_t_1)) > > > {__pyx_filename =... > > > ^ > > > ccplot/hdf.c:7066:30: error: use of undeclared identifier > > 'MAX_VAR_DIMS' > > > __pyx_t_1 = PyInt_FromLong(MAX_VAR_DIMS); if > (unlikely(!__pyx_t_1)) > > > {__pyx_filename =... > > > ^ > > > 2 errors generated. > > > error: command 'clang' failed with exit status 1" > > > > > > Perhaps there is an easy fix? > > > > > > Best, > > > > > > -Ryan > > > > > > > > > > > > > > > > > > > > > On Thu, Nov 21, 2013 at 12:11 AM, Peter Kuma > > <pet...@wa... <mailto:pet...@wa...> > <mailto:pet...@wa... <mailto:pet...@wa...>> > > > <mailto:pet...@wa... > <mailto:pet...@wa...> <mailto:pet...@wa... > <mailto:pet...@wa...>>>> > > wrote: > > > > > > On 11/21/2013 02:07 AM, ryan scott wrote: > > > > I have installed all dependencies for ccplot. However, > when > > > attempting to build ccplot before installation, I > receive the > > > following error message: > > > > > > > > "ccplot/hdf.c:317:10: fatal error: 'hntdefs.h' file > not found > > > > #include "hntdefs.h" > > > > ^ > > > > 1 error generated. > > > > error: command 'clang' failed with exit status 1" > > > > > > > > I do, however, have the hdf4 library installed (via > > MacPorts), the > > > following > > > > > > > > bash-3.2$ locate hntdefs.h > > > > /opt/local/include/hntdefs.h > > > > > > > > shows that I do have this file. Could anyone please > point me in > > > the right direction? > > > > > > > > Any help is very much appreciated. Thanks, > > > > > > > > Ryan > > > > > > Dear Ryan, > > > > > > Sorry - I think this is a problem with ccplot rather > than your > > > configuration. It assumes that hdf is available under either > > > /usr/include/hdf or /usr/local/include/hdf, which is a valid > > assumption > > > on linux, but not on mac. For now, could you please just add > > the path to > > > hdf_include_dirs in setup.py? > > > > > > - hdf_include_dirs = ['/usr/include/hdf', > > '/usr/local/include/hdf'] > > > + hdf_include_dirs = ['/usr/include/hdf', > > '/usr/local/include/hdf', > > > '/opt/local/include'] > > > > > > (line 24) > > > > > > Unfortunately, I don't have access to a mac system for > testing > > now, so I > > > would not find out. Hopefully, darwin will be good > enough for > > this. I'll > > > try to fix these issues soon. > > > > > > Thank you very much for reporting the problem. > > > > > > Regards, > > > > > > Peter > > > > > > > > > > > > |