Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: R2014a, R2015a, R2016a, R2017a, R2018A
    • Fix Version/s: R2018A
    • Component/s: Base
    • Labels:
      None
    • Environment:

      Description

      When building GMAT I get the following error:

      ryan@ryan-pc:~/gmat/build$ ./build.sh -arch x64
      ........................................................
      Starting GMAT Build
      ........................................................

      – The C compiler identification is GNU 4.7.3
      – The CXX compiler identification is GNU 4.7.3
      – Check for working C compiler: /usr/bin/cc
      – Check for working C compiler: /usr/bin/cc – works
      – Detecting C compiler ABI info
      – Detecting C compiler ABI info - done
      – Check for working CXX compiler: /usr/bin/c++
      – Check for working CXX compiler: /usr/bin/c++ – works
      – Detecting CXX compiler ABI info
      – Detecting CXX compiler ABI info - done
      – SPICE FOUND
      – CSPICE_DIR=/home/ryan/gmat/src/../depends/cspice
      – WxWidgets FOUND
      – WXWIDGET_DIR=/home/ryan/gmat/src/../depends/wxWidgets/wxWidgets-2.8.12
      – Performing Test GCC_FFRIEND_INJECTION
      – Performing Test GCC_FFRIEND_INJECTION - Success
      – Performing Test GCC_PIC
      – Performing Test GCC_PIC - Success
      64-bit compilation
      ==============================
      GMAT base setup
      – Using a shared base library
      – Executing... ulimit -s 61440
      – Use F2C version of MSISE.
      ==============================
      Console building setup
      ==============================
      GMAT GUI building setup
      – Building with DeVIL
      – Found IL: /usr/lib/libIL.so
      ==============================
      GMAT CInterface Plugin setup
      – Using a shared base library
      – Executing... ulimit -s 61440
      – Configuring done
      – Generating done
      – Build files have been written to: /home/ryan/gmat/build/linux
      Scanning dependencies of target GmatBase
      [ 0%] Building CXX object /home/ryan/gmat/build/src/base/CMakeFiles/GmatBase.dir/asset/AssetException.cpp.o
      ...
      [ 65%] Building CXX object /home/ryan/gmat/build/src/base/CMakeFiles/GmatBase.dir/util/FileUtil.cpp.o
      /home/ryan/gmat/src/base/util/FileUtil.cpp: In function ‘std::string GmatFileUtil::GetApplicationPath()’:
      /home/ryan/gmat/src/base/util/FileUtil.cpp:178:46: error: no matching function for call to ‘min(ssize_t, int)’
      /home/ryan/gmat/src/base/util/FileUtil.cpp:178:46: note: candidates are:
      In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
      from /usr/include/c++/4.7/string:42,
      from /home/ryan/gmat/src/base/./include/gmatdefs.hpp:30,
      from /home/ryan/gmat/src/base/util/FileUtil.hpp:25,
      from /home/ryan/gmat/src/base/util/FileUtil.cpp:23:
      /usr/include/c++/4.7/bits/stl_algobase.h:187:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
      /usr/include/c++/4.7/bits/stl_algobase.h:187:5: note: template argument deduction/substitution failed:
      /home/ryan/gmat/src/base/util/FileUtil.cpp:178:46: note: deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
      In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
      from /usr/include/c++/4.7/string:42,
      from /home/ryan/gmat/src/base/./include/gmatdefs.hpp:30,
      from /home/ryan/gmat/src/base/util/FileUtil.hpp:25,
      from /home/ryan/gmat/src/base/util/FileUtil.cpp:23:
      /usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
      /usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
      /home/ryan/gmat/src/base/util/FileUtil.cpp:178:46: note: deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
      make[2]: *** [/home/ryan/gmat/build/src/base/CMakeFiles/GmatBase.dir/util/FileUtil.cpp.o] Error 1
      make[1]: *** [/home/ryan/gmat/build/src/base/CMakeFiles/GmatBase.dir/all] Error 2

      The problem is that the std::min function is defined like so:

      template <class T> const T& min (const T& a, const T& b);

      This requires both arguments to be the same type, however it is being given a ssize_t (which seems to be a typedef for a long int, and an int. I tried casting the ssize_t to an int as shown in the patch and it compiled fine.

        Gliffy Diagrams

          Attachments

            Activity

            There are no subversion log entries for this issue yet.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Development Build: