Menu

#2077 Build with libcerf fails

None
closed-fixed
nobody
None
2019-01-02
2018-10-10
No

Building against libcerf fails. libcerf defines a cmplx type, which is then tried to be redefined in gp_types.h

In file included from libcerf.c:15:
gp_types.h:143:8: error: expected ‘{’ before ‘double’
struct cmplx {
^~~~~
gp_types.h:143:8: error: two or more data types in declaration specifiers
gp_types.h:143:8: error: two or more data types in declaration specifiers
struct cmplx {
^~~~~
gp_types.h:151:9: error: expected ‘{’ before ‘double’
struct cmplx cmplx_val;
^~~~~
gp_types.h:151:9: error: two or more data types in declaration specifiers
gp_types.h:151:9: error: two or more data types in declaration specifiers
struct cmplx cmplx_val;
^~~~~

Related

Bugs: #2077

Discussion

  • Ethan Merritt

    Ethan Merritt - 2018-10-10

    More information needed, since it isn't failing on other systems.
    In libcerf v1.1 the defined complex structure is named _Complex, which does not conflict with anything in gnuplot.

    What is your OS?
    What version of libcerf do you have?
    Can you Email me the source for the cerf.h file it provides?

     
  • Antonio Rojas

    Antonio Rojas - 2018-10-10

    This is with libcerf 1.8, available at http://apps.jcns.fz-juelich.de/src/libcerf/

     
  • Ethan Merritt

    Ethan Merritt - 2018-10-10

    Thank you for the report and the pointer to a newer libcerf.

    It works for me with the following 1-line change to the gnuplot source.

    diff --git a/src/libcerf.c b/src/libcerf.c
    index 1cbbbea..0593732 100644
    --- a/src/libcerf.c
    +++ b/src/libcerf.c
    @@ -6,7 +6,7 @@
      * Ethan A Merritt - July 2013
      */
    
    -#include "syscfg.h"
    +#include "gp_types.h"
     #ifdef HAVE_LIBCERF
     #include <complex.h>   /* C99 _Complex */
     #include <cerf.h>      /* libcerf library header */
    

    ==> HOWEVER <==
    In order to build libcerf 1.8 from the source you pointed to I had to force it with
    CFLAGS = "--std=c99 ... <other stuff="">"
    and even so the test script run by cmake generated warnings about type mismatch.
    So I am not certain whether the libcerf shared library generated by other build recipes will in all cases be compatible. Another option would have been to build it with g++ but I didn't pursue that.
    Please test.</other>

     
  • Antonio Rojas

    Antonio Rojas - 2018-10-11

    I confirm that this patch fixes the build for me too. I didn't find any of the issues you mention when building libcerf (with GCC 8.2)

    Side note: strangely, configure reports libcerf as not found, but it is used in the build anyway.

     

    Last edit: Antonio Rojas 2018-10-11
    • Ethan Merritt

      Ethan Merritt - 2018-10-11

      Great. Thanks for testing.
      Fix is in 5.3 and will be included in the next 5.2 release

      FWIW I find that the change to cerf.h was introduced in version 1.7. The linux distro package lists I checked are only up to 1.5 so it will be a while yet before this is relevant to most people. Nice to catch it early.

       
  • Ethan Merritt

    Ethan Merritt - 2018-10-11
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • Dmitri A. Sergatskov

    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.

     
    • Ethan Merritt

      Ethan Merritt - 2018-11-06

      On Mon, Nov 5, 2018 at 3:14 PM Dmitri A. Sergatskov dasergatskov@users.sourceforge.net wrote:

      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.

      Very strange. That means the libcerf output for the Voigt profile no
      longer behaves according to the description on Wikipedia or previously
      published figures. I can see the change in the code itself, but there is
      no corresponding change in the man page description that comes with
      libcerf. Either it was wrong before (libcerf < 1.8) or it is wrong now
      (libcerf 1.8) but I don't know which.

      Ethan
      

      [bugs:#2077] Build with libcerf fails

      Status: pending-fixed
      Priority:
      Created: Wed Oct 10, 2018 06:47 AM UTC by Antonio Rojas
      Last Updated: Thu Oct 11, 2018 04:28 PM UTC
      Owner: nobody

      Building against libcerf fails. libcerf defines a cmplx type, which is
      then tried to be redefined in gp_types.h

      In file included from libcerf.c:15:
      gp_types.h:143:8: error: expected ‘{’ before ‘double’
      struct cmplx {
      ^~~~~
      gp_types.h:143:8: error: two or more data types in declaration specifiers
      gp_types.h:143:8: error: two or more data types in declaration specifiers
      struct cmplx {
      ^~~~~
      gp_types.h:151:9: error: expected ‘{’ before ‘double’
      struct cmplx cmplx_val;
      ^~~~~
      gp_types.h:151:9: error: two or more data types in declaration specifiers
      gp_types.h:151:9: error: two or more data types in declaration specifiers
      struct cmplx cmplx_val;
      ^~~~~


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/gnuplot/bugs/2077/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Bugs: #2077

      • Dmitri A. Sergatskov

        On Mon, Nov 5, 2018 at 6:27 PM Ethan Merritt sfeam@users.sourceforge.net
        wrote:

        On Mon, Nov 5, 2018 at 3:14 PM Dmitri A. Sergatskov
        dasergatskov@users.sourceforge.net wrote:

        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.

        Very strange. That means the libcerf output for the Voigt profile no
        longer behaves according to the description on Wikipedia or previously
        published figures. I can see the change in the code itself, but there is
        no corresponding change in the man page description that comes with
        libcerf. Either it was wrong before (libcerf < 1.8) or it is wrong now
        (libcerf 1.8) but I don't know which.

        Ethan

        I thing the new one is wrong. The profile (integral) is definitely not
        normalized.
        I Cc this to Joachim Wuttke j.wuttke@fz-juelich.de who is listed as an
        author of the function.

        Dmitri.

         
        • Joachim Wuttke

          Joachim Wuttke - 2018-11-06

          Thanks for this report.
          The normalization went wrong in release 1.8 and stayed wrong in 1.9.
          I will withdraw these releases right now, and prepare a new release
          as soon as possible.
          For the time being, stay with 1.6 (autotools configure) or 1.7(cmake).
          Sorry for this - Joachim

           
  • Ethan Merritt

    Ethan Merritt - 2019-01-02
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.