Bug 1476616

Summary: enable libcerf in gnuplot.
Product: [Fedora] Fedora Reporter: Dmitri A. Sergatskov <dasergatskov>
Component: gnuplotAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: alst2821, amello, fkluknav, jamatos, mark.shoulson, orion, rdieter
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-07 01:35:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1639186    
Bug Blocks:    

Description Dmitri A. Sergatskov 2017-07-30 18:58:55 UTC
This is a feature request.

gnuplot includes support for libcerf library which provides
erf() and related function:

http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package

Fedora currently does not ship libcerf and gnuplot is compiled without it.

Please  include libcerf in gnuplot.

Dmitri.

Comment 1 Fedora Admin XMLRPC Client 2017-07-31 12:47:46 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Jan Kurik 2017-08-15 07:01:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 3 Dmitri A. Sergatskov 2017-10-04 17:53:33 UTC
On related note gnuplot 5.2.0 has been released:

https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.0/

Comment 4 Rex Dieter 2018-10-14 15:58:04 UTC
marking RFE/FutureFeature to avoid auto-close

Comment 5 José Matos 2018-10-15 09:11:49 UTC
I have submitted libcerf for inclusion in Fedora.

Comment 6 R Mercado 2018-10-16 21:17:57 UTC
I tried to compile gnuplot using the library by Jose Matos.

I found that there is a problem and I propose the patch below to fix the problem.

The problem is that libcerf defines "cmplx" as
#    define cmplx double _Complex
and there is a clash with "struct cmplx" defined in gp_types.h

--- gnuplot-5.2.5/src/gp_types.h~	2018-10-03 04:40:25.000000000 +0100
+++ gnuplot-5.2.5/src/gp_types.h	2018-10-16 21:35:13.683301020 +0100
@@ -140,7 +140,7 @@
  * into one of scanner/internal/standard/util .h, but I've yet to
  * decide which of them */
 
-struct cmplx {
+struct gp_cmplx {
 	double real, imag;
 };
 
@@ -148,7 +148,7 @@
     enum DATA_TYPES type;
     union {
 	int int_val;
-	struct cmplx cmplx_val;
+	struct gp_cmplx cmplx_val;
 	char *string_val;
 	char **data_array;
 	struct value *value_array;

Comment 7 José Matos 2018-10-16 21:47:50 UTC
(In reply to R Mercado from comment #6)
> I tried to compile gnuplot using the library by Jose Matos.
> 
> I found that there is a problem and I propose the patch below to fix the
> problem.

There is an upstream patch (in gnuplot) for this issue:

https://github.com/gnuplot/gnuplot/commit/0508c9c59d27cd32529fa2ddfc440a618f6a8cca#diff-2d506530da12533b1582fe5359bb08b1

Comment 8 Pavel Cahyna 2018-10-30 12:11:27 UTC
I see that libcerf passed review request, when it appears in Fedora I'll enable it in gnuplot.

Comment 9 Pavel Cahyna 2018-11-03 16:24:40 UTC
Updated package with libcerf support are available at https://copr.fedorainfracloud.org/coprs/pcahyna/gnuplot-updates/.
But, the build logs show
BUILDSTDERR: checking for LIBCERF... configure: WARNING:
BUILDSTDERR: Package requirements (libcerf) were not met:
BUILDSTDERR: Package 'libcerf', required by 'virtual:world', not found
BUILDSTDERR: Consider adjusting the PKG_CONFIG_PATH environment variable if you
BUILDSTDERR: installed software in a non-standard prefix.
BUILDSTDERR: Alternatively, you may set the environment variables LIBCERF_CFLAGS
BUILDSTDERR: and LIBCERF_LIBS to avoid the need to call pkg-config.
BUILDSTDERR: See the pkg-config man page for more details.
BUILDSTDERR: checking for library containing cdawson... 
-lcerf

and later

  cerf() and other special functions from libcerf: yes

so, is libcerf support built properly? Can anyone test, please?

Comment 10 Pavel Cahyna 2018-11-04 15:07:41 UTC
(In reply to José Matos from comment #7)
> (In reply to R Mercado from comment #6)
> > I tried to compile gnuplot using the library by Jose Matos.
> > 
> > I found that there is a problem and I propose the patch below to fix the
> > problem.
> 
> There is an upstream patch (in gnuplot) for this issue:
> 
> https://github.com/gnuplot/gnuplot/commit/
> 0508c9c59d27cd32529fa2ddfc440a618f6a8cca#diff-
> 2d506530da12533b1582fe5359bb08b1

Thanks, the patch is included in the copr builds.

Comment 11 R Mercado 2018-11-05 08:57:10 UTC
(In reply to Pavel Cahyna from comment #9)
> 
>   cerf() and other special functions from libcerf: yes
> 
> so, is libcerf support built properly? Can anyone test, please?

A friend who uses gnuplot could test, but he would need a fedora 28 package.

Could you generate a build for fedora 28 please?

Thanks.

Comment 12 Pavel Cahyna 2018-11-05 09:13:02 UTC
(In reply to R Mercado from comment #11)
> (In reply to Pavel Cahyna from comment #9)
> > 
> >   cerf() and other special functions from libcerf: yes
> > 
> > so, is libcerf support built properly? Can anyone test, please?
> 
> A friend who uses gnuplot could test, but he would need a fedora 28 package.
> 
> Could you generate a build for fedora 28 please?
> 
> Thanks.

Sure, it is in copr, see above.

Comment 13 R Mercado 2018-11-05 20:49:27 UTC
Hi. I tested a simple plot and it works okay.

I am asking in the fedora users and  gnuplot-info mailing lists for examples that exercise libcerf.

Thanks,
Ronaldo

Comment 14 R Mercado 2018-11-05 22:18:17 UTC
Ethan Merit answered my query. Ethan says:

=======
Run the scripts  complex_trig.dem and cerf.dem provided in the demo directory.
Compare the output to the on-line demo collection
    http://gnuplot.sourceforge.net/demo_5.3/complex_trig.html
    http://gnuplot.sourceforge.net/demo_5.3/cerf.html
=====

I can report that the examples don't work.

I also checked that there is a 5.2 version of the demo pages at 

http://gnuplot.sourceforge.net/demo_5.2/cerf.html

A really simple test is to try to plot the "VP" function

I paste the output below:
===========
gnuplot> plot VP(x,1.53,0.0) 
         undefined function: VP

===========
Other test is the faddeeva function
===========
gnuplot> plot real( faddeeva(x) )
         undefined function: faddeeva
===========
However the test of LIBCERF compilation option passes okay
============
gnuplot> if (strstrt(GPVAL_COMPILE_OPTIONS,"+LIBCERF")) {
more> print "bu"
more> exit;
more> }

============

Comment 15 R Mercado 2018-11-05 22:19:04 UTC
I got Ethan's surname wrong. It's Merritt. Sorry.

Comment 16 Dmitri A. Sergatskov 2018-11-05 23:03:46 UTC
Note that since libcerf-1.8 they changed scaling of Voigt function so
the Voigt profile plots will look different than those on the gnuplot page.

See: 

http://apps.jcns.fz-juelich.de/src/libcerf/CHANGELOG

Dmitri.
--

Comment 17 Fedora Update System 2018-12-29 01:42:45 UTC
libcerf-1.11-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d92a998d87

Comment 18 Fedora Update System 2018-12-29 01:43:36 UTC
libcerf-1.11-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-cb974b5d2a

Comment 19 José Matos 2018-12-29 09:46:40 UTC
(In reply to Fedora Update System from comment #18)
> libcerf-1.11-1.fc29 has been submitted as an update to Fedora 29.
> https://bodhi.fedoraproject.org/updates/FEDORA-2018-cb974b5d2a

This update is important because:
 1) it fixes normalization of the Voigt function, that was broken in libcerf 1.8-1.10;
 2) from the Changelog, "Rename type cmplx into _cerf_cmplx to avoid name clash with Gnuplot pre 5.3.". So no need for a separate patch for gnuplot to fix this issue.

A Happy New Year for all. :-)

Comment 20 Fedora Update System 2018-12-30 02:29:36 UTC
libcerf-1.11-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d92a998d87

Comment 21 Fedora Update System 2018-12-30 03:17:16 UTC
libcerf-1.11-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-cb974b5d2a

Comment 22 Fedora Update System 2019-01-07 01:35:39 UTC
libcerf-1.11-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2019-01-07 02:35:58 UTC
libcerf-1.11-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Mark 2019-10-07 23:49:15 UTC
"If problems still persist,..."
This bug, "enable libcerf in gnuplot," is marked CLOSED, yet libcerf is not enabled in gnuplot in Fedora 30, as of 2019-10-08.  This is stalled on https://bugzilla.redhat.com/show_bug.cgi?id=1457252, then?  Just about 1 year ago, on 2018-10-16, the comment there said "I am going to merge it in a few days unless there are objections."  That didn't seem to happen.  Just too much workload?  I don't (yet) know enough about building rpms and distributions to contribute a patch, but trying to follow up on this.

Comment 25 Pavel Cahyna 2019-10-08 06:37:38 UTC
(In reply to Mark from comment #24)
> "If problems still persist,..."
> This bug, "enable libcerf in gnuplot," is marked CLOSED, yet libcerf is not
> enabled in gnuplot in Fedora 30, as of 2019-10-08.  This is stalled on
> https://bugzilla.redhat.com/show_bug.cgi?id=1457252, then?  Just about 1
> year ago, on 2018-10-16, the comment there said "I am going to merge it in a
> few days unless there are objections."  That didn't seem to happen.  Just
> too much workload?  I don't (yet) know enough about building rpms and
> distributions to contribute a patch, but trying to follow up on this.

Yes, this bug was closed mistakenly.

Please try the code in https://copr.fedorainfracloud.org/coprs/pcahyna/gnuplot-updates/. I will then merge it to the package.

Comment 26 Pavel Cahyna 2019-10-08 06:38:32 UTC
I mean, try the builds available there.