Facebook
From Trivial Bee, 3 Years ago, written in Bash.
Embed
Download Paste or View Raw
Hits: 81
  1. # Maintainer: Sukanka <su975853527 [AT] gmail.com>
  2. pkgname=yade
  3. pkgver=2021.01a
  4. pkgrel=4
  5. pkgdesc="Yade project, free software for particle based simulations"
  6. arch=("x86_64")
  7. url='https://yade-dem.org/doc/index.html'
  8. license=('GPL2')
  9. depends=('ipython' 'python-matplotlib' 'python-pygraphviz' 'python-xlib' 'python-future' 'tk'
  10.     'python-mpmath' #  RealHP<N>
  11.     'mpfrc++'
  12.     'vtk'
  13.     'libqglviewer'
  14.     'cgal'
  15.     'python-mpi4py'
  16.    
  17.     'gl2ps' # opt
  18.     'coin-or-coinutils'
  19. )
  20. makedepends=('cmake')
  21. provides=('yade')
  22. source=("https://gitlab.com/yade-dev/trunk/-/archive/${pkgver}/trunk-${pkgver}.tar.bz2")
  23. sha512sums=('b6bda1ffb56c6f03838700bca9b7576927497ea1246715d9357ad77ea3fcf62eed987d0aaf409c4bc306c900f778e90a2429515de67e9a98b58ade30dcf4b3e3')
  24.  
  25. prepare(){
  26.     # Follow https://yade-dem.org/doc/installation.html#compilation
  27.     _cmakedir=$(ls /usr/share/cmake* | grep cmake | cut -d ':' -f1)
  28.     cd "$srcdir"
  29.     test -d trunk || mv trunk-${pkgver} trunk
  30.     test -d build || mkdir build
  31.     # correct cuda and clp path
  32.     sed -i 's|/usr/local/cuda/lib64|/opt/cuda/lib64|g' trunk/cMake/FindCuBlas.cmake
  33.     sed -i 's|/usr/lib/x86_64-linux-gnu|/usr/lib|g' trunk/cMake/FindCLP.cmake
  34.    
  35.     # fix openmp
  36.     for dir in $_cmakedir;
  37.     do
  38.         sed -i "N;102 a set(CMAKE_MODULE_PATH \$\{CMAKE_MODULE_PATH\} ${dir}/Modules/)" trunk/CMakeLists.txt;
  39.     done;
  40.    
  41. }
  42. build(){
  43.     # WARNING: Package contains reference to $srcdir, but all to "$srcdir"/trunk, I think it's safe.
  44.     # Anyway, I still want to deal with this, but need help.
  45.     cd build
  46.     cmake ../trunk \
  47.         -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DNOSUFFIX=ON -DPYTHON_VERSION=-1 \
  48.         -DENABLE_SPH=ON   -DENABLE_PROFILING=ON  -DCHOLMOD_GPU=ON  -DENABLE_LIQMIGRATION=ON -DENABLE_MASK_ARBITRARY=ON -DENABLE_DEFORM=ON -DVECTORIZE=ON -DENABLE_OAR=ON \
  49.         -DENABLE_MPFR=ON -DENABLE_PARTIALSAT=ON\
  50.         -DruntimePREFIX=/usr   -DCHUNKSIZE=50 -DOpenGL_GL_PREFERENCE=GLVND\
  51.         -DENABLE_USEFUL_ERRORS=ON -DENABLE_POTENTIAL_BLOCKS=ON # or build will fail! comment the line above to compile with almost default configuration
  52.     make -j17
  53. }
  54.  
  55. package(){
  56.     cd "$srcdir"/build
  57.     make install DESTDIR="${pkgdir}"
  58. }
  59.