-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 error when install pybufr-ecmwf on ubuntu #14
Comments
Thanks for your report. Just a few questions to make the problem more clear. Best regards, |
Thanks. |
@jdkloe however, it seems that NCEP bufr file can not be opened since it is designed for ecmwf? |
Thanks for reporting back. I still would be interested to now what the conditions where in which the install failed. Maybe I can improve something. As for the NCEP BUFR file, I will have to investigate what is happening here. Could you provide me with a sample file or provide the url where it can be found? |
@jdkloe the NCEP BUFR file can be downloaded from the following url, |
After some testing I can report that the bufr files from ucar are currently not compatible with the ECMWF bufr reading software. I tried both the old bufrdc and the new eccodes library, and both fail. |
@jdkloe It is so nice of you to offer me some help.
` |
mmm, this is not very clear. |
@jdkloe Thanks a lot for your kindness. |
Thanks again for sharing your solution. |
I have noticed the same InterfaceBuildError on Ubuntu 16.04. I have tried intel and gnu compilers as well as specifying -fPIC. F2py is installed. The following is how I have attempted to install from pypi via pip.
These are the version(s) of numpy I tried: |
thanks for your report.
Very important is that python, numpy and pybufr-ecmwf are all compiled using the same version of the gcc/gfortran compiler, otherwise it will fail. |
This is probably what is going on. I am pip installing numpy rather than using the distribution's numpy, but I am using the distribution's gfortran (or our licensed version of Intel fortran) and the distribution's python/python-dev. I am also using the full |
I have the same error. Using built-in specs.
Command "/opt/python3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-req-build-l3ef8mvm/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-fupw7xhy/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-req-build-l3ef8mvm/ |
@acrosby thanks for reporting back. I'll have to see if I can reproduce the problem when installing numpy from pip in stead of from the distribution repository. |
@zengxiaoqing thanks for your report. |
@zengxiaoqing |
python3 It's my own installation, The system comes with python2.7.5 |
I use the following statement to install, rm -rf $SOURCE_PATH/pybufr-ecmwf-master In the end I found the cause of the error: File "setup.py", line 322, in build_extension How to solve this error |
@zengxiaoqing Again I must emphasize that the key is to use the same compiler (gcc and gfortran) that was used to compile the python interpreter and numpy. If you have no choice and need to use CentOS (or RedHat) try this: You best start with the most recent version of pybufr-ecmwf, downloaded as zip file from github. This creates and tests the python2 version installed as root:
This creates and tests the python2 version installed as a normal user:
This creates and tests the python3 version installed as root based on miniconda:
This creates and tests the python3 version installed as a normal user based on minconda:
I hope this will be helpful for you. |
@jdkloe Hi. When I tried install your library onto docker, how your write right here, I get a error. I use: alembic, python 3.7.2, gcc and gfortran have same version(8.2.0-r2), I installed numpy(numpy.f2py is caused), but with pip, or manual installed I got an error: |
Hi @DivinytyToffee, For your information, I just reran the build for the last Docker recipe that I provided above, using centos-7 and conda, doing the install as unprivileged user, and it still runs just fine on my side. |
@jdkloe.
|
Hi @DivinytyToffee, for the docker base image that you tried to use this cannot work. You used python:3.7.2-alpine3.9 However, pybufr-ecmwf needs numpy and numpy-f2py to be installed. Alpine provides only the 3.6 packages for these dependencies, so that is not enough. As alternative I looked at alpine:3.8 and tried to create a Docker file that installs pybufr-ecmwf in it using pip3. For this image python3.6 and numpy and numpy.f2py are available, so that part is easy. Unfortunately there are some other issues to be solved. The alpine packages py3-numpy and py3-numpy-f2py seem not complete (that is a packaging bug in my opinion). They do not contain header and c files needed for f2py to correctly build this fortran module. f2py_src.tar.gz A next problem seems that gcc does not like some of the c code contained in pybufr-ecmwf. If I give the setup.py script the option --c-flags "--std=c99" it works, but I cannot get pip to pass the option to setup.py, so I split the install in 3 steps. First I use pip3 to download the module, and then I use 2 calls to setup.py to do the build and install. This seems to work well now. This is the Docker file I used for testing:
|
@jdkloe, I'm very grateful for your help! You saved my ass from writing a BUFR decoder.
|
Executing command: python3 ./run_f2py_tool.py --build-dir f2py_build --f90flags='-fno-second-underscore -O -Dlinux -fPIC' --f77flags='-fno-second-underscore -O -Dlinux -fPIC' --fcompiler=gfortran ./f2py_build/signatures.pyf -L./ -lbufr -c 2>1 >> f2py_build.log
ERROR: build of python wrapper failed
the compilation or linking stage failed
..................................................................
..................................................................
..........................................................
Executing command: python3 ./run_f2py_tool.py --build-dir f2py_build --f90flags='-fno-second-underscore -O -Dlinux -fPIC' --f77flags='-fno-second-underscore -O -Dlinux -fPIC' --fcompiler=gfortran ./f2py_build/signatures.pyf -L./ -lbufr -c 2>1 >> f2py_build.log
ERROR: build of python wrapper failed
the compilation or linking stage failed
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-3dy3x23o/pybufr-ecmwf/setup.py", line 410, in
provides=["pybufr_ecmwf"])
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/zhangqw/anaconda3/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/command/install.py", line 539, in run
self.run_command('build')
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-3dy3x23o/pybufr-ecmwf/setup.py", line 119, in run
_build.run(self)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/zhangqw/anaconda3/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/tmp/pip-build-3dy3x23o/pybufr-ecmwf/setup.py", line 318, in build_extension
ibi.build()
File "/tmp/pip-build-3dy3x23o/pybufr-ecmwf/build_interface.py", line 878, in build
self.generate_python_wrapper(source_dir)
File "/tmp/pip-build-3dy3x23o/pybufr-ecmwf/build_interface.py", line 1856, in generate_python_wrapper
raise InterfaceBuildError
pybufr_ecmwf.custom_exceptions.InterfaceBuildError
Command "/home/zhangqw/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-3dy3x23o/pybufr-ecmwf/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-ucj91k6_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-3dy3x23o/pybufr-ecmwf/
The text was updated successfully, but these errors were encountered: