Giter Club home page Giter Club logo

Comments (22)

SethMMorton avatar SethMMorton commented on May 24, 2024 1

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

yurivict avatar yurivict commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

yurivict avatar yurivict commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

Is this something that will require a fix from fastnumbers, or will the port itself be updated?

from fastnumbers.

yurivict avatar yurivict commented on May 24, 2024

I can't update the port because of this regression. The fix should be in the fastnumbers itself, imo.

from fastnumbers.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

Can you provide the entire build log?

from fastnumbers.

SethMMorton avatar SethMMorton commented on May 24, 2024

By any chance, is this compiling in a C++ mode instead of C?

from fastnumbers.

yurivict avatar yurivict commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

@yurivict Please test out the code in pull request #19.

from fastnumbers.

yurivict avatar yurivict commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

yurivict avatar yurivict commented on May 24, 2024
$ find . -name strings.h
./work-py27/fastnumbers-2.1.0/include/strings.h

from fastnumbers.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

yurivict avatar yurivict commented on May 24, 2024

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.

SethMMorton avatar SethMMorton commented on May 24, 2024

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.

yurivict avatar yurivict commented on May 24, 2024

Revision c36b8ed builds fine.

Just make another release then from this branch.

from fastnumbers.

SethMMorton avatar SethMMorton commented on May 24, 2024

Great! Thank you. I will release this as 2.1.1 tomorrow.

from fastnumbers.

yurivict avatar yurivict commented on May 24, 2024

Thank you!

from fastnumbers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.