Opened 9 years ago

Closed 9 years ago

#50185 closed defect (fixed)

gringo 4.5.4 fails to compile w/ Python3

Reported by: tim@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: tim@…, kurthindenburg (Kurt Hindenburg), dliessi (Davide Liessi)
Port: gringo

Description

With OS X 10.11.2 and Xcode 7.2, gringo fails to compile.

-/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_gringo/gringo/main.log

:info:build libgringo/gringo/bug.hh:41:15: note: candidate function
:info:build inline string to_string(int x) {
:info:build               ^
:info:build libgringo/gringo/bug.hh:47:15: note: candidate function
:info:build inline string to_string(unsigned x) {
:info:build               ^
:info:build libgringo/gringo/bug.hh:53:15: note: candidate function
:info:build inline string to_string(long x) {
:info:build               ^
:info:build libgringo/gringo/bug.hh:65:15: note: candidate function
:info:build inline string to_string(long long x) {
:info:build               ^
:info:build libgringo/gringo/bug.hh:71:15: note: candidate function
:info:build inline string to_string(unsigned long long x) {
:info:build               ^
:info:build 2 errors generated.
:info:build scons: *** [build/release/libgringo/src/term.o] Error 1
:info:build scons: building terminated because of errors.
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_math_gringo/gringo/work/gringo-4.5.4-source" && /opt/local/bin/scons gringo clingo reify --build-dir=release CXX="/usr/bin/clang++ -arch x86_64"
:info:build Exit code: 2

Attachments (4)

main.log (40.9 KB) - added by tim@… 9 years ago.
build log
Portfile-gringo.diff (370 bytes) - added by dliessi (Davide Liessi) 9 years ago.
patch-SConstruct.diff (556 bytes) - added by dliessi (Davide Liessi) 9 years ago.
Portfile-gringo.2.diff (596 bytes) - added by dliessi (Davide Liessi) 9 years ago.
increase revision: installed files have changed

Download all attachments as: .zip

Change History (16)

Changed 9 years ago by tim@…

Attachment: main.log added

build log

comment:1 Changed 9 years ago by tim@…

Cc: tim@… added

Cc Me!

comment:2 Changed 9 years ago by kurthindenburg (Kurt Hindenburg)

Cc: khindenburg@… added

Cc Me!

comment:3 Changed 9 years ago by kurthindenburg (Kurt Hindenburg)

Summary: gringo 4.5.4 fails to compilegringo 4.5.4 fails to compile w/ Python3

On your system, it is grabbing python3, while mine that works is python2

-I/opt/local/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m 

{{{
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
}}}

comment:4 Changed 9 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

comment:5 Changed 9 years ago by dliessi (Davide Liessi)

Please post the result of sudo -u macports which -a python-config and port select python.

comment:6 Changed 9 years ago by dliessi (Davide Liessi)

I suspect SCons is picking up the wrong Python because it runs python-config, which can be the link created by port select.

If this is the case, there are two simple fixes:

  • declare Python 2.7 as dependency and force SCons to use it, or
  • force SCons to use the system-provided Python regardless of what is installed by MacPorts.

I would prefer the first possibility, having in mind that in the near future I want to enable the installation of the Python module, which is tested upstream only with Python 2.7 (and probably does not work with Python 3, which would explain the errors in this ticket).

I can provide a patch as soon as we choose the solution.

comment:7 in reply to:  5 Changed 9 years ago by tim@…

Replying to davide.liessi@…:

Please post the result of sudo -u macports which -a python-config and port select python.

Turing:~ tim$ port select python Available versions for python:

none python26-apple python27 (active) python27-apple python35

(It works with python27 is active. When python35 is active, it fails).

$ sudo -u macports which -a python-config /opt/local/bin/python-config /opt/local/bin/python-config /usr/bin/python-config

comment:8 Changed 9 years ago by dliessi (Davide Liessi)

This confirms my suspicion.

I'll soon provide a patch for the first fix I proposed.

comment:9 Changed 9 years ago by dliessi (Davide Liessi)

I changed my mind again and decided to completely disable Python (patching SConstruct), because there is no way to tell the build system not to use the optional dependencies if they are found.

I'll get back to this when enabling the installation of the Python and Lua modules.

Changed 9 years ago by dliessi (Davide Liessi)

Attachment: Portfile-gringo.diff added

Changed 9 years ago by dliessi (Davide Liessi)

Attachment: patch-SConstruct.diff added

comment:10 Changed 9 years ago by dliessi (Davide Liessi)

Patch attached.

Changed 9 years ago by dliessi (Davide Liessi)

Attachment: Portfile-gringo.2.diff added

increase revision: installed files have changed

comment:11 Changed 9 years ago by dliessi (Davide Liessi)

Please forget Portfile-gringo.diff​ and use Portfile-gringo.2.diff​ instead: in the first diff I forgot to increase the revision, which is necessary, since the installed files have changed.

comment:12 Changed 9 years ago by kurthindenburg (Kurt Hindenburg)

Resolution: fixed
Status: newclosed

done r144137 r144138 - thanks for taking care of this David

Note: See TracTickets for help on using tickets.