From 079b87a931167f3e73a64fcd4769dd8d212ccbdc Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Wed, 22 Jul 2015 14:18:27 +0200 Subject: [PATCH 02/12] gnu: Add fasthenry. * gnu/packages/engineering.scm (fasthenry): New variable. * gnu/packages/patches/fasthenry-spAllocate.patch, gnu/packages/patches/fasthenry-spBuild.patch, gnu/packages/patches/fasthenry-spFactor.patch, gnu/packages/patches/fasthenry-spSolve.patch, gnu/packages/patches/fasthenry-spUtils.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. --- gnu-system.am | 5 +++ gnu/packages/engineering.scm | 50 +++++++++++++++++++++++++ gnu/packages/patches/fasthenry-spAllocate.patch | 15 ++++++++ gnu/packages/patches/fasthenry-spBuild.patch | 13 +++++++ gnu/packages/patches/fasthenry-spFactor.patch | 35 +++++++++++++++++ gnu/packages/patches/fasthenry-spSolve.patch | 12 ++++++ gnu/packages/patches/fasthenry-spUtils.patch | 12 ++++++ 7 files changed, 142 insertions(+) create mode 100644 gnu/packages/patches/fasthenry-spAllocate.patch create mode 100644 gnu/packages/patches/fasthenry-spBuild.patch create mode 100644 gnu/packages/patches/fasthenry-spFactor.patch create mode 100644 gnu/packages/patches/fasthenry-spSolve.patch create mode 100644 gnu/packages/patches/fasthenry-spUtils.patch diff --git a/gnu-system.am b/gnu-system.am index 2ea6fb3..163ab2c 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -431,6 +431,11 @@ dist_patch_DATA = \ gnu/packages/patches/eudev-rules-directory.patch \ gnu/packages/patches/fastcap-mulGlobal.patch \ gnu/packages/patches/fastcap-mulSetup.patch \ + gnu/packages/patches/fasthenry-spAllocate.patch \ + gnu/packages/patches/fasthenry-spBuild.patch \ + gnu/packages/patches/fasthenry-spUtils.patch \ + gnu/packages/patches/fasthenry-spSolve.patch \ + gnu/packages/patches/fasthenry-spFactor.patch \ gnu/packages/patches/findutils-absolute-paths.patch \ gnu/packages/patches/findutils-localstatedir.patch \ gnu/packages/patches/flashrom-use-libftdi1.patch \ diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index c57d44b..53bd4e3 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -314,3 +314,53 @@ optimizer; and it can produce photorealistic and design review images.") "A capacitance extraction program based on a multipole-accelerated algorithm.") (license license:bsd-3))) + +(define-public fasthenry + (package + (name "fasthenry") + (version "3.0-12Nov96") + (source (origin + (method url-fetch) + (file-name (string-append name "-" version ".tar.gz")) + (uri (string-append + "http://www.rle.mit.edu/cpg/codes/" name + "-" version ".tar.z")) + (sha256 + (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi")) + (patches (list (search-patch "fasthenry-spAllocate.patch") + (search-patch "fasthenry-spBuild.patch") + (search-patch "fasthenry-spUtils.patch") + (search-patch "fasthenry-spSolve.patch") + (search-patch "fasthenry-spFactor.patch"))))) + (build-system gnu-build-system) + (arguments + `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all") + #:parallel-build? #f + #:tests? #f ;; no tests-suite + #:modules ((srfi srfi-1) + ,@%gnu-build-system-modules) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (data (string-append out "/share")) + (bin (string-append out "/bin")) + (doc (string-append data "/doc/" ,name "-" ,version)) + (examples (string-append doc "/examples"))) + (with-directory-excursion "bin" + (mkdir-p bin) + (for-each + (lambda (f) + (copy-file f (string-append bin "/" (basename f)))) + (find-files "." ".*"))) + (copy-recursively "doc" doc) + (copy-recursively "examples" examples) + #t)))))) + (home-page "http://www.rle.mit.edu/cpg/research_codes.htm") + (synopsis "Multipole-accelerated inductance analysis program") + (description + "An inductance extraction program based on a multipole-accelerated +algorithm.") + (license license:bsd-3))) diff --git a/gnu/packages/patches/fasthenry-spAllocate.patch b/gnu/packages/patches/fasthenry-spAllocate.patch new file mode 100644 index 0000000..cefd95f --- /dev/null +++ b/gnu/packages/patches/fasthenry-spAllocate.patch @@ -0,0 +1,15 @@ +Add forward declarations. + +--- fasthenry-3.0/src/fasthenry/sparse/spAllocate.c.orig 2015-07-22 09:45:28.864758891 +0200 ++++ fasthenry-3.0/src/fasthenry/sparse/spAllocate.c 2015-07-22 13:04:17.579742206 +0200 +@@ -107,7 +107,9 @@ + #include "spDefs.h" + + +- ++static InitializeElementBlocks( MatrixPtr, int, int ); ++static RecordAllocation( MatrixPtr, char* ); ++static AllocateBlockOfAllocationList( MatrixPtr ); + + + diff --git a/gnu/packages/patches/fasthenry-spBuild.patch b/gnu/packages/patches/fasthenry-spBuild.patch new file mode 100644 index 0000000..cf250fd --- /dev/null +++ b/gnu/packages/patches/fasthenry-spBuild.patch @@ -0,0 +1,13 @@ +Add forward declarations. + +--- fasthenry-3.0/src/fasthenry/sparse/spBuild.c.orig 2015-07-22 10:13:30.884638176 +0200 ++++ fasthenry-3.0/src/fasthenry/sparse/spBuild.c 2015-07-22 13:08:48.862973419 +0200 +@@ -106,6 +106,8 @@ + #include "spDefs.h" + + ++static void Translate( MatrixPtr, int*, int* ); ++static ExpandTranslationArrays( MatrixPtr, register int ); + + + diff --git a/gnu/packages/patches/fasthenry-spFactor.patch b/gnu/packages/patches/fasthenry-spFactor.patch new file mode 100644 index 0000000..52bab72 --- /dev/null +++ b/gnu/packages/patches/fasthenry-spFactor.patch @@ -0,0 +1,35 @@ +Add forward declarations. + +--- fasthenry-3.0/src/fasthenry/sparse/spFactor.c.orig 2015-07-22 10:37:04.934043468 +0200 ++++ fasthenry-3.0/src/fasthenry/sparse/spFactor.c 2015-07-22 12:52:55.515636802 +0200 +@@ -105,7 +105,29 @@ + #include "spDefs.h" + + +- ++static int FactorComplexMatrix( MatrixPtr ); ++static CreateInternalVectors( MatrixPtr ); ++static CountMarkowitz( MatrixPtr, register RealVector, int ); ++static MarkowitzProducts( MatrixPtr, int ); ++static ElementPtr SearchForPivot( MatrixPtr, int, int ); ++static ElementPtr SearchForSingleton( MatrixPtr, int ); ++static ElementPtr QuicklySearchDiagonal( MatrixPtr, int ); ++static ElementPtr SearchDiagonal( MatrixPtr, register int ); ++static ElementPtr SearchEntireMatrix( MatrixPtr, int ); ++static RealNumber FindLargestInCol( register ElementPtr ); ++static RealNumber FindBiggestInColExclude( MatrixPtr, register ElementPtr, ++ register int ); ++static ExchangeRowsAndCols( MatrixPtr, ElementPtr, register int ); ++static ExchangeColElements( MatrixPtr, int, register ElementPtr, ++ int, register ElementPtr, int ); ++static ExchangeRowElements( MatrixPtr, int, register ElementPtr, ++ int, register ElementPtr, int ); ++static RealRowColElimination( MatrixPtr, register ElementPtr ); ++static ComplexRowColElimination( MatrixPtr, register ElementPtr ); ++static UpdateMarkowitzNumbers( MatrixPtr, ElementPtr ); ++static ElementPtr CreateFillin( MatrixPtr, register int, int ); ++static int MatrixIsSingular( MatrixPtr, int ); ++static int ZeroPivot( MatrixPtr, int ); + + + diff --git a/gnu/packages/patches/fasthenry-spSolve.patch b/gnu/packages/patches/fasthenry-spSolve.patch new file mode 100644 index 0000000..bed36be --- /dev/null +++ b/gnu/packages/patches/fasthenry-spSolve.patch @@ -0,0 +1,12 @@ +Add forward declarations. + +--- fasthenry-3.0/src/fasthenry/sparse/spSolve.c.orig 2015-07-22 12:06:20.502771958 +0200 ++++ fasthenry-3.0/src/fasthenry/sparse/spSolve.c 2015-07-22 12:12:03.822798513 +0200 +@@ -95,6 +95,7 @@ + #include "spDefs.h" + + ++static void SolveComplexMatrix( MatrixPtr, RealVector, RealVector ); + + + diff --git a/gnu/packages/patches/fasthenry-spUtils.patch b/gnu/packages/patches/fasthenry-spUtils.patch new file mode 100644 index 0000000..99f650d --- /dev/null +++ b/gnu/packages/patches/fasthenry-spUtils.patch @@ -0,0 +1,12 @@ +Add forward declarations. + +--- fasthenry-3.0/src/fasthenry/sparse/spUtils.c.orig 2015-07-22 12:12:52.579370846 +0200 ++++ fasthenry-3.0/src/fasthenry/sparse/spUtils.c 2015-07-22 12:14:09.636275633 +0200 +@@ -107,6 +107,7 @@ + #include "spDefs.h" + + ++static RealNumber ComplexCondition( MatrixPtr, RealNumber, int* ); + + + -- 2.2.1