GithubHelp home page GithubHelp logo

gnatcoll-bindings's People

Contributors

adadoom3 avatar adrienboulanger avatar anisimkov avatar anthonyleonardogracio avatar arnaudcharlet avatar asarhaddon avatar bobduff avatar briot avatar brobecke avatar brosgol avatar enzbang avatar fabien-chouteau avatar fedor-rybin avatar godunko avatar kanigsson avatar lambourg avatar matteobordin avatar miranda-adacore avatar nikokrock avatar ogorodnik avatar pat-rogers avatar pmderodat avatar quentinochem avatar raph-amiard avatar reznikmm avatar setton avatar t-14 avatar thvnx avatar turbogit avatar vcelier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnatcoll-bindings's Issues

Compiling Issue

I'm getting this error
hon_support.o: relocation R_X86_64_PC32 against symbol init_user_module can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status gprlib: /usr/bin/gcc execution error gprbuild: could not build library for project gnatcoll_python process failed with status: 4 ==> ERROR: A failure occurred in build().

Specific compiler option on build command.

Hello,
How to add a specific compiler option with "setup.py build"?
(without change in GPR files)
For instance I want to add "-gnatwn" option (in order to cancel "-gnatwaCJe" effects).
Thanks, Pascal.

python3/setup.py build fails with undefined Py_TPFLAGS_HAVE_VECTORCALL

Mac OSX 10.13.6
Xcode 10.1
GNAT Community 2021 (20210519)

My attempt to compile Python3 python_support.c failed with:

MacBook-Air:gnatcoll-bindings-23.0.0 rogermcmurtrie$ python3/setup.py build
Launch: /opt/gnat-ce-2021/bin/gprbuild -j0 -p -gargs -P/Ada_Source/gnatcoll-bindings-23.0.0/python3/gnatcoll_python.gpr --relocate-build-tree --target=x86_64-darwin -XGNATCOLL_PYTHON_STATIC_LIB=/Users/rogermcmurtrie/.pyenv/versions/3.8.6/lib/python3.8/config-3.8-darwin/libpython3.8.a -XGNATCOLL_PYTHON_LIBS=-lintl -ldl   -framework CoreFoundation -XGNATCOLL_LIBPYTHON_KIND=static -XGNATCOLL_PYTHON_CFLAGS=-I/Users/rogermcmurtrie/.pyenv/versions/3.8.6/include/python3.8 -I/Users/rogermcmurtrie/.pyenv/versions/3.8.6/include/python3.8 -XGNATCOLL_VERSION=0.0 -XBUILD=PROD -XGNATCOLL_OS=osx -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static
Compile
   [C]            python_support.c
   [Ada]          gnatcoll-python-ctypes.ads
   [Ada]          gnatcoll-scripts-python.adb
   [Ada]          gnatcoll-python-errors.ads
   [Ada]          gnatcoll-python-exceptions.ads
   [Ada]          gnatcoll-python.adb
/Ada_Source/gnatcoll-bindings-23.0.0/python3/python_support.c: In function 'PyDescr_NewAdaMethod':
/Ada_Source/gnatcoll-bindings-23.0.0/python3/python_support.c:251:33: error: 'Py_TPFLAGS_HAVE_VECTORCALL' undeclared (first use in this function); did you mean 'Py_TPFLAGS_HAVE_VERSION_TAG'?
  251 |         Py_TPFLAGS_DEFAULT && !(Py_TPFLAGS_HAVE_VECTORCALL);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 Py_TPFLAGS_HAVE_VERSION_TAG
/Ada_Source/gnatcoll-bindings-23.0.0/python3/python_support.c:251:33: note: each undeclared identifier is reported only once for each function it appears in
   compilation of python_support.c failed

Clash between legal *BUILD values here & in installed projects

I wanted a debug build for python3, and failed to spot that the way to get it is to reconfigure for debug (I’m using a Python 3.8 virtual environment):

python setup.py build --reconfigure --debug

On the way, having seen this in gnatcoll_python.gpr

   type Build_Type is ("DEBUG", "PROD");
   Build : Build_Type :=
       External ("GNATCOLL_BUILD", External ("BUILD", "PROD"));

I tried setting GNATCOLL_BUILD to DEBUG, which resulted in

gnatcoll_python.gpr:58:10: warning: no when others for this case construction
gnatcoll.gpr:12:04: value "DEBUG" is illegal for typed string "build"

because the installed gnatcoll.gpr says

library project GnatColl is
   type BUILD_KIND is ("static", "relocatable", "static-pic");
   BUILD : BUILD_KIND := external("GNATCOLL_CORE_BUILD", external("GNATCOLL_BUILD", external("LIBRARY_TYPE", "static")));

which results from the way the Makefile calls gprinstall.

I get the impression from the gprinstall documentation that it only supports one scenario variable?

Pull requests temporarily on hold

Dear contributors,

Following the switch to modular organization, we are working on the testsuite refactoring. Before the testsuite is in place we can't accept pull requests.

We apologize in advance, and thank you for your patience!

Problem building python/

On Darwin (El Capitan; High Sierra), can’t build the relocatable library. This is [2c426fe].

With FSF GCC 8.0.1 (the only compiler I have with gnatcoll-core installed), I see

$ setup.py build
Fetch Python information...
  Python version:          2.7
  Static dir               /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
  Shared dir               /System/Library/Frameworks/Python.framework/Versions/2.7/lib
  CFLAGS                   -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
  Shared linker flags      -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -lpython2.7 -ldl  -framework CoreFoundation
  Static linker flags      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a -ldl  -framework CoreFoundation
Force link to static python library
Libraries kind             static, static-pic, relocatable
Version                    0.0
Build mode                 PROD
[...]
Launch: /opt/gcc-8.0.1/bin/gprbuild -j0 -p -Pgnatcoll_python.gpr --target=x86_64-darwin -XGNATCOLL_LIBPYTHON_KIND=static -XGNATCOLL_OS=osx -XGNATCOLL_PYTHON_LIBS=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a -ldl  -framework CoreFoundation -XBUILD=PROD -XGNATCOLL_VERSION=0.0 -XGNATCOLL_PYTHON_CFLAGS=-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -XLIBRARY_TYPE=relocatable -XGPR_BUILD=relocatable -XXMLADA_BUILD=relocatable
Compile
   [C]            python_support.c
   [Ada]          gnatcoll-any_types-python.adb
   [Ada]          gnatcoll-scripts-python.adb
   [Ada]          gnatcoll-python.adb
Build Libraries
   [gprlib]       gnatcoll_python.lexch
   [link library] libgnatcoll_python.dylib
Undefined symbols for architecture x86_64:
  "_PyArg_ParseTuple", referenced from:
      _ada_py_arg_parsetuple_ptr in python_support.o
      _ada_py_arg_parsetuple_ptr2 in python_support.o
      _ada_py_arg_parsetuple_ptr3 in python_support.o
      _ada_py_arg_parsetuple_ptr4 in python_support.o
      _ada_py_arg_parsetuple_ptr5 in python_support.o
[...]

This is because of -XGNATCOLL_LIBPYTHON_KIND=static.

I tried setup.py build --enable-shared,

$ ./setup.py build --enable-shared
Launch: /opt/gcc-8.0.1/bin/gprbuild -j0 -p --enable-shared -Pgnatcoll_python.gpr --target=x86_64-darwin -XGNATCOLL_LIBPYTHON_KIND=static -XGNATCOLL_PYTHON_CFLAGS=-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -XGNATCOLL_PYTHON_LIBS=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.a -ldl  -framework CoreFoundation -XBUILD=PROD -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=osx -XLIBRARY_TYPE=static -XGPR_BUILD=static -XXMLADA_BUILD=static
gprbuild: illegal option "--enable-shared" on the command line
process failed with status: 4

I edited setup.json to set "GNATCOLL_LIBPYTHON_KIND": "shared": now the build succeeds.

setup.py:92 and :97 imply that --enable-shared should be supported.
Alternatively, what about adding system.platform.startswith("darwin") to that check?


Having made this workround, the shared build is OK but I now find this failure:

$ gprbuild -XLIBRARY_TYPE=static 
using project file check_build.gpr
Compile
   [Ada]          check_build.adb
Bind
   [gprbind]      check_build.bexch
   [Ada]          check_build.ali
Link
   [link]         check_build.adb
Undefined symbols for architecture x86_64:
  "_PyArg_ParseTuple", referenced from:
      _ada_py_arg_parsetuple_ptr in libgnatcoll_python.a(python_support.o)
[...]

which can itself be worked round by

$ gprbuild -XLIBRARY_TYPE=static -largs -lpython

or

$ gprbuild -XLIBRARY_TYPE=static -XGNATCOLL_PYTHON_LIBS=-lpython

Specific include path is missing for gmp.h.

Hello,
If gmp.h is not in standard include path, how to add a specific include path with setup.py?

As a workaround, I added the gmp include path in gpr file:

--- a/gmp/gnatcoll_gmp.gpr
+++ b/gmp/gnatcoll_gmp.gpr
@@ -58,7 +58,7 @@ project GnatColl_GMP is
for Switches ("Ada") use
("-g", "-O0", "-gnata", "-gnatVa", "-gnatQ", "-gnaty", "-gnateE",
"-gnatwaCJe", "-fstack-check");
- for Switches ("C") use ("-g", "-Wunreachable-code");
+ for Switches ("C") use ("-g", "-Wunreachable-code", "-I/usr/local/xnadalib-2018/include");
when "PROD" =>
-- Do not use -gnatwe for production mode

Thanks, Pascal.

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.