Commit 9324b1e1 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

Merge branch 'pip' into 'master'

Pip

See merge request !13
parents 6406a33b a5d2d63d
Pipeline #7745 passed with stages
in 3 minutes and 13 seconds
......@@ -19,13 +19,63 @@
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
mbtests :
image : immc/migflow-valid:v0.10
mfbuild :
image : immc/migflow-build:v0.6
stage : build
script:
# linux
- mkdir build
- cd build/
- cmake .. -DENABLE_PETSC=1 -DPETSC_DIR=/usr/lib/petscdir/petsc3.9/ -DPETSC_ARCH=x86_64-linux-gnu-real
- PPATH=$(pwd)
- cmake ..
- make -j4
- cd ../validation
- PYTHONPATH=$PPATH:$PYTHONPATH python3 mbtests.py
- python3 setup.py bdist_wheel --plat-name=manylinux1_x86_64 -d ../dist
- cd ..
# windows
- mkdir build-mingw
- cd build-mingw
- cmake .. -DCMAKE_TOOLCHAIN_FILE=/cmake-mingw
- make -j4
- mv */*.dll */*.dll.a migflow
- python3 setup.py bdist_wheel --plat-name=win_amd64 -d ../dist
- cd ..
# OSX
- mkdir build-osxcross
- cd build-osxcross
- $(osxcross-conf) && cmake .. -DCMAKE_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake
- make -j4
- python3 setup.py bdist_wheel --plat-name=macosx_10_9_x86_64 -d ../dist
- cd ..
artifacts:
paths:
- dist
expire_in: 1 day
mftests :
image : immc/migflow-valid:v0.12
stage : test
script:
- pip3 install --user dist/*manylinux1_x86_64*
- cd validation
- python3 mbtests.py
- echo 'TAG :' $CI_COMMIT_TAG "TWINE USERNAME " $TWINE_USERNAME
mfdeploy-test :
image : immc/migflow-build:v0.6
stage : deploy
rules :
- if: '$CI_COMMIT_TAG =~ /^w-.*$/'
when: always
script:
- echo 'TAG :' $CI_COMMIT_TAG "TWINE USERNAME " $TWINE_USERNAME
- twine upload --repository testpypi dist/*
mfdeploy :
image : immc/migflow-build:v0.6
stage : deploy
rules :
- if: '$CI_COMMIT_TAG =~ /^v-.*$/'
when: always
script:
- echo 'TAG :' $CI_COMMIT_TAG "TWINE USERNAME " $TWINE_USERNAME
- twine upload dist/*
......@@ -36,8 +36,11 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/migflow)
add_subdirectory(python)
add_subdirectory(tools)
add_subdirectory(scontact)
add_subdirectory(fluid)
configure_file(README.md ${PROJECT_BINARY_DIR}/README.md COPYONLY)
configure_file(LICENSE.txt ${PROJECT_BINARY_DIR}/LICENSE.txt COPYONLY)
configure_file(AUTHORS.txt ${PROJECT_BINARY_DIR}/AUTHORS.txt COPYONLY)
configure_file(COPYING.LESSER.txt ${PROJECT_BINARY_DIR}/COPYING.LESSER.txt COPYONLY)
configure_file(COPYING.txt ${PROJECT_BINARY_DIR}/COPYING.txt COPYONLY)
......@@ -27,37 +27,3 @@ The list of the contributors to the development of MigFlow is given in the AUTHO
Website of MigFlow: https://git.immc.ucl.ac.be/fluidparticles/MigFlow
Contact: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
This program has dependencies on other libraries and Website depedencies which are or not under GPL and that are commonly distributed with this program core libraries.
The other dependencies are as follows:
PETSC BSD 2-clause https://www.mcs.anl.gov/petsc/
-----------------------------------------------------------------------------
######
PETSC
######
Copyright (c) 1991-2014, UChicago Argonne, LLC and the PETSc Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
FROM ubuntu:20.04
env DEBIAN_FRONTEND=noninteractive
#linux
RUN apt update && apt install -y git python3 make cmake gcc
#windows
RUN apt update && apt install -y mingw-w64 mingw-w64-tools
run echo "\
SET(CMAKE_SYSTEM_NAME Windows)\n\
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)\n\
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)\n\
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)\n\
SET(CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran)\n\
SET(CMAKE_FIND_ROOT_PATH /mingw64)\n\
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n"\
> /cmake-mingw
RUN apt update && apt install -y git python3-setuptools python3-wheel twine
### osxcross
RUN apt-get update && apt-get install -y clang patch libssl-dev liblzma-dev libxml2-dev llvm-dev uuid-dev zlib1g-dev
RUN useradd -ms /bin/bash validator
RUN mkdir -p /osxcross && chown validator /osxcross
USER validator
RUN git clone https://github.com/tpoechtrager/osxcross.git /osxcross
COPY MacOSX10.15.sdk.tar.xz /osxcross/tarballs/MacOSX10.15.sdk.tar.xz
RUN cd /osxcross && SDK_VERSION=10.15 UNATTENDED=1 ./build.sh
ENV PATH=/osxcross/target/bin/:$PATH
ENV OSXCROSS_HOST=x86_64-apple-darwin19
VOLUME ["/etc/gitlab-runner"]
WORKDIR /home/validator
FROM ubuntu:20.04
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y git python3 petsc-dev python3-numpy make gmsh cmake g++ python3-distutils python3-petsc4py
RUN DEBIAN_FRONTEND=noninteractive apt install -y python3-scipy
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y git python3 python3-numpy gmsh python3-scipy python3-petsc4py python3-pip
VOLUME ["/etc/gitlab-runner"]
......
......@@ -25,13 +25,12 @@ set(SRC
fluid_problem_concentration.c
mesh.c
mesh_find.c
../tools/quadtree.c
)
include_directories(. ${CMAKE_SOURCE_DIR}/tools ${EXTERNAL_INCLUDES})
add_library(mbfluid2 SHARED ${SRC})
target_link_libraries(mbfluid2 ${EXTERNAL_LIBRARIES} mbtools2)
target_compile_definitions(mbfluid2 PUBLIC "-DDIMENSION=2")
add_library(mbfluid3 SHARED ${SRC})
target_link_libraries(mbfluid3 ${EXTERNAL_LIBRARIES} mbtools3)
target_compile_definitions(mbfluid3 PUBLIC "-DDIMENSION=3")
......@@ -36,4 +36,6 @@ foreach(f ${SRC})
configure_file("${f}" "${PROJECT_BINARY_DIR}/migflow/${f}" COPYONLY)
endforeach()
configure_file(setup.py "${PROJECT_BINARY_DIR}/setup.py" @ONLY)
configure_file(migflow.sh "${PROJECT_BINARY_DIR}/migflow.sh" @ONLY)
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
import petsc4py
petsc4py.init()
from petsc4py import PETSc
......
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
import numpy as np
import scipy.sparse
import scipy.sparse.linalg
......
......@@ -18,12 +18,47 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
import setuptools
import sys
import os
set (SRC
quadtree.c
with open("README.md", "r") as fh:
long_description = fh.read()
version = "1.1.4"
commit_tag = os.environ.get("CI_COMMIT_TAG")
if commit_tag and (commit_tag.startswith("v-") or commit_tag.startswith("w-")):
version = commit_tag[2:]
setuptools.setup(
name="migflow",
version=version,
author="Migflow Team",
author_email="jonathan.lambrechts@uclouvain.be",
description="Model for Immersed Granular Flows",
long_description=long_description,
long_description_content_type="text/markdown",
include_package_data=True,
url="https://www.migflow.be",
packages=["migflow"],
package_dir={"migflow":"migflow"},
package_data={"migflow":["*.so","*.dll","*.dylib"]},
classifiers=[
"Environment :: Console",
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: C",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"
],
install_requires=["scipy"],
python_requires='>=3.6'
)
include_directories(".")
add_library(mbtools2 SHARED ${SRC})
target_compile_definitions(mbtools2 PUBLIC "-DDIMENSION=2")
add_library(mbtools3 SHARED ${SRC})
target_compile_definitions(mbtools3 PUBLIC "-DDIMENSION=3")
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
import numpy as np
def _advance_particles(particles, f, dt, min_nsub,contact_tol,iteration=0,after_sub_iter=None,max_split=1) :
......
......@@ -21,32 +21,27 @@
set(SRC
scontact.c
../tools/quadtree.c
)
include_directories(. ../tools)
add_library(scontact3f SHARED ${SRC})
target_compile_definitions(scontact3f PUBLIC -DDIMENSION=3 -DFRICTION_ENABLED=1 -DROTATION_ENABLED=1)
target_link_libraries(scontact3f mbtools3)
add_library(scontact2 SHARED ${SRC})
target_compile_definitions(scontact2 PUBLIC "-DDIMENSION=2")
target_link_libraries(scontact2 mbtools2)
add_library(scontact2f SHARED ${SRC})
target_compile_definitions(scontact2f PUBLIC -DDIMENSION=2 -DFRICTION_ENABLED=1 -DROTATION_ENABLED=1)
target_link_libraries(scontact2f mbtools2)
add_library(scontact2fwr SHARED ${SRC})
target_link_libraries(scontact2fwr mbtools2)
target_compile_definitions(scontact2fwr PUBLIC -DDIMENSION=2 -DFRICTION_ENABLED=1)
add_library(scontact3 SHARED ${SRC})
target_link_libraries(scontact3 mbtools3)
target_compile_definitions(scontact3 PUBLIC "-DDIMENSION=3")
add_library(scontact3fwr SHARED ${SRC})
target_link_libraries(scontact3fwr mbtools3)
target_compile_definitions(scontact3fwr PUBLIC -DDIMENSION=3 -DFRICTION_ENABLED=1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment