mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-20 20:43:09 -04:00
sci-physics/SU2: new package
The SU2 package contains several bunbled libraries that currently aren't unbundled in ebuild. CGNS: Tried to unbundled CNGS but it failed to compiled against system gcnslib-3.3.0; successfully compiled against cgnslib-3.4.0 but related tests are failed. Metis, Parmetis: This packages couldn't be installed simultaneously in Gentoo and required by build system if compiled via meson build system with mpi option being enabled. They could be optionaly chosen if autotools build system is used (ebuild uses meson). Some addidional features disabled due to their experimantal status or due to requirement to download additional third-party libraries. At this moment ebuild doesn't provide such features to be built. They are also will be bundled if implemented and compiled statically. Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
This commit is contained in:
3
sci-physics/SU2/Manifest
Normal file
3
sci-physics/SU2/Manifest
Normal file
@@ -0,0 +1,3 @@
|
||||
DIST SU2-7.0.4-TestCases.tar.gz 437960103 BLAKE2B 2469edc23f62589fa18be5fff6e036965f6b5f6e2be207642d318aac4d2044c07f0891568f86c1a3ab065e79afce50cc73ad0857b82093d79ac28a4d0451a4ad SHA512 f21d963815e024582e99647a21ebae0b17fc69f75bc34bb72cc3a86cc9ff8502342b31755b5da73e7088b4d0ce430bdd6b4efefc03583cbfcf5156c1849328e1
|
||||
DIST SU2-7.0.4-Tutorials.tar.gz 64282233 BLAKE2B b0d13a0988d5617868fad6098fe8110e3600415f05784ff04416cb23162fadc8c1d06d50c5200b14f65afb3e97ee766b21dfdcd4ec8ded9026baf510ca829e48 SHA512 604a05e15a8eae1c7255016261a6576a97fc364f66004ecaccaae932e3a97624c2599d354dd874562824caa8f8ea3dac2f03e0105b1c27d66ec0bf59e3a27105
|
||||
DIST SU2-7.0.4.tar.gz 20516147 BLAKE2B 21f45e4918bbc6a72bf47ad61d3301abed50a7cf569e9e8d4040201ff653e583d50a547853365302671922f023d0cc6f3735c1afcd0f3b6bf3c3fc92dc807787 SHA512 8e69f0e1d335adef0bd98666c98e29bc15ee0d7a0fcbbbc91a1ba02275ca52fda7f8f47434547f7982ce0e73a6ff78bd2ed57ca328d1e87b8afdd3b0a698d262
|
||||
112
sci-physics/SU2/SU2-7.0.4.ebuild
Normal file
112
sci-physics/SU2/SU2-7.0.4.ebuild
Normal file
@@ -0,0 +1,112 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{6,7,8} )
|
||||
|
||||
inherit meson python-single-r1
|
||||
|
||||
DESCRIPTION="SU2: An Open-Source Suite for Multiphysics Simulation and Design"
|
||||
HOMEPAGE="https://su2code.github.io/"
|
||||
SRC_URI="
|
||||
https://github.com/su2code/SU2/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
||||
test? ( https://github.com/su2code/TestCases/archive/v${PV}.tar.gz -> ${P}-TestCases.tar.gz )
|
||||
tutorials? ( https://github.com/su2code/Tutorials/archive/v${PV}.tar.gz -> ${P}-Tutorials.tar.gz )
|
||||
"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
IUSE="cgns -mkl +mpi openblas tecio test tutorials"
|
||||
RESTRICT="!test? ( test )"
|
||||
REQUIRED_USE="
|
||||
${PYTHON_REQUIRED_USE}
|
||||
mkl? ( !openblas )
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${PYTHON_DEPS}
|
||||
mpi? ( virtual/mpi[cxx] )
|
||||
mkl? ( sci-libs/mkl )
|
||||
openblas? ( sci-libs/openblas )
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
tecio? ( dev-libs/boost:= )
|
||||
"
|
||||
BDEPEND="virtual/pkgconfig"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${P}-fix-env.patch"
|
||||
"${FILESDIR}/${P}-unbundle_boost.patch"
|
||||
"${FILESDIR}/${P}-fix-python-optimize.patch"
|
||||
)
|
||||
|
||||
DOCS=( "LICENSE.md" "README.md" "SU2_PY/documentation.txt" )
|
||||
|
||||
src_unpack() {
|
||||
unpack "${P}.tar.gz"
|
||||
if use test ; then
|
||||
einfo "Unpacking ${P}-TestCases.tar.gz to /var/tmp/portage/sci-physics/${P}/work/${P}/TestCases"
|
||||
tar -C "${P}"/TestCases --strip-components=1 -xzf "${DISTDIR}/${P}-TestCases.tar.gz" || die
|
||||
fi
|
||||
if use tutorials ; then
|
||||
einfo "Unpacking ${P}-Tutorials.tar.gz to /var/tmp/portage/sci-physics/${P}/work/${P}"
|
||||
mkdir "${P}"/Tutorials
|
||||
tar -C "${P}"/Tutorials --strip-components=1 -xzf "${DISTDIR}/${P}-Tutorials.tar.gz" || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local emesonargs=(
|
||||
-Denable-autodiff=false
|
||||
-Denable-directdiff=false
|
||||
-Denable-pastix=false
|
||||
-Denable-pywrapper=false
|
||||
-Dwith-omp=false
|
||||
$(meson_feature mpi with-mpi)
|
||||
$(meson_use cgns enable-cgns)
|
||||
$(meson_use mkl enable-mkl)
|
||||
$(meson_use openblas enable-openblas)
|
||||
$(meson_use tecio enable-tecio)
|
||||
$(meson_use test enable-tests)
|
||||
)
|
||||
meson_src_configure
|
||||
}
|
||||
|
||||
src_test() {
|
||||
ln -s ../../${P}-build/SU2_CFD/src/SU2_CFD SU2_PY/SU2_CFD
|
||||
ln -s ../../${P}-build/SU2_DEF/src/SU2_DEF SU2_PY/SU2_DEF
|
||||
ln -s ../../${P}-build/SU2_DOT/src/SU2_DOT SU2_PY/SU2_DOT
|
||||
ln -s ../../${P}-build/SU2_GEO/src/SU2_GEO SU2_PY/SU2_GEO
|
||||
ln -s ../../${P}-build/SU2_MSH/src/SU2_MSH SU2_PY/SU2_MSH
|
||||
ln -s ../../${P}-build/SU2_SOL/src/SU2_SOL SU2_PY/SU2_SOL
|
||||
|
||||
export SU2_RUN="${S}/SU2_PY"
|
||||
export SU2_HOME="${S}"
|
||||
export PATH=$PATH:$SU2_RUN
|
||||
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
|
||||
|
||||
einfo "Running UnitTests ..."
|
||||
../${P}-build/UnitTests/test_driver
|
||||
|
||||
pushd TestCases/
|
||||
use mpi && python parallel_regression.py
|
||||
use mpi || python serial_regression.py
|
||||
use tutorials && use mpi && python tutorials.py
|
||||
popd
|
||||
}
|
||||
|
||||
src_install() {
|
||||
meson_src_install
|
||||
mkdir -p "${ED}$(python_get_sitedir)"
|
||||
mv "${ED}"/usr/bin/{FSI,SU2,*.py} -t "${ED}$(python_get_sitedir)"
|
||||
python_optimize "${D}/$(python_get_sitedir)"
|
||||
|
||||
if use tutorials ; then
|
||||
insinto "/usr/share/${P}"
|
||||
doins -r Tutorials
|
||||
fi
|
||||
}
|
||||
24
sci-physics/SU2/files/SU2-7.0.4-fix-env.patch
Normal file
24
sci-physics/SU2/files/SU2-7.0.4-fix-env.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
diff -Naur old_env/SU2_CFD/include/output/tools/CWindowingTools.hpp new_env/SU2_CFD/include/output/tools/CWindowingTools.hpp
|
||||
--- old_env/SU2_CFD/include/output/tools/CWindowingTools.hpp 2020-03-31 12:26:03.000000000 +0300
|
||||
+++ new_env/SU2_CFD/include/output/tools/CWindowingTools.hpp 2020-05-10 17:04:24.000000000 +0300
|
||||
@@ -28,7 +28,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
-#include "../../../Common/include/option_structure.hpp"
|
||||
+#include "../../../../Common/include/option_structure.hpp"
|
||||
|
||||
class CWindowingTools{
|
||||
public:
|
||||
diff -Naur old_env/UnitTests/meson.build new_env/UnitTests/meson.build
|
||||
--- old_env/UnitTests/meson.build 2020-05-10 17:03:43.000000000 +0300
|
||||
+++ new_env/UnitTests/meson.build 2020-05-10 17:04:35.000000000 +0300
|
||||
@@ -24,7 +24,7 @@
|
||||
test_driver = executable(
|
||||
'test_driver',
|
||||
unit_test_files,
|
||||
- install : true,
|
||||
+ install : false,
|
||||
dependencies : [su2_cfd_dep, common_dep, su2_deps, catch2_dep],
|
||||
cpp_args: ['-fPIC', default_warning_flags, su2_cpp_args]
|
||||
)
|
||||
2302
sci-physics/SU2/files/SU2-7.0.4-fix-python-optimize.patch
Normal file
2302
sci-physics/SU2/files/SU2-7.0.4-fix-python-optimize.patch
Normal file
File diff suppressed because it is too large
Load Diff
31
sci-physics/SU2/files/SU2-7.0.4-unbundle_boost.patch
Normal file
31
sci-physics/SU2/files/SU2-7.0.4-unbundle_boost.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff -Naur old_static/externals/tecio/meson.build new_shared/externals/tecio/meson.build
|
||||
--- old_static/externals/tecio/meson.build 2020-05-09 16:35:10.000000000 +0300
|
||||
+++ new_shared/externals/tecio/meson.build 2020-05-10 11:52:36.000000000 +0300
|
||||
@@ -1,15 +1,15 @@
|
||||
-check_dir = run_command(python,
|
||||
- script_path / 'check_dir.py',
|
||||
- 'boost')
|
||||
-if check_dir.returncode() != 0
|
||||
- message('Extracting boost ...')
|
||||
- extract_boost = run_command(python,
|
||||
- script_path / 'extract_file.py',
|
||||
- 'boost.tar.gz',
|
||||
- meson.current_source_dir(), check: true)
|
||||
-else
|
||||
- message('Boost sources found.')
|
||||
-endif
|
||||
+#check_dir = run_command(python,
|
||||
+# script_path / 'check_dir.py',
|
||||
+# 'boost')
|
||||
+#if check_dir.returncode() != 0
|
||||
+# message('Extracting boost ...')
|
||||
+# extract_boost = run_command(python,
|
||||
+# script_path / 'extract_file.py',
|
||||
+# 'boost.tar.gz',
|
||||
+# meson.current_source_dir(), check: true)
|
||||
+#else
|
||||
+# message('Boost sources found.')
|
||||
+#endif
|
||||
|
||||
if mpi
|
||||
subdir('teciompisrc')
|
||||
28
sci-physics/SU2/metadata.xml
Normal file
28
sci-physics/SU2/metadata.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>torokhov-s-a@yandex.ru</email>
|
||||
<name>Sergey Torokhov</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="cgns">Build with CGNS support (bundled)</flag>
|
||||
<flag name="mkl">Enable Intel MKL support</flag>
|
||||
<flag name="openblas">Enable OpenBLAS support</flag>
|
||||
<flag name="tecio">Enable TECIO support</flag>
|
||||
<flag name="tutorials">Install Tutorials files</flag>
|
||||
</use>
|
||||
<longdescription>
|
||||
The SU2 suite is an open-source collection of C++ based software tools
|
||||
for performing Partial Differential Equation (PDE) analysis and solving
|
||||
PDE-constrained optimization problems.
|
||||
|
||||
The toolset is designed with Computational Fluid Dynamics (CFD)
|
||||
and aerodynamic shape optimization in mind, but is extensible
|
||||
to treat arbitrary sets of governing equations such as potential flow,
|
||||
elasticity, electrodynamics, chemically-reacting flows, and many others.
|
||||
</longdescription>
|
||||
<upstream>
|
||||
<remote-id type="github">su2code/SU2</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user