Skip to content
Snippets Groups Projects
Commit 4c5afc5f authored by Martin Bauer's avatar Martin Bauer
Browse files

Added conda build files to utilities

parent 50ba20b7
No related merge requests found
from distutils.core import setup
import shutil
from os.path import exists, join
import platform
import sys
# The following variables are configure by CMake
walberla_source_dir = "${walberla_SOURCE_DIR}"
walberla_binary_dir = "${CMAKE_CURRENT_BINARY_DIR}"
if platform.system() == 'Windows':
extension = ( 'dll', 'pyd' )
configuration = 'Release'
else:
extension = ( 'so', 'so' )
configuration = ''
def collectFiles():
shared_lib = join(walberla_binary_dir, 'walberla_cpp.so' )
src_shared_lib = join(walberla_binary_dir, configuration, 'walberla_cpp.' + extension[0] )
dst_shared_lib = join(walberla_binary_dir, 'waLBerla', 'walberla_cpp.' + extension[1] )
# copy everything inplace
if not exists( shared_lib ):
print( src_shared_lib )
if not exists( src_shared_lib ):
print("Python Module was not built yet - run 'make walberla_cpp'")
exit(1)
shutil.rmtree( join(walberla_binary_dir, 'waLBerla'), ignore_errors=True )
shutil.copytree( join(walberla_source_dir, 'python', 'waLBerla'),
join(walberla_binary_dir, 'waLBerla') )
shutil.copy( shared_lib,
join(walberla_binary_dir, 'waLBerla', 'walberla_cpp.so') )
shutil.copy( src_shared_lib,
dst_shared_lib )
packages = ['waLBerla',
'waLBerla.evaluation',
......@@ -39,10 +54,9 @@ setup( name='waLBerla',
author_email='martin.bauer@fau.de',
url='http://www.walberla.net',
packages=packages,
package_data = {'' : ['walberla_cpp.so'] }
package_data = {'' : ['walberla_cpp.' + extension[1]] }
)
import sys
if sys.argv[1] == 'build':
print("\nCollected all files for waLBerla Python module.\n"
" - to install run 'make pythonModuleInstall'\n"
......
:: move bin\* %LIBRARY_BIN%\
:: if errorlevel 1 exit 1
:: move share %LIBRARY_PREFIX%\
:: if errorlevel 1 exit 1
:: fetch a bootstrap cmake
pushd %TEMP%
curl -SLO https://cmake.org/files/v3.9/cmake-3.9.1-win32-x86.zip
unzip -q -o cmake-3.9.1-win32-x86.zip
set PATH=%CD%\cmake-3.9.1-win32-x86\bin;%PATH%
popd
set CMAKE_GENERATOR=NMake Makefiles JOM
mkdir build
cd build
cmake -G "%CMAKE_GENERATOR%" ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=True .. ^
-DBUILD_QtDialog=False
if errorlevel 1 exit 1
cmake --build . --config Release --target all
cmake --build . --config Release --target install
if errorlevel 1 exit 1
# This file created by conda-build 0+unknown
# meta.yaml template originally from:
# c:\users\ray\conda\anaconda\packages\cmake, last modified Mon Nov 21 11:52:59 2016
# ------------------------------------------------
package:
name: cmake
version: 3.9.1
source:
sha256: d768ee83d217f91bb597b3ca2ac663da7a8603c97e1f1a5184bc01e0ad2b12bb
url: https://cmake.org/files/v3.9/cmake-3.9.1.tar.gz
build:
features:
- vc14
number: '0'
requirements:
build:
- python
- m2-curl
- m2-unzip
- jom
- zlib 1.2.*
run:
- zlib 1.2.*
test:
commands:
- cmake --version
requires:
- python
about:
dev_url: https://gitlab.kitware.com/cmake/cmake/
doc_url: https://cmake.org/documentation/
home: http://www.cmake.org/
license: BSD 3-clause
license_family: BSD
summary: CMake is an extensible, open-source system that manages the build process
mkdir build
cd build
export BOOST_ROOT=$PREFIX
CC=mpicc CXX=mpicxx cmake .. -DWALBERLA_BUILD_WITH_PYTHON=1 -DWALBERLA_BUILD_WITH_PYTHON_MODULE=1 -DWALBERLA_BUILD_WITH_PYTHON_LBM=1
make -j 8 pythonModuleInstall
about:
home: www.walberla.net
license: GPLv3
package:
name: walberla-lbm
version: {{ GIT_DESCRIBE_TAG }}
build:
number: {{ GIT_DESCRIBE_NUMBER }}
requirements:
build:
- python
- git
- boost
- cmake
- gcc [linux]
- mpich2 [linux]
run:
- python >=3.6
- boost
- numpy
- mpich2 [linux]
source:
git_rev: master
git_url: https://i10git.cs.fau.de/walberla/walberla.git
mkdir build
cd build
set BOOST_ROOT=%PREFIX%
cmake -LAH -G"Visual Studio 15 2017 Win64" ^
-DWALBERLA_BUILD_WITH_PYTHON=ON ^
-DWALBERLA_BUILD_WITH_PYTHON_MODULE=ON ^
-DWALBERLA_BUILD_WITH_MPI=OFF ^
-DWALBERLA_BUILD_WITH_OPENMP=ON ^
-DPYTHON_EXECUTABLE="%PYTHON%" ^
-DBoost_USE_STATIC_LIBS=OFF ^
-DBoost_USE_MULTITHREADED=ON ..
if errorlevel 1 exit 1
cmake --build . --config Release --target pythonModuleInstall
if errorlevel 1 exit 1
\ No newline at end of file
mkdir build
cd build
export BOOST_ROOT=$PREFIX
CC=mpicc CXX=mpicxx cmake .. -DWALBERLA_BUILD_WITH_PYTHON=1 -DWALBERLA_BUILD_WITH_PYTHON_MODULE=1
make -j 8 pythonModuleInstall
about:
home: www.walberla.net
license: GPLv3
package:
name: walberla
version: {{ GIT_DESCRIBE_TAG }}
build:
number: {{ GIT_DESCRIBE_NUMBER }}
requirements:
build:
- python
- git
- boost
- cmake [linux]
- cmake >=3.7.0 [win]
- gcc [linux]
- mpich2 [linux]
run:
- python
- boost
- numpy
- mpich2 [linux]
source:
git_rev: master
git_url: https://i10git.cs.fau.de/walberla/walberla.git
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