Changeset 8267:1158bb4be5cc in orange


Ignore:
Timestamp:
05/14/11 19:56:38 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
137b2f35b1658421ada6120dd8a1bbb3179f1104
Message:

Enable compilation with python pointing to python3

A variable named $(PYTHON) is defined in the top-level Makefile, set to python2, and used wherever Python is called during compilation.

Location:
source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/makefile.defs

    r8265 r8267  
    22# If this does not work, find Python.h yourself and enter 
    33# the directory below. 
    4 PYTHONINCLUDE = $(shell python -c "import sys; print sys.prefix+'/include/python'+sys.version[:3]") 
    5 PYTHONLIB = $(shell python -c "import sys; print sys.prefix+'/lib/python'+sys.version[:3]") 
     4 
     5PYTHON = python2 
     6 
     7PYTHONINCLUDE = $(shell $(PYTHON) -c "import sys; print sys.prefix+'/include/python'+sys.version[:3]") 
     8PYTHONLIB = $(shell $(PYTHON) -c "import sys; print sys.prefix+'/lib/python'+sys.version[:3]") 
    69PYTHONSITEPKGS = $(PYTHONLIB)/site-packages 
    7 PYTHONVER = $(shell python -c "import sys; print sys.version[:3]") 
     10PYTHONVER = $(shell $(PYTHON) -c "import sys; print sys.version[:3]") 
    811 
    912 
     
    2730LIBRARY_FILE = liborange.so 
    2831 
    29 NUMPY_INCLUDE = $(shell python -c "import numpy; print numpy.get_include();") 
     32PYTHON = python2 
     33 
     34NUMPY_INCLUDE = $(shell $(PYTHON) -c "import numpy; print numpy.get_include();") 
    3035 
    3136ifeq ($(OS), Darwin) 
    3237  ifeq ($(PYTHONVER), 2.7) 
    33     export MACOSX_DEPLOYMENT_TARGET = $(shell python -c "import sysconfig; print sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')") 
     38    export MACOSX_DEPLOYMENT_TARGET = $(shell $(PYTHON) -c "import sysconfig; print sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')") 
    3439  else 
    3540    export MACOSX_DEPLOYMENT_TARGET = 10.4 
     
    6873 
    6974makefile.deps: 
    70     python ../pyxtract/makedep.py -n $(MODULENAME) 
     75    $(PYTHON) ../pyxtract/makedep.py -n $(MODULENAME) 
    7176    rm -f ppp/stamp 
    7277    rm -f px/stamp 
  • source/orange/Makefile

    r8265 r8267  
    77 
    88r_imports.jpp: r_imports.hpp 
    9     python ../pyxtract/jitlink_build.py R.so r_imports.hpp 
     9    $(PYTHON) ../pyxtract/jitlink_build.py R.so r_imports.hpp 
    1010r_imports.ipp: r_imports.hpp 
    11     python ../pyxtract/jitlink_build.py R.so r_imports.hpp 
     11    $(PYTHON) ../pyxtract/jitlink_build.py R.so r_imports.hpp 
    1212 
    1313obj/daxpy.o : blas/daxpy.c  
  • source/pyxtract/makedep.py

    r6538 r8267  
    140140if ppp_timestamp_dep: 
    141141  makedepsfile.write("../orange/ppp/lists: ../pyxtract/defvectors.py\n") 
    142   makedepsfile.write("\tpython ../pyxtract/defvectors.py\n") 
     142  makedepsfile.write("\t$(PYTHON) ../pyxtract/defvectors.py\n") 
    143143  if modulename != "ORANGE": 
    144144    ppp_timestamp_dep.extend(["../orange/ppp/lists", "../orange/ppp/stamp"]) 
    145145  makedepsfile.write("ppp/stamp: ../pyxtract/pyprops.py %s\n" % " ".join(ppp_timestamp_dep)) 
    146   makedepsfile.write("\tpython ../pyxtract/pyprops.py -q -n %s" % modulename) 
     146  makedepsfile.write("\t$(PYTHON) ../pyxtract/pyprops.py -q -n %s" % modulename) 
    147147  if modulename != "ORANGE": 
    148148    makedepsfile.write(" -l ../orange/ppp/stamp -l ../orange/ppp/lists") 
     
    152152  makedepsfile.write("px/stamp: ../pyxtract/pyxtract.py %s | ppp/stamp\n" % " ".join(px_timestamp_dep)) 
    153153  short = {"ORANGEOM": "-w OM", "ORANGENE": "-w OG"}.get(modulename, "") 
    154   makedepsfile.write("\tpython ../pyxtract/pyxtract.py -m -q -n %s %s %s" % (modulename, short, " ".join(px_timestamp_dep))) 
     154  makedepsfile.write("\t$(PYTHON) ../pyxtract/pyxtract.py -m -q -n %s %s %s" % (modulename, short, " ".join(px_timestamp_dep))) 
    155155  if modulename != "ORANGE": 
    156156    makedepsfile.write(" -l ../orange/px/stamp") 
  • source/pyxtract/pyprops.py

    r8265 r8267  
    1 #!/usr/bin/env python 
     1#!/usr/bin/env python2 
    22import re, os, os.path, sys, pickle 
    33 
     
    329329 
    330330  args = sys.argv 
     331  print args 
    331332 
    332333  modulename = "" 
Note: See TracChangeset for help on using the changeset viewer.