Menu

Unable to compile plotSUMmOn on x86 linux

Help
2006-07-28
2013-04-23
  • Jonathan Barber

    Jonathan Barber - 2006-07-28

    Hi, I downloaded summon via CVS in order to try summon for one of my users.

    To compile summon I needed to make the following changes:
    # cvs diff
    ? summon
    cvs diff: Diffing .
    Index: Makefile
    ===================================================================
    RCS file: /cvsroot/summon/SUMmOn/Makefile,v
    retrieving revision 1.1.1.1
    diff -r1.1.1.1 Makefile
    18c18
    < LDFLAGS= -L/usr/lib -L${GSLROOT}/.libs -L${GSLROOT}/cblas/.libs -lgsl -lgslcblas -lm
    ---
    > LDFLAGS= -L/usr/lib -L${GSLROOT}/.libs -L${GSLROOT}/cblas/.libs -lz -lgsl -lgslcblas -lm
    Index: PeaksUtils.cpp
    ===================================================================
    RCS file: /cvsroot/summon/SUMmOn/PeaksUtils.cpp,v
    retrieving revision 1.1.1.1
    diff -r1.1.1.1 PeaksUtils.cpp
    103c103
    <   if( !(pPeaks = readPeaks( rampFile , pScanIndex[scanNum])) )
    ---
    >   if( !(pPeaks = (float *) readPeaks( rampFile , pScanIndex[scanNum])) )

    The first to account for a dependancy of RAMP on zlib, the second to correct a compiler error I get otherwise:
    PeaksUtils.cpp:103: error: cannot convert ‘RAMPREAL*’ to ‘float*’ in assignment

    plotSUMmOn is giving me grief though with RAP, which I also downloaded today via CVS. The following fails:

    # RAPROOT=/homes/jon/DATA/NOBACK/sashimi/rap/rap/ make
    g++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE    -I. -I -I. -I/homes/jon/DATA/NOBACK/sashimi/rap/rap/ -I. -I/include -Wno-deprecated -O3 -c ./ plotSUMmOn.cpp
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: multiple definition of ‘enum whatToRead’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: previous definition here
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: conflicting declaration ‘HEADER’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: ‘HEADER’ has a previous declaration as ‘whatToRead HEADER’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: conflicting declaration ‘PEAKS’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: ‘PEAKS’ has a previous declaration as ‘whatToRead PEAKS’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: conflicting declaration ‘ALL’
    /homes/jon/DATA/NOBACK/sashimi/rap/rap/rap.hpp:19: error: ‘ALL’ has a previous declaration as ‘whatToRead ALL’
    PeaksUtils.hpp:44: error: ‘rap’ is not a type
    PeaksUtils.hpp:47: error: ‘rap’ is not a type
    PeaksUtils.hpp:72: error: ‘rap’ is not a type
    plotSUMmOn.cpp: In function ‘vff readPeaks(std::string, std::string, int)’:
    plotSUMmOn.cpp:231: error: ‘reader’ was not declared in this scope
    plotSUMmOn.cpp:231: error: expected type-specifier before ‘rap’
    plotSUMmOn.cpp:231: error: expected `;' before ‘rap’
    plotSUMmOn.cpp:240: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
    /usr/include/cgicc/HTTPCookie.h: At global scope:
    /usr/include/cgicc/HTTPCookie.h:57: warning: inline function ‘cgicc::HTTPCookie& cgicc::HTTPCookie::operator=(const cgicc::HTTPCookie&)’ used but never defined
    /usr/include/cgicc/MStreamable.h:65: warning: inline function ‘cgicc::MStreamable& cgicc::MStreamable::operator=(const cgicc::MStreamable&)’ used but never defined
    make: *** [plotSUMmOn.o] Error 1
    #

    Should I using a specific version of RAMP?

    The g++ version is:
    g++ (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    This is under linux x86 (kubuntu).

     
    • Patrick Pedrioli

      Hi Jonathan,
          thank you for posting your corrections to the Makefile for SUMmOn. I have updated the version in the CVS.

      Regarding plotSummon.cgi:
      The CVS of RAP has been branched long time ago. The branch you should check out is called rap_new (i.e.  cvs -z3 -d:pserver:anonymous@summon.cvs.sourceforge.net:/cvsroot/summon co -r ramp_new -P rap). This is now indicated in the README of plotSummon.
      After downloading RAP. Compile it and copy librap.so into you library path. Once this is done you should be able to compile plotSummon.
      Should you prefer avoiding the dynamic dependency on librap.so, comment out the "dynamic" LDFLAGS declaration from the Makefile for plotSummon and uncomment the "partially static" one (before doing this you will need to update your CVS check-out).

      I hope this solved your problem, otherwise don't hesitate to post more questions.

      Cheers,

          Patrick

       
      • Jonathan Barber

        Jonathan Barber - 2006-07-31

        Hi, your makefile change missed a space between the -lgslcblas -lz arguments for LDFLAGS.

        I believe you that the cvs commandline should refer to sashimi, not summon, i.e.:
        cvs -z3 -d:pserver:anonymous@sashimi.cvs.sourceforge.net:/cvsroot/sashimi co -r rap_new -P rap

        With the rap_new co, everything worked fine. However, when I ran plotSummon.cgi without any command line arguments, it segfaults with the output and backtrace:

        Exception message is:
        Could not read data from file
        Exception message is:
        Could not read data from file

        Program received signal SIGSEGV, Segmentation fault.
        [Switching to Thread -1225397440 (LWP 29607)]
        0x0805c961 in PeaksUtils::readPeaks ()
        (gdb) bt
        #0  0x0805c961 in PeaksUtils::readPeaks ()
        #1  0x0804f1c0 in readPeaks ()
        #2  0x0804f6df in main ()

        This is because the rap constructor called from readPeaks() doesn't return a false value if there is no file to read. The following patch makes sure that a file is being passed to the CGI, and initialises some of the variables that are set. The values passed to the CGI should be checked more rigourously is a security risk BTW.

        Index: plotSUMmOn.cpp

        RCS file: /cvsroot/summon/plotSUMmOn/plotSUMmOn.cpp,v
        retrieving revision 1.2
        diff -r1.2 plotSUMmOn.cpp
        57c57
        <   int scanNum , candidateNum , charge;
        ---
        >   int scanNum = 0, candidateNum = 0, charge = 0;
        165a166,168
        >       else {
        >         exit(0);
        >       }

         
    • Patrick Pedrioli

      Thank you again Jonathan. I have applied the changes you suggested.

       

Log in to post a comment.

MongoDB Logo MongoDB