Skip to content

Commit

Permalink
added dockerfile and instructions for wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ducha-aiki committed Apr 24, 2020
1 parent cd40917 commit 577deed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
cmake_minimum_required(VERSION 2.8.12)
project(pydegensac)

add_definitions(-DA64)
add_definitions(-std=c++11)
add_definitions(-fPIC)



FIND_PACKAGE(OpenMP)
if (OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif (OPENMP_FOUND)


enable_language (Fortran)
FIND_PACKAGE(LAPACK REQUIRED)
if (LAPACK_FOUND)
Expand Down
24 changes: 24 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM quay.io/pypa/manylinux1_x86_64:latest

#Taken from https://github.com/skvark/opencv-python/blob/master/docker/Dockerfile_x86_64
RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
tar -xf cmake-3.9.0.tar.gz && \
cd cmake-3.9.0 && \
#manylinux1 provides curl-devel equivalent and libcurl statically linked
# against the same newer OpenSSL as other source-built tools
# (1.0.2s as of this writing)
yum -y install zlib-devel && \
#configure does a bootstrap make under the hood
export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
./configure --system-curl && \
make && \
make install && \
cd .. && \
rm -rf cmake-3.9.0*

# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies
# manylinux provides the toolchain and git; we provide cmake
RUN yum install -y lapack-devel blas-devel


ENV PATH "$HOME/bin:$PATH"
4 changes: 4 additions & 0 deletions docker/how-to-create-wheel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
login into docker
alias cmake=/usr/local/bin/cmake
/opt/python/cp36-cp36m/bin/python3 setup.py bdist_wheel
auditwheel repair dist/pydegensac-0.1.1-cp36-cp36m-linux_x86_64.whl
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def copy_test_file(self, src_file):
copyfile(src_file, dest_file)
copymode(src_file, dest_file)

requirements = [ 'numpy', 'cmake']
requirements = [ ]

setup(
name='pydegensac',
Expand All @@ -106,6 +106,7 @@ def copy_test_file(self, src_file):
packages=find_packages('src'),
package_dir={'':'src'},
ext_modules=[CMakeExtension('pydegensac/pydegensac')],
extra_compile_args = ["-O0"],
cmdclass=dict(build_ext=CMakeBuild),
#test_suite='tests',
zip_safe=False,
Expand Down

0 comments on commit 577deed

Please sign in to comment.