From nobody Tue Jan 17 07:58:50 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nx1Vg1Csmz2sZRs; Tue, 17 Jan 2023 07:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nx1Vg0bmGz3NJH; Tue, 17 Jan 2023 07:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673942331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bwGAk+4W4TJvopPRs0EwgJ7+42n/83GYhZPLLrTr2ZA=; b=hku8kNBt55B9TNDPMAktvnXM2CxYlG1F7wpiNYe48hrRARH39Be0lQQqaoKtrmTfEmpTkp 1AL+w8LTaNnFvAmrGzNqfLy0IItkFRuZ3d2kSzCFYM01tHK3NSXaKoLDOTBfLOdiUxCKSN LDhPkaLRrxuzu/8yl9fmsVW1hhz/jqsBFGxA1VOF+0DCMcF+DntBYLvPg+PcafAaZcwDsu znOnUmex8sWPttyVBwNappRXVXoOX8/QDCTKRjdqfxlK8PyiS+vO8E6TCC1rAc0kTFhc/F 6zH7jdZ7somQmqGYndRbjOwOmXAJMgbeMnqZCMn5p5rKmD7++PwvRDSm7/5gPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673942331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bwGAk+4W4TJvopPRs0EwgJ7+42n/83GYhZPLLrTr2ZA=; b=LLp1KRY4Pkyz2mNITQ99/qZ/zPMrliFSPi/MN9dWYR0dqBro/81yR/ijaEEcq3B9KNoo02 y1p7lMEpcpM0kj55CpFM8peBSSJS3l19ooAuffaW1JvXZw8kgBoxrM/JF5gQJ5mm2kTHcN 66x1bieD4f0hd4eXvImFUYC67BF9xDXD3nAQVEl1L5ceOI/d1b2de7ih+OFkY/Tqs30Bfm g9SyMTnLI0WcfFtorCG8B4jdjC0/NQ4XhgGABfsnqlYcyKtJDxQ74WyEfFeSNHPpcjz7jK gyd1jjN8Zve8LHwvO3SpBDHmnXbUTHzq7iYi4/00m3Tphi7wf99ndw6eqpKOyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673942331; a=rsa-sha256; cv=none; b=Q5knhCa7d2OEnhWZXknK2HlXJ80Y3VStPdjaNXIAuRReB83DKk8J8mYKkQBWOaf8mrBqP6 cAuyptcYQytPaCYrkrUNfGZqCaUPLLUrKz3/Zn/zOiBkIHOEv1PtpREo01DyMzeJRy2++E u1GqTB5mP670BRKOPX+pYns3phRALHvgjO3Ne+6D5qiNE9Wt3jLKPoBWghEVv+cb7kgHb9 VeM5ZsOnZZlFfWfPzcHrQuQfIbnxM70L+FWvUAukBHtMbeoF88TtAwfFD/kQJ0EyTWYyB7 SqtBAxm3t0oXCzM97xuDMNCq+SsrHANVVib7AMWrHyxcX4ngm3eAg1DPSQGBMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nx1Vf6pytzPNr; Tue, 17 Jan 2023 07:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30H7woQE050002; Tue, 17 Jan 2023 07:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30H7wo0u050001; Tue, 17 Jan 2023 07:58:50 GMT (envelope-from git) Date: Tue, 17 Jan 2023 07:58:50 GMT Message-Id: <202301170758.30H7wo0u050001@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 8bd99875f247 - main - math/py-pyaudi: New port: Library implementing the algebra of Taylor polynomials List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bd99875f247b39eb434bb43b699ee9deb05d197 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=8bd99875f247b39eb434bb43b699ee9deb05d197 commit 8bd99875f247b39eb434bb43b699ee9deb05d197 Author: Yuri Victorovich AuthorDate: 2023-01-17 07:56:19 +0000 Commit: Yuri Victorovich CommitDate: 2023-01-17 07:58:44 +0000 math/py-pyaudi: New port: Library implementing the algebra of Taylor polynomials --- math/Makefile | 1 + math/py-pyaudi/Makefile | 45 +++++++++++++++++++++++++++++++ math/py-pyaudi/distinfo | 3 +++ math/py-pyaudi/files/patch-CMakeLists.txt | 13 +++++++++ math/py-pyaudi/files/test.py | 39 +++++++++++++++++++++++++++ math/py-pyaudi/pkg-descr | 3 +++ math/py-pyaudi/pkg-plist | 4 +++ 7 files changed, 108 insertions(+) diff --git a/math/Makefile b/math/Makefile index fdb34be568b9..6e6adc82c966 100644 --- a/math/Makefile +++ b/math/Makefile @@ -977,6 +977,7 @@ SUBDIR += py-primecountpy SUBDIR += py-primme SUBDIR += py-pyFFTW + SUBDIR += py-pyaudi SUBDIR += py-pybloom SUBDIR += py-pyclipper SUBDIR += py-pycosat diff --git a/math/py-pyaudi/Makefile b/math/py-pyaudi/Makefile new file mode 100644 index 000000000000..eebd49d88c90 --- /dev/null +++ b/math/py-pyaudi/Makefile @@ -0,0 +1,45 @@ +PORTNAME= pyaudi +DISTVERSIONPREFIX= v +DISTVERSION= 1.9.2-1 +DISTVERSIONSUFFIX= -g899eb78 +CATEGORIES= math +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Library implementing the algebra of Taylor polynomials +WWW= http://darioizzo.github.io/audi/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/../LICENSE + +BUILD_DEPENDS= audi>0:math/audi \ + pybind11>0:devel/pybind11 +LIB_DEPENDS= libabsl_base.so:devel/abseil \ + libboost_serialization.so:devel/boost-libs \ + libfmt.so:devel/libfmt \ + libgmp.so:math/gmp \ + libmp++.so:math/mppp \ + libmpc.so:math/mpc \ + libmpfr.so:math/mpfr \ + libobake.so:math/obake \ + libtbb.so:devel/onetbb + +USES= cmake:testing compiler:c++20-lang python +USE_PYTHON= flavors +USE_LDCONFIG= yes + +USE_GITHUB= yes +GH_ACCOUNT= darioizzo +GH_PROJECT= audi + +WRKSRC_SUBDIR= pyaudi + +CMAKE_OFF= AUDI_BUILD_TESTS +CMAKE_ARGS= -DPYTHON_VERSION_MAJOR=3 + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +do-test: + @${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/test.py + +.include diff --git a/math/py-pyaudi/distinfo b/math/py-pyaudi/distinfo new file mode 100644 index 000000000000..dbcbd034d742 --- /dev/null +++ b/math/py-pyaudi/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1673910095 +SHA256 (darioizzo-audi-v1.9.2-1-g899eb78_GH0.tar.gz) = 984297ae749165725cf79245f34079867660999c09bee2c181ed3509a337ddcb +SIZE (darioizzo-audi-v1.9.2-1-g899eb78_GH0.tar.gz) = 494328 diff --git a/math/py-pyaudi/files/patch-CMakeLists.txt b/math/py-pyaudi/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..4509ec5ec8db --- /dev/null +++ b/math/py-pyaudi/files/patch-CMakeLists.txt @@ -0,0 +1,13 @@ +--- CMakeLists.txt.orig 2023-01-17 00:20:58 UTC ++++ CMakeLists.txt +@@ -1,3 +1,10 @@ ++ ++cmake_minimum_required(VERSION 3.8) ++ ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake_modules" "${CMAKE_SOURCE_DIR}/../cmake_modules/yacma") ++ ++include(YACMAPythonSetup) ++ + # Python version check. + if(${PYTHON_VERSION_MAJOR} LESS 3) + message(FATAL_ERROR "Minimum supported Python version is 3.0") diff --git a/math/py-pyaudi/files/test.py b/math/py-pyaudi/files/test.py new file mode 100644 index 000000000000..a88096364d54 --- /dev/null +++ b/math/py-pyaudi/files/test.py @@ -0,0 +1,39 @@ +# from http://darioizzo.github.io/audi/notebooks/example00.html + +from pyaudi import gdual_double as gdual +from pyaudi import sin, cos, tan + +# Define some variables (gduals) +x,y,z = [gdual(0.,_,3) for _ in "xyz"] + +# Create a function of these variables +f = x*x+2*tan(x/(y+1))-sin(z) +print(f) + +# Extracting the derivatives +print(f.get_derivative([0,0,1])) +print(f.get_derivative({"dz": 1})) +print(f.get_derivative({"dx":1, "dy":1})) + +# Changing the point +x = gdual(1.,"x",3) +y = gdual(2.,"y",3) +z = gdual(3.,"z",3) +f = x*x+2*tan(x/(y+1))-sin(z) +print(f) + +print(f.get_derivative([0,0,1])) + +print(-cos(3.)) + +# Encapsulating f in a function call + +def f(x,y,z): + return x*x+2*tan(x/(y+1))-sin(z) + + +x = gdual(1.,"x",3) +y = gdual(2.,"y",3) +z = gdual(3.,"z",3) +print(f(x,y,z)) #Call with gduals +print(f(1.,2.,3.)) #Call with floats diff --git a/math/py-pyaudi/pkg-descr b/math/py-pyaudi/pkg-descr new file mode 100644 index 000000000000..5191cf320c9c --- /dev/null +++ b/math/py-pyaudi/pkg-descr @@ -0,0 +1,3 @@ +obake is a C++ computer algebra library for the symbolic manipulation of sparse +multivariate polynomials and other closely-related symbolic objects (such as +truncated power series, Poisson series, etc.). diff --git a/math/py-pyaudi/pkg-plist b/math/py-pyaudi/pkg-plist new file mode 100644 index 000000000000..4b3dad9d2cd8 --- /dev/null +++ b/math/py-pyaudi/pkg-plist @@ -0,0 +1,4 @@ +%%PYTHON_SITELIBDIR%%/pyaudi/__init__.py +%%PYTHON_SITELIBDIR%%/pyaudi/_version.py +%%PYTHON_SITELIBDIR%%/pyaudi/core.so +%%PYTHON_SITELIBDIR%%/pyaudi/test.py