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

            Hide
            djcinsb Darrel Conway added a comment -

            I'm not sure of the status here. I build regularly on 64-bit Linux with no issue. Should this be closed?

            Show
            djcinsb Darrel Conway added a comment - I'm not sure of the status here. I build regularly on 64-bit Linux with no issue. Should this be closed?
            Hide
            ravidavi Ravi Mathur added a comment -

            Looks like Ryan was using CMake. Using the new CMake build system, I don't get these errors on Mac, Windows, or Linux. Neither did Wendy (Mac), Linda (Windows), or Darrel (Linux).

            Show
            ravidavi Ravi Mathur added a comment - Looks like Ryan was using CMake. Using the new CMake build system, I don't get these errors on Mac, Windows, or Linux. Neither did Wendy (Mac), Linda (Windows), or Darrel (Linux).
            Hide
            spacecowboy Shawn Bulger added a comment -

            I can confirm this problem when following the steps here:
            http://gmatcentral.org/display/GW/GMAT+Build+Script#_Linux

            My system is Xubuntu 14.04.4

            I had to cast the ssize_t to an int as mentioned to get past this error.

            Show
            spacecowboy Shawn Bulger added a comment - I can confirm this problem when following the steps here: http://gmatcentral.org/display/GW/GMAT+Build+Script#_Linux My system is Xubuntu 14.04.4 I had to cast the ssize_t to an int as mentioned to get past this error.
            Hide
            djcinsb Darrel Conway added a comment - - edited

            Interesting. The current build instructions are found here:

            http://gmatcentral.org/display/GW/GMAT+CMake+Build+System

            One additional question: which GMAT code source are you using? I'm assuming R2015a (the latest release). And a quick comment: An Ubuntu release of R2015a is in the works, and should be on SourceForge shortly. It's built on Ubuntu 14.04 LTS (under Unity), and looks good on both a clean install of Ubuntu (again, Unity) and on the Cinnamon UI. I'll be interested in hearing what happens on Xubuntu. (There is a source package that will go up at the same time – along with a Mac release and, I think, a build for an old flavor of Red Hat Enterprise.)

            Show
            djcinsb Darrel Conway added a comment - - edited Interesting. The current build instructions are found here: http://gmatcentral.org/display/GW/GMAT+CMake+Build+System One additional question: which GMAT code source are you using? I'm assuming R2015a (the latest release). And a quick comment: An Ubuntu release of R2015a is in the works, and should be on SourceForge shortly. It's built on Ubuntu 14.04 LTS (under Unity), and looks good on both a clean install of Ubuntu (again, Unity) and on the Cinnamon UI. I'll be interested in hearing what happens on Xubuntu. (There is a source package that will go up at the same time – along with a Mac release and, I think, a build for an old flavor of Red Hat Enterprise.)

              People

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

                Dates

                • Created:
                  Updated:
                  Development Build: