Skip to content
Permalink
Browse files

think I may have solved the numpy fedora issue

  • Loading branch information
dsteinberg committed Jan 28, 2015
1 parent 8117f33 commit f3769530035d88f232174ec79b30bdb5ec1cf7b1
Showing with 51 additions and 3 deletions.
  1. +1 −0 CMakeLists.txt
  2. +10 −3 FindEigen3.cmake
  3. +2 −0 python/CMakeLists.txt
  4. +38 −0 python/FindNumpy.cmake
@@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 2.6)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
include(${PROJECT_SOURCE_DIR}/FindEigen3.cmake REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
include(FindOpenMP)


@@ -1,15 +1,22 @@
# Make sure that we can find Eigen
# This creates the following variables:
# - EIGEN_INCLUDE_DIRS where to find the library
# - EIGEN_FOUND TRUE if found, FALSE otherwise

find_path(
EIGEN_INCLUDE_DIRS Eigen
/usr/local/eigen3
/usr/local/include/eigen3
/usr/include/eigen3
)

# Include Eigen
# Check found Eigen
if(EIGEN_INCLUDE_DIRS)
include_directories(${EIGEN_INCLUDE_DIRS})
set(EIGEN_FOUND TRUE)
message(STATUS "Found Eigen: ${EIGEN_INCLUDE_DIRS}")
else(EIGEN_INCLUDE_DIRS)
message(FATAL_ERROR "Eigen not found")
if(EIGEN_FIND_REQUIRED)
set(EIGEN_FOUND FALSE)
message(FATAL_ERROR "Eigen not found")
endif(EIGEN_FIND_REQUIRED)
endif(EIGEN_INCLUDE_DIRS)
@@ -23,6 +23,8 @@ if(BUILD_PYTHON_INTERFACE)
find_package(Boost COMPONENTS python REQUIRED)
endif(BUILD_USE_PYTHON3)

include(${PYTHON_SOURCE_DIR}/FindNumpy.cmake REQUIRED)
include_directories(${NUMPY_INCLUDE_DIR})
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

@@ -0,0 +1,38 @@
# - Find numpy
# Find the native numpy includes
# This module defines
# NUMPY_INCLUDE_DIR, where to find numpy/arrayobject.h, etc.
# NUMPY_FOUND, If false, do not try to use numpy headers.

# This is (modified) from the avogadro project, http://avogadro.cc (GPL)

if (NUMPY_INCLUDE_DIR)
# in cache already
set (NUMPY_FIND_QUIETLY TRUE)
endif (NUMPY_INCLUDE_DIR)

EXEC_PROGRAM ("${PYCMD}"
ARGS "-c 'import numpy; print(numpy.get_include())'"
OUTPUT_VARIABLE NUMPY_INCLUDE_DIR)


if (NUMPY_INCLUDE_DIR MATCHES "Traceback")
# Did not successfully include numpy
set(NUMPY_FOUND FALSE)
else (NUMPY_INCLUDE_DIR MATCHES "Traceback")
# successful
set (NUMPY_FOUND TRUE)
set (NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_DIR} CACHE STRING "Numpy include path")
endif (NUMPY_INCLUDE_DIR MATCHES "Traceback")

if (NUMPY_FOUND)
if (NOT NUMPY_FIND_QUIETLY)
message (STATUS "Numpy headers found")
endif (NOT NUMPY_FIND_QUIETLY)
else (NUMPY_FOUND)
if (NUMPY_FIND_REQUIRED)
message (FATAL_ERROR "Numpy headers missing")
endif (NUMPY_FIND_REQUIRED)
endif (NUMPY_FOUND)

MARK_AS_ADVANCED (NUMPY_INCLUDE_DIR)

0 comments on commit f376953

Please sign in to comment.
You can’t perform that action at this time.