bugSimulavr: an AVR simulator - Bugs: bug #42595, Faulty swig version number...

 
 

bug #42595: Faulty swig version number comparison

Submitter:  Ryan Carsten Schmidt <ryandesign>
Submitted:  Sun 22 Jun 2014 07:00:53 AM UTC
   
 
Category:  Configure Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  tomk
Open/Closed:  Closed Component Version:  * simulavr
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 26 Jun 2014 03:46:20 AM UTC, comment #2: 

Here's a patch with a better workaround:

git diff |sed 's/^/    /'
    diff --git a/configure.ac b/configure.ac
    index 0401762..0089e8b 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -58,11 +58,17 @@ if test ${CXX_PROG} = no ; then
       # AC_PROG_CXX sets g++, if nothing is found, but if not found make will fail
       AC_MSG_ERROR([C++ compiler ${CXX} not found],1)
     fi
    -AC_PROG_SWIG(2.0.0)
    +
    +AC_PROG_SWIG(3.0.0)
     if test "x$SWIG_LIB" = "x"; then
    -  # fall back to SWIG version 1.3.x in case of SWIG 2.0.x not found!
    -  AC_MSG_NOTICE([Don't worry, we can try to find SWIG 1.3.x!])
    -  AC_PROG_SWIG(1.3.18)
    +  # fall back to SWIG version 2.0.x in case of SWIG 3.0.x not found!
    +  AC_MSG_NOTICE([Don't worry, we can try to find SWIG 2.0.x!])
    +  AC_PROG_SWIG(2.0.0)
    +  if test "x$SWIG_LIB" = "x"; then
    +    # fall back to SWIG version 1.3.x in case of SWIG 2.0.x not found!
    +    AC_MSG_NOTICE([Don't worry, we can try to find SWIG 1.3.x!])
    +    AC_PROG_SWIG(1.3.18)
    +  fi
     fi
     SWIG_ENABLE_CXX
     SWIG_MULTI_MODULE_SUPPORT

David Forrest <drf5n>
Thu 26 Jun 2014 03:02:35 AM UTC, comment #1: 

A sloppy workaround is to adjust configure.ac like this:


    diff --git a/configure.ac b/configure.ac
    index 0401762..24fe040 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -58,7 +58,7 @@ if test ${CXX_PROG} = no ; then
       # AC_PROG_CXX sets g++, if nothing is found, but if not found make will fail
       AC_MSG_ERROR([C++ compiler ${CXX} not found],1)
     fi
    -AC_PROG_SWIG(2.0.0)
    +AC_PROG_SWIG(3.0.0)
     if test "x$SWIG_LIB" = "x"; then
       # fall back to SWIG version 1.3.x in case of SWIG 2.0.x not found!
       AC_MSG_NOTICE([Don't worry, we can try to find SWIG 1.3.x!])


It would be better to add a full 3.0.0 caluse that fsalls back to 2.0.0 and so on.

David Forrest <drf5n>
Sun 22 Jun 2014 07:00:53 AM UTC, original submission:  

The code in simulavr 1.0.0 that checks if the swig version is new enough is faulty, resulting in the following error


SWIG version >= 1.3.18 is required.  You have 3.0.2.


as reported to the MacPorts project here: https://trac.macports.org/ticket/44108

The problem seems to be that it checks each digit of the two version numbers against each other without regard for the other digits. That is, it compares the first digits: is 3 less than 1? no? then move to the second digits: is 0 less than 3? yes, so the swig version must be too old.

The version comparison needs to be done correctly to fix this problem.

Ryan Carsten Schmidt <ryandesign>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tomk (Updated the item)
  • -email is unavailable- added by drf5n (Posted a comment)
  • -email is unavailable- added by ryandesign (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-15 tomk StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2014-10-04 tomk StatusNone In Progress
        Assigned toNone tomk

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code