libcerf 1.8 (new formula)
Closes #32808. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
edbf1eca7c
commit
4ff3735987
1 changed files with 37 additions and 0 deletions
37
Formula/libcerf.rb
Normal file
37
Formula/libcerf.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
class Libcerf < Formula
|
||||
desc "Numeric library for complex error functions"
|
||||
homepage "http://apps.jcns.fz-juelich.de/doku/sc/libcerf"
|
||||
url "http://apps.jcns.fz-juelich.de/src/libcerf/libcerf-1.8.tgz"
|
||||
sha256 "b2001dc594e9d85e2f4133fec52b4f7da02e9c2ea20518175fdebf5c81dd3857"
|
||||
|
||||
depends_on "cmake" => :build
|
||||
|
||||
def install
|
||||
mkdir "build" do
|
||||
system "cmake", "..", *std_cmake_args
|
||||
system "make", "install"
|
||||
|
||||
mv prefix/"man", share
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.c").write <<~EOS
|
||||
#include <cerf.h>
|
||||
#include <complex.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main (void) {
|
||||
double _Complex a = 1.0 - 0.4I;
|
||||
a = cerf(a);
|
||||
if (fabs(creal(a)-0.910867) > 1.e-6) abort();
|
||||
if (fabs(cimag(a)+0.156454) > 1.e-6) abort();
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcerf", "-o", "test"
|
||||
system "./test"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue