Comments (22)
Thank you, that was very helpful. It seems that somehow the file header file "strings.h" is conflicting with the system include file "strings.h" when "Python.h" is included. I imagine that the system "string.h" includes "strings.h" on line 45.
I find it interesting that this did not occur on any other system I compiled on.
I will create a PR and ask you to validate that the port is successful once that has been completed.
from fastnumbers.
Please provide more information, such as the compiler used, and what steps were take before initializing compilation. Just looking at the code I cannot see why this error would occur.
from fastnumbers.
Compiler is clang-6.0
Configure is done with:
(cd /usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0; /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/py-fastnumbers/work-py27 XDG_CONFIG_HOME=/usr/ports/devel/py-fastnumbers/work-py27 HOME=/usr/ports/devel/py-fastnumbers/work-py27 PATH=/usr/ports/devel/py-fastnumbers/work-py27/.bin:.:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED="cc -shared" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing" CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer" LDFLAGS=" -fstack-protector" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" /usr/local/bin/python2.7 -c "import sys; import setuptools; __file__='setup.py'; sys.argv[0]='setup.py'; exec(compile(open(__file__, 'rb').read().replace(b'\\r\\n', b'\\n'), __file__, 'exec'))" config )
Build is done with:
(cd /usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0; /usr/bin/env XDG_DATA_HOME=/usr/ports/devel/py-fastnumbers/work-py27 XDG_CONFIG_HOME=/usr/ports/devel/py-fastnumbers/work-py27 HOME=/usr/ports/devel/py-fastnumbers/work-py27 PATH=/usr/ports/devel/py-fastnumbers/work-py27/.bin:.:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED="cc -shared" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing" CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer" LDFLAGS=" -fstack-protector" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" /usr/local/bin/python2.7 -c "import sys; import setuptools; __file__='setup.py'; sys.argv[0]='setup.py'; exec(compile(open(__file__, 'rb').read().replace(b'\\r\\n', b'\\n'), __file__, 'exec'))" build )
Nothing has changed compilation-wise.
from fastnumbers.
If you just enter
python setup.py build
on the command-line (without setting all the environment variables) does it work? Does it work if you use tox
?
I have built successfully with gcc, clang, and mscv, so I am very surprised with this compilation error. Especially considering that in options.h
the line #include <Python.h>
appears before the line with the error, so PyObject
should be defined.
Are you 100% sure that cc
is clang on your machine? Additionally, I still donβt have enough information to debug. It would be helpful if the entire build log were added to this issue.
from fastnumbers.
I would like to try and replicate this. Can you add a link to the build script being used to by the FreeBSD port to build fastnumbers?
from fastnumbers.
The problem occurs in the FreeBSD port. The easiest way to replicate is to install FreeBSD into a VirtualBox VM with ports, update the version in the port for py-fastnumbers and run make makesum build
.
from fastnumbers.
Is this something that will require a fix from fastnumbers
, or will the port itself be updated?
from fastnumbers.
I can't update the port because of this regression. The fix should be in the fastnumbers itself, imo.
from fastnumbers.
Why does it only fail in the port? Did you perform the experiment that I requested and checked if it worked with tox
or python setup.py build
(e.g. outside the port)?
Is there no link the source code of the port?
from fastnumbers.
Can you provide the entire build log?
from fastnumbers.
By any chance, is this compiling in a C++ mode instead of C?
from fastnumbers.
Build log:
$ make
===> License MIT accepted by the user
===> py27-fastnumbers-2.1.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by py27-fastnumbers-2.1.0 for building
===> Extracting for py27-fastnumbers-2.1.0
=> SHA256 Checksum OK for fastnumbers-2.1.0.tar.gz.
===> Patching for py27-fastnumbers-2.1.0
===> py27-fastnumbers-2.1.0 depends on package: py27-setuptools>0 - found
===> py27-fastnumbers-2.1.0 depends on file: /usr/local/bin/python2.7 - found
===> Configuring for py27-fastnumbers-2.1.0
running config
===> Building for py27-fastnumbers-2.1.0
running build
running build_ext
building 'fastnumbers' extension
creating build
creating build/temp.freebsd-11.2-STABLE-amd64-2.7
creating build/temp.freebsd-11.2-STABLE-amd64-2.7/src
cc -DNDEBUG -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -fPIC -I/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include -I/usr/local/include/python2.7 -c src/fastnumbers.c -o build/temp.freebsd-11.2-STABLE-amd64-2.7/src/fastnumbers.o
In file included from src/fastnumbers.c:7:
In file included from /usr/local/include/python2.7/Python.h:38:
In file included from /usr/include/string.h:45:
In file included from /usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/strings.h:9:
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:15:5: error: unknown type name 'PyObject'
PyObject *retval;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:16:5: error: unknown type name 'PyObject'
PyObject *input;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:17:5: error: unknown type name 'PyObject'
PyObject *key;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:18:5: error: unknown type name 'PyObject'
PyObject *handle_inf;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:19:5: error: unknown type name 'PyObject'
PyObject *handle_nan;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:20:5: error: unknown type name 'PyObject'
PyObject *coerce;
^
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/options.h:21:5: error: unknown type name 'PyObject'
PyObject *num_only;
It's building with C compiler.
from fastnumbers.
@yurivict Please test out the code in pull request #19.
from fastnumbers.
Now it fails in a different way:
In file included from /usr/include/string.h:45:
/usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/strings.h:9:10: fatal error: 'fastnumbers/options.h' file not found
#include "fastnumbers/options.h"
^~~~~~~~~~~~~~~~~~~~~~~
from fastnumbers.
I would expect /usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/strings.h
to be /usr/ports/devel/py-fastnumbers/work-py27/fastnumbers-2.1.0/include/fastnumbers/strings.h
. Is the port some how flattening the include
directory?
from fastnumbers.
$ find . -name strings.h
./work-py27/fastnumbers-2.1.0/include/strings.h
from fastnumbers.
I understand that that is what you are seeing on your machine, but if you look at the GitHub page on this branch you will see that there is no content in the include
folder. Everything was moved to include/fastnumbers
.
https://github.com/SethMMorton/fastnumbers/tree/avoid-header-name-collisions/include/fastnumbers
How is it then that you see no fastnumbers
directory in include
?
from fastnumbers.
It takes the distfile from PyPI from this URL: https://pypi.org/packages/source/f/fastnumbers/fastnumbers-2.1.0.tar.gz
This tarball doesn't have fastnumbers
directory in include.
from fastnumbers.
That is expected - I have not released this to PyPI, so these changes would not be in the version released there. Can you not test the port from a git branch?
from fastnumbers.
Revision c36b8ed builds fine.
Just make another release then from this branch.
from fastnumbers.
Great! Thank you. I will release this as 2.1.1 tomorrow.
from fastnumbers.
Thank you!
from fastnumbers.
Related Issues (20)
- Unit test numeric issues on 32bit arm CPU HOT 3
- Speed not better than Python's int/float HOT 6
- Make most options keyword-only
- Rename "key" option to "on_fail"
- [BUG] FastNumbers can crash with a SystemError due to returning NULL without setting an exception HOT 5
- Fastest way to check is and object is int or float in one pass HOT 14
- Proposal: change behavior of isfloat with respect to treatment of float("nan") HOT 19
- Proposal: change behavior of isfloat function with respect to treatment of strings containing integers HOT 3
- Proposal: Do not raise an exception on None HOT 5
- python3.9 compatibility HOT 5
- Re-write using C++ and pybind11
- Add support to release Linux aarch64 wheels HOT 1
- Broken 3.2.0 installation
- Missing -lm breaks build on armv7hl
- Error: <built-in function isint/isfloat> returned NULL without setting an error HOT 2
- Use fast C++ methods like std::from_chars or fast_float HOT 1
- Improve performance with METH_FASTCALL
- Add support for operating on iterables
- Add numpy support? HOT 2
- Big numbers handling: silencing arbitrary digits beyond least significant bit HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastnumbers.