building pynetcdf-0.7 on OS X 10.4 intel
OS X 10.4.9, python 2.5, numpy 1.0.3.dev3726, netcdf 3.6.2 I am trying to build pynetcdf-0.7, so as to be able to read netCDF files from python 2.5/numpy . So far I have not had success. Enclosed is the dump of my most recent failure - the complaint comes from the linker since the linker has both a powerPC (ppc) and an intel (i386) flag. I guess that what is being attempted is a universal build ( both ppc and i386) but failing. Apparently my netcdf build was just i386 - although I did nothing special. I am at a loss as to what to do next - this might be a question for an Mac specialist - but I figured I'd try here first. --Jim [krait:~/Desktop/pynetcdf-0.7] boyle5% python setup.py build running build running config_fc running build_src building extension "pynetcdf._netcdf" sources building data_files sources running build_py creating build creating build/lib.macosx-10.3-fat-2.5 creating build/lib.macosx-10.3-fat-2.5/pynetcdf copying ./__init__.py -> build/lib.macosx-10.3-fat-2.5/pynetcdf copying ./NetCDF.py -> build/lib.macosx-10.3-fat-2.5/pynetcdf copying ./netcdf_demo.py -> build/lib.macosx-10.3-fat-2.5/pynetcdf running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext building 'pynetcdf._netcdf' extension compiling C sources C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fPIC -fno-common -dynamic -DNDEBUG -g -O3 -Wall - Wstrict-prototypes creating build/temp.macosx-10.3-fat-2.5 compile options: '-I/Users/boyle5/netcdf-3.6.2/include -I/Library/ Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ numpy/core/include -I/Library/Frameworks/Python.framework/Versions/ 2.5/include/python2.5 -c' gcc: ./_netcdf.c ./_netcdf.c: In function 'PyNetCDFFile_Close':./_netcdf.c: In function 'PyNetCDFFile_Close': ./_netcdf.c:965: warning: passing argument 2 of 'PyDict_Next' from incompatible pointer type./_netcdf.c:965: warning: passing argument 2 of 'PyDict_Next' from incompatible pointer type ./_netcdf.c: In function 'PyNetCDFVariableObject_subscript': ./_netcdf.c:1822: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1822: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1822: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c: In function 'PyNetCDFVariableObject_subscript': ./_netcdf.c:1822: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1822: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1822: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1842: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c: In function 'PyNetCDFVariableObject_ass_subscript': ./_netcdf.c:1944: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1944: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1944: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c: In function 'PyNetCDFVariableObject_ass_subscript': ./_netcdf.c:1944: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1944: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1944: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 3 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 4 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c:1964: warning: passing argument 5 of 'PySlice_GetIndices' from incompatible pointer type ./_netcdf.c: At top level: ./_netcdf.c:2009: warning: initialization from incompatible pointer type ./_netcdf.c:2011: warning: 'intargfunc' is deprecated ./_netcdf.c:2011: warning: initialization from incompatible pointer type ./_netcdf.c:2012: warning: 'intargfunc' is deprecated ./_netcdf.c:2012: warning: initialization from incompatible pointer type ./_netcdf.c:2013: warning: 'intintargfunc' is deprecated ./_netcdf.c:2013: warning: initialization from incompatible pointer type ./_netcdf.c:2014: warning: initialization from incompatible pointer type ./_netcdf.c:2015: warning: initialization from incompatible pointer type ./_netcdf.c:2019: warning: initialization from incompatible pointer type ./_netcdf.c: At top level: ./_netcdf.c:2009: warning: initialization from incompatible pointer type ./_netcdf.c:2011: warning: 'intargfunc' is deprecated ./_netcdf.c:2011: warning: initialization from incompatible pointer type ./_netcdf.c:2012: warning: 'intargfunc' is deprecated ./_netcdf.c:2012: warning: initialization from incompatible pointer type ./_netcdf.c:2013: warning: 'intintargfunc' is deprecated ./_netcdf.c:2013: warning: initialization from incompatible pointer type ./_netcdf.c:2014: warning: initialization from incompatible pointer type ./_netcdf.c:2015: warning: initialization from incompatible pointer type ./_netcdf.c:2019: warning: initialization from incompatible pointer type ./_netcdf.c: In function 'PyNetCDFVariable_WriteArray': ./_netcdf.c:1626: warning: 'lastloop' may be used uninitialized in this function ./_netcdf.c: In function 'PyNetCDFVariable_WriteArray': ./_netcdf.c:1626: warning: 'lastloop' may be used uninitialized in this function gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk - bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/ _netcdf.o -L/Users/boyle5/netcdf-3.6.2/lib -lnetcdf -o build/ lib.macosx-10.3-fat-2.5/pynetcdf/_netcdf.so /usr/bin/ld: for architecture ppc /usr/bin/ld: warning /Users/boyle5/netcdf-3.6.2/lib/libnetcdf.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it) [krait:~/Desktop/pynetcdf-0.7] boyle5% python ActivePython 2.5.0.0 (ActiveState Software Inc.) based on Python 2.5 (r25:51908, Mar 9 2007, 17:40:37) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.__version__ '1.0.3.dev3726'
James Boyle wrote:
I am trying to build pynetcdf-0.7, so as to be able to read netCDF files from python 2.5/numpy .
Sorry for the shameless plug, but if you only want to read netCDF files from numpy you can use a pure python netcdf reader that I wrote, called pupynere: http://cheeseshop.python.org/pypi/pupynere/ Best, --Rob
On Wed, 02 May 2007, Rob De Almeida apparently wrote:
I do not think you were "shameless" enough. Pupynere is a PUre PYthon NEtcdf REader. It allows read-access to netCDF files using the same syntax as the Scientific.IO.NetCDF module. Even though it's written in Python, the module is up to 40% faster than Scientific.IO.NetCDF and pynetcdf. Mentioning the MIT license is also worthwhile. Cheers, Alan Isaac
On Wed, May 2, 2007 23:36, James Boyle wrote:
OS X 10.4.9, python 2.5, numpy 1.0.3.dev3726, netcdf 3.6.2
/usr/bin/ld: warning /Users/boyle5/netcdf-3.6.2/lib/libnetcdf.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
NOT having any experience on Macs, but doesn't the above error message suggest that your netCDF library has been build for a i386 instead of a ppc? Could that be the problem? Can you run the ncdump and ncgen executables from the same netCDF distribution? Just a thought, Christian.
On 02.05.2007, at 23:36, James Boyle wrote:
So far I have not had success. Enclosed is the dump of my most recent failure - the complaint comes from the linker since the linker has both a powerPC (ppc) and an intel (i386) flag. I guess that what is being attempted is a universal build ( both ppc and i386) but failing. Apparently my netcdf build was just i386 - although I did nothing special.
A standard netCDF build on the Mac is single-architecture. I haven't seen instructions yet for making a universal binary on the Mac. MacPython builds its extensions as universal binaries, so the linker complains about the missing netCDF code for the other processor. However, if all you care about is using netCDF on the machine that you build on, you can safely ignore that warning. The Python extension module should work fine. Note also that pynetcdf is not based on the latest release of the ScientificPython code, which contains various bug fixes. You might be better off using ScientificPython 2.7, which works pretty well with NumPy these days. Konrad. -- --------------------------------------------------------------------- Konrad Hinsen Centre de Biophysique Moléculaire, CNRS Orléans Synchrotron Soleil - Division Expériences Saint Aubin - BP 48 91192 Gif sur Yvette Cedex, France Tel. +33-1 69 35 97 15 E-Mail: hinsen@cnrs-orleans.fr ---------------------------------------------------------------------
participants (5)
-
Alan G Isaac
-
Christian Marquardt
-
James Boyle
-
Konrad Hinsen
-
Rob De Almeida