Skip to content

Commit

Permalink
Minor update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Jun 9, 2017
1 parent aa3d3a1 commit 4e60492
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install:
- sed -i -e "s/@CXX_COMPILER@/$CXX/" Dockerfile
- sed -i -e "s/@BRANCH_NAME@/$TRAVIS_BRANCH/" Dockerfile
- sed -i -e "s/@PULL_REQUEST@/$TRAVIS_PULL_REQUEST/" Dockerfile
- sed -i -e "s/@PYTHON_VERSION@/$TRAVIS_PULL_REQUEST/" Dockerfile
- sed -i -e "s/@PYTHON_VERSION@/$PYTHON_VERSION/" Dockerfile

# Build Dockerfile
- docker build --tag=lime-env .
Expand Down
23 changes: 18 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.0.0)
project(lime)

if (UNIX AND NOT APPLE)
set(LINUX TRUE)
else()
set(LINUX FALSE)
endif()

# ------------------------------------------------------------------------------
# Build options
# ------------------------------------------------------------------------------
Expand All @@ -14,20 +20,27 @@ option(LIME_BUILD_PYTHON_MODULE "Build python modules." OFF)
# ------------------------------------------------------------------------------
find_package( OpenCV 3.0 REQUIRED )
if (${LIME_BUILD_PYTHON_MODULE})
find_package( Boost REQUIRED python numpy )
find_package( PythonLibs )
find_package( PythonLibs REQUIRED )
if (NOT DEFINED PYTHON_INCLUDE_DIR OR NOT DEFINED PYTHON_LIBRARY)
message(FATAL_ERROR "Python libraries not found. Please set PYTHON_INCLUDE_DIR and PYTHON_LIBRARY manually to CMake.")
endif()
message(STATUS "Python include: ${PYTHON_INCLUDE_DIR}")
message(STATUS "Python lib: ${PYTHON_LIBRARY}")

message(STATUS "Python ${PYTHONLIBS_VERSION_STRING}")
message(STATUS " Include: ${PYTHON_INCLUDE_DIR}")
message(STATUS " Library: ${PYTHON_LIBRARY}")

if (LINUX AND ${PYTHONLIBS_VERSION_STRING} VERSION_GREATER "3.0")
find_package( Boost REQUIRED python3 numpy3 )
else()
find_package( Boost REQUIRED python numpy )
endif()
endif()

# Build settings
if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O2")
if (${LIME_BUILD_TESTS})
message(STATUS "[lime] Generating coverage data.")
message(STATUS "[ LIME ] Generating coverage data.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fprofile-arcs -ftest-coverage")
endif()
endif()
Expand Down
38 changes: 20 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ FROM tatsy/ubuntu-cxx:opencv
## Environment variables
#
ENV TERM xterm
ENV BRANCH_NAME development
ENV PULL_REQUEST false
ENV CC gcc
ENV CXX g++
ENV PYTHON_VERSION 2.7
ENV BRANCH_NAME @BRANCH_NAME@
ENV PULL_REQUEST @PULL_REQUEST@
ENV CC @C_COMPILER@
ENV CXX @CXX_COMPILER@
ENV PYTHON_VERSION @PYTHON_VERSION@

#
## update/upgrade
Expand All @@ -30,16 +30,6 @@ RUN pip install gcovr
#
RUN apt-get -qq install cppcheck cccc doxygen

#
## Install Boost
#
RUN wget -q https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
RUN tar -zxf boost_1_64_0.tar.gz
RUN \
cd boost_1_64_0 && \
./bootstrap.sh && \
./b2 address-model=64 --with-python -j2 install .

#
## Install Python through Anaconda
#
Expand All @@ -49,6 +39,18 @@ ENV PATH "$HOME/anaconda/bin:$PATH"
RUN conda update --yes conda
RUN conda install --yes python=$PYTHON_VERSION setuptools numpy scipy pillow six libgcc

#
## Install Boost
#
RUN wget -q https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
RUN tar -zxf boost_1_64_0.tar.gz
RUN \
cd boost_1_64_0 && \
./bootstrap.sh && \
./b2 address-model=64 \
include=`python -c "from __future__ import print_function; from distutils import sysconfig; print(sysconfig.get_python_inc())"` \
-d0 --with-python -j2 install .

#
## Install Google test
#
Expand All @@ -62,7 +64,7 @@ RUN \
#
## Build lime
#
RUN git clone --depth 23 -b $BRANCH_NAME https://github.com/tatsy/lime.git
RUN git clone --depth 12 -b $BRANCH_NAME https://github.com/tatsy/lime.git #redo
RUN \
if [ $PULL_REQUEST != "false" ]; then \
cd lime && \
Expand All @@ -74,8 +76,6 @@ RUN \
cd lime && \
git submodule update --init --recursive

RUN find $HOME/anaconda/lib -name libpython${PYTHON_VERSION}

RUN \
cd lime && \
cmake \
Expand All @@ -94,6 +94,8 @@ RUN \
cd lime && \
python setup.py install

RUN python -c "import lime; lime.print_version()" #redo

#
## # of threads used by OpenMP
#
Expand Down

0 comments on commit 4e60492

Please sign in to comment.