Skip to content

Commit

Permalink
Install issues (#136)
Browse files Browse the repository at this point in the history
* Adding a better error message for issue #133

* Better error message for #134

* Updated to xcode9. Using homebrew as well to get the latest llvm (4.0.1) and a openmp capable clang

* Trying to use the updated apple clang version. Homebrew times out

* Removed the slow doctest from the osx suite

* Fixed typo
  • Loading branch information
manodeep committed Sep 4, 2017
1 parent 4199455 commit 172e07d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ matrix:
- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER=clang FAMILY=clang V='Apple LLVM 7.0.0' PYTHON_VERSION=3.5
env: COMPILER=clang FAMILY=clang V='Apple LLVM 8.0.0' PYTHON_VERSION=3.5
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
Expand All @@ -79,9 +79,9 @@ matrix:


- os: osx
osx_image: xcode7
osx_image: xcode9
compiler: clang
env: COMPILER=clang FAMILY=clang V='Apple LLVM 7.0.0' PYTHON_VERSION=3.5
env: COMPILER=clang FAMILY=clang V='Apple LLVM 9.0.0' PYTHON_VERSION=3.5
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
Expand Down Expand Up @@ -206,7 +206,7 @@ script:
- make tests CC=$COMPILER

after_success:
- cd docs && make html && cd ../
- cd docs && make doctest && cd ../
- cd docs && make html && cd ../
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then cd docs && make doctest && cd ../; fi


22 changes: 20 additions & 2 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ ifeq ($(DO_CHECKS), 1)

# All of the python/numpy checks follow
export PYTHON_CHECKED ?= 0
export NUMPY_CHECKED ?= 0
ifeq ($(PYTHON_CHECKED), 0)
export COMPILE_PYTHON_EXT := 1
export PYTHON_VERSION_FULL := $(wordlist 2,4,$(subst ., ,$(shell $(PYTHON) --version 2>&1)))
Expand Down Expand Up @@ -428,11 +429,28 @@ ifeq ($(DO_CHECKS), 1)
endif
PYTHON_CONFIG_INCL := $(shell $(PYTHON_CONFIG_EXE) --includes 2>/dev/null)
ifndef PYTHON_CONFIG_INCL
$(error $(ccred)python-config$(ccreset) ($(ccblue)$(PYTHON_CONFIG_EXE)$(ccreset)) not found. Please set $(ccgreen)PYTHON_CONFIG_EXE$(ccreset) in $(ccgreen)"common.mk"$(ccreset) to appropriate $(ccblue)python-config$(ccreset) before installing $(DISTNAME).$(VERSION) $(ccreset))
$(error $(ccred)python-config$(ccreset) ($(ccblue)$(PYTHON_CONFIG_EXE)$(ccreset)) not found. Please set $(ccgreen)PYTHON_CONFIG_EXE$(ccreset) in $(ccgreen)"common.mk"$(ccreset) to appropriate $(ccblue)python-config$(ccreset) before installing $(DISTNAME).$(VERSION). Installing $(ccblue)python-devel$(ccreset) might fix this issue $(ccreset))
endif
PYTHON_CONFIG_INCL:=$(patsubst -I%,-isystem%, $(PYTHON_CONFIG_INCL))

export PYTHON_CFLAGS := $(PYTHON_CONFIG_INCL) $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.__path__[0] + '/core/include/numpy/')")
# NUMPY is available -> next step should not fail
# That's why we are not checking if the NUMPY_INCL_FLAG is defined.
ifeq ($(NUMPY_CHECKED), 0)
export NUMPY_INCL_FLAG := $(shell $(PYTHON) -c "from __future__ import print_function; import numpy; print('-isystem ' + numpy.__path__[0] + '/core/include/numpy/')")
# Take the second word -> the path (the first word is "isystem")
NUMPY_INCL_PATH := $(word 2, ${NUMPY_INCL_FLAG})
# Now check that the 'arrayobject.h' file is present in the
# supposed numpy directory. Otherwise, compilation will fail.
# The absence of the file likely indicates a missing numpy-devel
# package (see issue #134 on github)
NUMPY_NEEDED_HEADER_FILE := ${NUMPY_INCL_PATH}arrayobject.h
ifeq (,$(wildcard ${NUMPY_NEEDED_HEADER_FILE}))
$(error Required $(ccred)numpy headers$(ccreset) are missing...stopping the compilation. You might be able to fix this by installing $(ccblue)numpy-devel$(ccreset))
endif
export NUMPY_CHECKED:=1
endif

export PYTHON_CFLAGS := $(PYTHON_CONFIG_INCL) $(NUMPY_INCL_FLAG)
export PYTHON_LIBDIR := $(shell $(PYTHON_CONFIG_EXE) --prefix)/lib
export PYTHON_LIBS := $(shell $(PYTHON_CONFIG_EXE) --libs)
export PYTHON_LINK :=
Expand Down

0 comments on commit 172e07d

Please sign in to comment.