Mostrando postagens com marcador patch. Mostrar todas as postagens
Mostrando postagens com marcador patch. Mostrar todas as postagens

sexta-feira, 12 de agosto de 2016

Putting hypergeometric function in gnuplot with GSL (patching)

My gnuplot version with hypergeometric function using GNU Scientific Library
hyperg_2F1.patch

--- ./src/eval.c.orig    2016-08-12 17:06:35.250145505 -0300
+++ ./src/eval.c    2016-05-03 12:34:08.000000000 -0300
@@ -191,6 +191,7 @@
     {"lambertw",  f_lambertw}, /* HBB, from G.Kuhnle 20001107 */
     {"airy",  f_airy},         /* janert, 20090905 */
     {"expint",  f_expint},     /* Jim Van Zandt, 20101010 */
+    {"hyperg_2F1",f_hyperg_2F1},

 #ifdef HAVE_LIBCERF
     {"cerf", f_cerf},        /* complex error function */
--- ./src/specfun.c.orig    2016-08-12 17:06:35.248145450 -0300
+++ ./src/specfun.c    2016-05-03 12:20:14.000000000 -0300
@@ -49,6 +49,7 @@
 #include "specfun.h"
 #include "stdfn.h"
 #include "util.h"
+#include "gsl/gsl_sf_hyperg.h"

 #define ITMAX   200

@@ -3031,9 +3032,11 @@
 extern double p1evl ( double, void *, int );
 extern double sin ( double );
 extern double cos ( double );
+extern double gsl_sf_hyperg_2F1( double , double, double, double);
 #else
 double fabs(), exp(), sqrt();
 double polevl(), p1evl(), sin(), cos();
+double gsl_sf_hyperg_2F1();
 #endif

 int
--- ./src/standard.c.orig    2016-08-12 17:06:35.255145644 -0300
+++ ./src/standard.c    2016-05-03 14:40:24.741731493 -0300
@@ -39,6 +39,7 @@
 #include "gadgets.h"        /* for 'ang2rad' and 'zero' */
 #include "gp_time.h"        /* needed by f_tmsec() and friendsa */
 #include "util.h"        /* for int_error() */
+#include "gsl/gsl_sf_hyperg.h"

 static double carlson_elliptic_rc(double x,double y);
 static double carlson_elliptic_rf(double x,double y,double z);
@@ -57,7 +58,7 @@
 static double yone __PROTO((double x));
 static double rj1 __PROTO((double x));
 static double ry1 __PROTO((double x));
-
+extern double gsl_sf_hyperg_2F1(double,double,double,double);
 /* The bessel function approximations here are from
  * "Computer Approximations"
  * by Hart, Cheney et al.
@@ -841,6 +842,30 @@
     }
 }

+void
+f_hyperg_2F1(union argument *arg)
+{
+    struct value a1;
+    double    aa,bb,cc,zz;
+
+    (void) arg;            /* avoid -Wunused warning */
+    zz=real(pop(&a1));
+    cc=real(pop(&a1));
+    bb=real(pop(&a1));
+    aa=real(pop(&a1));
+//    if (fabs(imag(&a1)) > zero || fabs(imag(&a2)) > zero)
+//    int_error(NO_CARET, "can only do elliptic integrals of reals");
+
+    if (zz < 1.0 && zz > 0)
+    push(Gcomplex(&a1, gsl_sf_hyperg_2F1(aa,bb,cc,zz), 0.0));
+    else if (zz < 0) {
+    push(Gcomplex(&a1, pow(1-zz,-aa)*gsl_sf_hyperg_2F1(aa,cc-bb,cc,zz/(zz-1)), 0.0));
+    } else {
+    undefined=TRUE;
+    push(&a1);
+    }
+
+}
 /* Terminate the autoconversion from string to numeric values */
 #undef pop

--- ./src/standard.h.orig    2016-08-12 17:06:35.252145560 -0300
+++ ./src/standard.h    2016-05-03 12:37:23.000000000 -0300
@@ -93,5 +93,6 @@
 void f_tmyear __PROTO((union argument *x));
 void f_tmwday __PROTO((union argument *x));
 void f_tmyday __PROTO((union argument *x));
+void f_hyperg_2F1 __PROTO((union argument *x));

 #endif /* GNUPLOT_STANDARD_H */

sexta-feira, 29 de abril de 2016

Patch for qtiplot 0.9.8.9 ImageWidget error

icons/../src/plot2D/ImageWidget.h:73:7: error: 'virtual void ImageWidget::paintEvent(QPaintEvent*)' is private
  void paintEvent(QPaintEvent *e);

patch link qwidget.patch


domingo, 12 de outubro de 2014

pdf2bib.py (https://github.com/janoliver/pdf2bib) / python 2.7.5 /patch

--- pdf2bib.py-orig 2014-10-12 18:18:29.561977936 -0300
+++ pdf2bib.py 2014-10-12 18:16:44.258557846 -0300
@@ -33,7 +33,7 @@
 import os
 import subprocess
 import re
-from urllib import request
+import urllib2
 import argparse


@@ -97,8 +97,8 @@
     def get_bibtex(self, doi):
         """Return bibtex entry by doi"""

-        req = request.Request(self.url.format(doi=doi), headers=self.headers)
-        f = request.urlopen(req)
+        req = urllib2.Request(self.url.format(doi=doi), headers=self.headers)
+        f = urllib2.urlopen(req)
         return f.read().decode('utf-8')


@@ -166,7 +166,7 @@
     # gather files to analyze
     f = list()
     for location in args.location:
-        if os.path.isfile(location) and ".pdf" in location.tolower():
+        if os.path.isfile(location) and ".pdf" in location:
             f.append(location)
         elif os.path.isdir(location):
             for (path, _, files) in os.walk(location):
@@ -179,9 +179,13 @@
         if doi:
             print("  .. Found DOI: {}".format(doi))
             print("  .. Fetching Metadata...")
-            b = BibEntry(bibtex.get_bibtex(doi))
+            b = BibEntry(bibtex.get_bibtex(doi).encode("utf-8"))
             b.add_arg('file', file)
-            args.output.write(b.format(exclude=args.exclude.split(",")))
+            if args.exclude:
+       exclude = args.exclude.split(",")
+     else:
+       exclude = []
+            args.output.write(b.format(exclude))
             args.output.write("\n\n")
             print("  .. Wrote Entry. ")
         else:

quarta-feira, 24 de julho de 2013

AMD-APP-SDK (2.8/2.8.1.0) patch to make samples (Slackware-current)

Get slackbuild files on
http://slackbuilds.org/repository/14.0/development/amd-app-sdk/
build package and install

*************************************************************
--- ./make/openclsdkdefs.mk-orig    2012-05-14 04:43:34.000000000 -0300
+++ ./make/openclsdkdefs.mk    2012-11-30 20:41:05.275285082 -0200
@@ -230,7 +230,7 @@
 ifdef MINGW
   LDFLAGS           += -L/usr/X11R6/lib
 else
-  LDFLAGS           += -lpthread -ldl -L/usr/X11R6/lib
+  LDFLAGS           += -lpthread -ldl -L/usr/X11R6/lib64 -lX11
 endif
   LD_LIBDIR_FLAG    := -L
   LD_SHARED_FLAG    := -shared 
--- ./samples/opencl/SDKUtil/include/SDKCommon.hpp-orig    2012-05-14 04:43:34.000000000 -0300
+++ ./samples/opencl/SDKUtil/include/SDKCommon.hpp    2012-11-30 14:38:11.671185385 -0200
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <vector>
 #include <malloc.h>
+#include <unistd.h>

 #include <CL/opencl.h>
***************************************************************
# cd /opt/amd-app-sdk
patchs the files and
# LIBAPARAPI=/opt/amd-app-sdk/samples/aparapi/AparapiUtil make

quinta-feira, 4 de abril de 2013

open64 4.5.2.1 patch

--- ./osprey/be/opt/opt_emit.cxx.orig    2012-08-08 08:14:06.000000000 -0300
+++ ./osprey/be/opt/opt_emit.cxx    2012-08-12 20:03:04.850966207 -0300
@@ -78,6 +78,7 @@

 #include <stdint.h>
 #include <sys/times.h>
+#include <unistd.h>
 #include "defs.h"
 #include "tracing.h"
 #include "erglob.h"
--- ./osprey/ipa/local/Makefile.gbase.orig    2012-08-08 08:14:43.000000000 -0300
+++ ./osprey/ipa/local/Makefile.gbase    2012-08-12 20:30:36.601746311 -0300
@@ -338,4 +338,6 @@
 #----------------------------------------------------------------------
 #  Temporary workaround
 #----------------------------------------------------------------------
+ifeq ($(BUILD_COMPILER), OPEN64)
 ipl_summarize_util.o: OPTIMIZER += -CG:all_sched=0
+endif
\ No newline at end of file
--- ./osprey-gcc-4.2.0/gcc/config/i386/linux-unwind.h.orig    2012-08-08 08:14:52.000000000 -0300
+++ ./osprey-gcc-4.2.0/gcc/config/i386/linux-unwind.h    2013-04-01 18:02:22.000000000 -0300
@@ -137,9 +137,9 @@
     {
       struct rt_sigframe {
     int sig;
-    struct siginfo *pinfo;
+    siginfo_t *pinfo;
     void *puc;
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
       } *rt_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.

quarta-feira, 3 de abril de 2013

QuTiP 2.2.0 packages (Slackware64-current 20130331) with patch

mcsolve_f90 not work (qutip 2.2.0 20130301), dont have blas library dependencies in the qutraj_run.so library
***** the patch ***** 
--- ./qutip/fortran/setup.py.orig       2013-03-01 04:49:31.000000000 -0300
+++ ./qutip/fortran/setup.py    2013-04-03 22:29:32.114191894 -0300
@@ -42,7 +42,7 @@
     if not lapack_opt:
         blas_opt = get_info('blas', notfound_action=2)
     else:
-        blas_opt = lapack_opt
+        blas_opt = get_info('blas', notfound_action=1)

     # Remove libraries key from blas_opt
     if 'libraries' in blas_opt:  # key doesn't exist on OS X ...

***********************
d340344fa72098276ca41a76cdf377e9  Cython-0.18-x86_64-1.txz
3b1bfbeeaf59f6683f38aa2fe3d2a67a  QuTiP-2.2.0-x86_64-1.txz
2481a78855f9d267c7f27c2cf2f93fb1  apiextractor-0.10.10-x86_64-2.txz
32145606c53e7e3a037f379547acdfce  blas-20110419-x86_64-3.txz
1fdd7b25d04996e2e240a90f4fae92c2  generatorrunner-0.6.16-x86_64-2.txz
201fde17c76e7dd88341e748a5bab7db  ipython-0.13.1-x86_64-1.txz
12c53c6efcfe7e2a91dbe724b33ea537  lapack-3.4.2-x86_64-2.txz
c9b79e07630931f52f1612daa3ab572b  matplotlib-1.2.1-x86_64-1.txz
b0f7603ea8925262649ee5b31008241b  nose-1.2.1-x86_64-1.txz
9fb835e2d268333efe00595c53ac6da0  numpy-1.7.0-x86_64-1.txz
03ce18e89658c8abf9c534b40a57505f  pysetuptools-0.6c11-x86_64-2.txz
64b584595a2c1d0da368c75396158e6f  pyside-qt4.8+1.1.2-x86_64-1.txz
b4e97d03d781b95d87a4ed21c1819bbe  python-dateutil-1.5-x86_64-2.txz
a8af1cec2c85ef9c9850013379e6c6d0  pytz-2013b-x86_64-1.txz
2dd6dadd6484d2ff6bcd06841d070689  scipy-0.11.0-x86_64-1.txz
e04240f5eb4b83e0709c140aaf83b275  shiboken-1.1.2-x86_64-1.txz

Google drve link
qutip-2.2.0-packages.tar

>>> import qutip.testing as qt
>>> qt.run()
Qobj data ... ok
Qobj type ... ok
Qobj Hermicity ... ok
Qobj shape ... ok
Qobj addition ... ok
Qobj subtraction ... ok
Qobj multiplication ... ok
Qobj division ... ok
Qobj power ... ok
Qobj negation ... ok
Qobj equals ... ok
Qobj getitem ... ok
Qobj multiplication type ... ok
Qobj conjugate ... ok
Qobj adjoint (dagger) ... ok
Qobj diagonals ... ok
Qobj eigenenergies ... ok
Qobj eigenstates ... ok
Qobj expm ... ok
Qobj full ... ok
Qobj ket type ... ok
Qobj bra type ... ok
Qobj operator type ... ok
Qobj superoperator type ... ok
Transform 2-level to eigenbasis and back ... ok
Transform 10-level real-values to eigenbasis and back ... ok
Transform 10-level to eigenbasis and back ... ok
Transform 10-level imag to eigenbasis and back ... ok
Consistency between transformations of kets and denstity matrices ... ok
correlation: comparing me and es for oscillator in coherent initial state ... ok
correlation: comparing me and es for oscillator in steady state ... ok
correlation: compare spectrum obtained for eseries and fft methods ... ok
Diagonalization of random two-level system ... ok
Diagonalization of composite systems ... ok
von-Neumann entropy ... ok
Linear entropy ... ok
Concurrence ... ok
Mutual information ... ok
Conditional entropy ... ok
Read and write complex valued decimal formatted data ... ok
Read and write complex valued default formatted data ... ok
Read and write complex valued exp formatted data ... ok
Read and write real valued decimal formatted data ... ok
Read and write real valued default formatted data ... ok
Read and write real valued exp formatted data ... ok
Read and write with automatic separator detection ... ok
Floquet: test unitary evolution of time-dependent two-level system ... ok
Monte-carlo: Constant H with no collapse ops (expect) ... ok
Monte-carlo: Constant H with no collapse ops (states) ... ok
Monte-carlo: Constant H (str format) with no collapse ops (expect) ... ok
Monte-carlo: Constant H (func format) with no collapse ops (expect) ... ok
Monte-carlo: Constant H (str format) with no collapse ops (states) ... ok
Monte-carlo: Constant H (func format) with no collapse ops (states) ... ok
Monte-carlo: Constant H with constant collapse ... ok
Monte-carlo: Constant H with single collapse operator ... ok
Monte-carlo: Constant H with single expect operator ... ok
Monte-carlo: Collapse terms constant (func format) ... ok
Monte-carlo: Collapse terms constant (str format) ... ok
Monte-carlo: Time-dependent H (func format) ... ok
Monte-carlo: Time-dependent H (str format) ... ok
Monte-carlo: check for correct dtypes (mc_avg=True) ... ok
Monte-carlo: check for correct dtypes (mc_avg=False) ... ok
mcsolve_f90: Constant H with no collapse ops (expect) ... ok
mcsolve_f90: Constant H with no collapse ops (states) ... ok
mcsolve_f90: Constant H with constant collapse ... ok
mcsolve_f90: Constant H with single collapse operator ... ok
mcsolve_f90: Constant H with single expect operator ... ok
mcsolve_f90: check for correct dtypes (mc_avg=True) ... ok
mcsolve_f90: check for correct dtypes (mc_avg=False) ... ok
mesolve: cavity-qubit interaction, no dissipation ... ok
mesolve: cavity-qubit without interaction, decay ... ok
mesolve: cavity-qubit with interaction, decay ... ok
mesolve: qubit without dissipation ... ok
mesolve: simple time-dependence as function list ... ok
mesolve: simple time-dependence as string list ... ok
mesolve: simple constant decay ... ok
mesolve: constant decay as function list ... ok
mesolve: constant decay as string list ... ok
mesolve: simple constant decay ... ok
mesolve: simple constant decay ... ok
odechecks: monte-carlo ... ok
Spin 1/2 operators ... ok
Spin 3/2 operators ... ok
Spin 2 operators ... ok
Spin 5/2 operators ... ok
Destruction operator ... ok
Creation operator ... ok
Identity operator ... ok
Number operator ... ok
Squeezing operator ... ok
Displacement operator ... ok
parfor ... ok
partial transpose of bipartite systems ... ok
partial transpose: comparing sparse and dense implementations ... ok
partial transpose: randomized tests on tripartite system ... ok
quantum process tomography for snot gate ... ok
quantum process tomography for cnot gate ... ok
Test mesolve qubit, with dissipation ... ok
Test mesolve qubit, no dissipation ... ok
Test essolve qubit, with dissipation ... ok
Test mcsolve qubit, with dissipation ... ok
Test mcsolve qubit, no dissipation ... ok
random Unitary ... ok
random density matrix ... ok
random hermitian ... ok
random ket ... ok
Sparse eigs Hermitian ... ok
Sparse eigs non-Hermitian ... ok
Sparse eigvals only Hermitian. ... ok
Dense eigs Hermitian. ... ok
Dense eigs non-Hermitian ... ok
Dense eigvals only Hermitian ... ok
states: coherent density matrix ... ok
states: Fock density matrix ... ok
states: thermal density matrix ... ok
Steady state: Thermal qubit ... ok
Steady state: Thermal harmonic oscillator ... ok
Superoperator: Conversion matrix to vector to matrix ... ok
Superoperator: Test compability between matrix/vector conversion and ... ok
Superoperator: Conversion between matrix and vector indices ... ok
Superoperator: Conversion vector to matrix to vector ... ok
wigner: test wigner function calculation for coherent states ... ok
wigner: test wigner function calculation for Fock states ... ok
wigner: compare wigner methods for random density matrices ... ok
wigner: compare wigner methods for random state vectors ... ok

----------------------------------------------------------------------
Ran 125 tests in 316.766s

OK

domingo, 2 de dezembro de 2012

LAMMPS no AMD HD7970

Uma simulação com mais de 2 milhões de atomos usando o potencial EAM em uma placa de vídeo da XFX (AMD HD7970 GHz edition com 3GB), tudo em dupla precisão usando LAMMPS com pacote GPU.
(double precision/LAMMPS/AMD SDK APP 2.7/fglrx 9.01.8/Slackware64-current)


--------------------------------------------------------------------------
RESULTADOS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Na GPU HD7079 1.05GHz
--------------------------------------------------------------------------
--------------------------------------------------------------------------
- Using GPGPU acceleration for eam:
-  with 1 proc(s) per device.
-  with OpenCL Parameters for: GENERIC_OCL
--------------------------------------------------------------------------
GPU 0: Tahiti, 256 cores, 2.9 GB, 1.1 GHZ (Double Precision)
GPU 1: AMD FX(tm)-8150 Eight-Core Processor           , 8 cores, 3.6 GHZ (Double Precision)
--------------------------------------------------------------------------

Initializing GPU and compiling on process 0...Done.
Initializing GPUs 0-1 on core 0...Done.

Setting up run ...
Memory usage per processor = 422.869 Mbytes
Step Temp E_pair E_mol TotEng Press
       0         1600     -7159296            0   -6741031.1    18704.149
      50    780.71972   -6943740.2            0   -6739647.9    52292.948
     100    798.21531   -6948340.9            0     -6739675    51478.838
Loop time of 29.6983 on 1 procs for 100 steps with 2022400 atoms

--------------------------------------------------------------------------
Na CPU FX-8150 com over de 4.086GHz
--------------------------------------------------------------------------

  2 by 2 by 2 MPI processor grid
Created 2022400 atoms
Setting up run ...
Memory usage per processor = 96.6497 Mbytes
Step Temp E_pair E_mol TotEng Press
       0         1600     -7159296            0   -6741031.1    18704.149
      50    780.71972   -6943740.2            0   -6739647.9    52292.948
     100    798.21531   -6948340.9            0     -6739675    51478.838
Loop time of 93.0408 on 8 procs for 100 steps with 2022400 atoms


--------------------------------------------------------------------------
AMD SDK APP 2.7 PATCH
--------------------------------------------------------------------------
--- ./make/openclsdkdefs.mk-orig        2012-05-14 04:43:34.000000000 -0300
+++ ./make/openclsdkdefs.mk     2012-11-30 20:41:05.275285082 -0200
@@ -230,7 +230,7 @@
 ifdef MINGW
   LDFLAGS           += -L/usr/X11R6/lib
 else
-  LDFLAGS           += -lpthread -ldl -L/usr/X11R6/lib
+  LDFLAGS           += -lpthread -ldl -L/usr/X11R6/lib64 -lX11
 endif
   LD_LIBDIR_FLAG    := -L
   LD_SHARED_FLAG    := -shared  
--- ./samples/opencl/SDKUtil/include/SDKCommon.hpp-orig 2012-05-14 04:43:34.000000000 -0300
+++ ./samples/opencl/SDKUtil/include/SDKCommon.hpp      2012-11-30 14:38:11.671185385 -0200
@@ -18,6 +18,7 @@
 #include

 #include

 #include

+#include


 #include

 

--------------------------------------------------------------------------
GERYON - ocl_timer.h
--------------------------------------------------------------------------
+#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
 #include "ocl_macros.h"
 #include "ocl_device.h"


segunda-feira, 13 de agosto de 2012

open64 4.5.2 patch


Some patchs for errors compiling x86 Open64 4.5.2 on Slackware64
perl 5.16 obsolete getopts, ( _SC_CLK_TCK + sysconf) errors,  g++:error:unrecognized option '-CG:all_sched=0'
***********************************************
--- ./osprey/be/opt/opt_emit.cxx.orig   2012-08-08 08:14:06.000000000 -0300
+++ ./osprey/be/opt/opt_emit.cxx        2012-08-12 20:03:04.850966207 -0300
@@ -78,6 +78,7 @@

 #include
 #include
+#include
 #include "defs.h"
 #include "tracing.h"
 #include "erglob.h"
--- ./osprey/ipa/local/Makefile.gbase.orig      2012-08-08 08:14:43.000000000 -0300
+++ ./osprey/ipa/local/Makefile.gbase   2012-08-12 20:30:36.601746311 -0300
@@ -338,4 +338,6 @@
 #----------------------------------------------------------------------
 #  Temporary workaround
 #----------------------------------------------------------------------
+ifeq ($(BUILD_COMPILER), OPEN64)
 ipl_summarize_util.o: OPTIMIZER += -CG:all_sched=0
+endif
\ No newline at end of file
--- ./osprey/common/util/gen_x_set.orig 2012-08-08 08:14:37.000000000 -0300
+++ ./osprey/common/util/gen_x_set      2012-08-09 17:17:02.046382148 -0300
@@ -111,7 +111,8 @@
 ### ====================================================================
 ### ====================================================================

-require "getopts.pl";
+#require "getopts.pl";
+use Getopt::Std;

 # Look for the templates in the same directory as this script resides.
 #
@@ -119,7 +120,8 @@
 $utildir =~ s=/[^/]*$==;
 $utildir = '.' if ( $utildir eq $0 );

-&Getopts("fs");
+#&Getopts("fs");
+getopts("fs");

 # Macro or functional interface?
 #