Building GMAT R2018a on Ubuntu 18.04LTS

Discussion of compilation configuration and issues

Building GMAT R2018a on Ubuntu 18.04LTS

Postby n3rdx » Thu Nov 22, 2018 7:46 pm

Hello GMAT forum members.

I attempted recently to build GMAT R2018a on a freshly upgraded Ubuntu 18.04 LTS. I had issues with STEP 1 "Download and Configure GMAT Dependencies" of GMAT CMAKE Build System - I later downloaded a binary for Ubuntu (64-bit gmat-ubuntu-x64-R2018a.tar.gz) which is what i am using at present.

Does anyone have recent experience in building GMAT on a Linux 64-bit (Ubuntu 18.40 LTS) from source? What modules did you have to include if you already had gnome desktop X-windows framework running?

regards,

Samudra N3RDX
n3rdx
 
Posts: 7
Joined: Mon Jun 19, 2017 2:07 am
Location: Washington, DC

Re: Building GMAT R2018a on Ubuntu 18.04LTS

Postby n3rdx » Sun Nov 25, 2018 5:51 am

Well, after several attempts, I now have a GMAT-2018a source/data repository, configured and am busy trying to compile. I am getting stuck with Python for some reason ... any suggestions welcome?

haque@v1:~/src/GMAT/GMAT-R2018a/build/Ubuntu-64bit-1804LTS-cmakebuild$ sudo make -j2
[ 9%] Built target GmatUtil
[ 56%] Built target GmatBase
[ 56%] Built target GmatConsole
[ 56%] Built target CInterface
[ 57%] Built target DataInterface
[ 58%] Built target EphemPropagator
[ 70%] Built target GmatEstimation
[ 71%] Built target EventLocator
[ 71%] Built target ExtraPropagators
[ 72%] Built target Formation
[ 72%] Built target GeometricMeasurements
[ 73%] Built target GmatFunction
[ 75%] Built target NewParameters
[ 76%] Built target PolyhedronGravity
[ 76%] Built target ProductionPropagators
[ 76%] Building CXX object plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/command/CallPythonFunction.cpp.o
[ 94%] Built target GmatGUI
[ 94%] Built target SaveCommand
Scanning dependencies of target ScriptTools
[ 94%] Building CXX object plugins/ScriptToolsPlugin/src/base/CMakeFiles/ScriptTools.dir/command/CommandEcho.cpp.o
/home/haque/src/GMAT/GMAT-R2018a/plugins/PythonInterfacePlugin/src/base/command/CallPythonFunction.cpp: In member function ‘virtual bool CallPythonFunction::Execute()’:
/home/haque/src/GMAT/GMAT-R2018a/plugins/PythonInterfacePlugin/src/base/command/CallPythonFunction.cpp:568:27: warning: deleting ‘__gnu_cxx::__alloc_traits<std::allocator<void*> >::value_type {aka void*}’ is undefined [-Wdelete-incomplete]
delete argIn.at(i);
^
/home/haque/src/GMAT/GMAT-R2018a/plugins/PythonInterfacePlugin/src/base/command/CallPythonFunction.cpp: In member function ‘bool CallPythonFunction::BuildReturnFromPyObject(PyObject*)’:
/home/haque/src/GMAT/GMAT-R2018a/plugins/PythonInterfacePlugin/src/base/command/CallPythonFunction.cpp:647:53: error: invalid conversion from ‘char*’ to ‘char’ [-fpermissive]
rv.stringData.push_back(PyBytes_AsString(member));
In file included from /usr/include/c++/7/string:52:0,
from /home/haque/src/GMAT/GMAT-R2018a/src/base/include/gmatdefs.hpp:40,
from /home/haque/src/GMAT/GMAT-R2018a/src/base/interface/InterfaceException.hpp:36,
from /home/haque/src/GMAT/GMAT-R2018a/plugins/PythonInterfacePlugin/src/base/command/CallPythonFunction.cpp:32:
/usr/include/c++/7/bits/basic_string.h:1330:7: note: initializing argument 1 of ‘void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’
push_back(_CharT __c)
^~~~~~~~~
plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/build.make:62: recipe for target 'plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/command/CallPythonFunction.cpp.o' failed
make[2]: *** [plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/command/CallPythonFunction.cpp.o] Error 1
CMakeFiles/Makefile2:1158: recipe for target 'plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/all' failed
make[1]: *** [plugins/PythonInterfacePlugin/src/base/CMakeFiles/PythonInterface.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 95%] Building CXX object plugins/ScriptToolsPlugin/src/base/CMakeFiles/ScriptTools.dir/factory/CommandEchoFactory.cpp.o
[ 95%] Building CXX object plugins/ScriptToolsPlugin/src/base/CMakeFiles/ScriptTools.dir/plugin/GmatPluginFunctions.cpp.o
[ 95%] Linking CXX shared library ../../../../../../application/plugins/libScriptTools.so
[ 95%] Built target ScriptTools
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
haque@v1:~/src/GMAT/GMAT-R2018a/build/Ubuntu-64bit-1804LTS-cmakebuild$
n3rdx
 
Posts: 7
Joined: Mon Jun 19, 2017 2:07 am
Location: Washington, DC

Re: Building GMAT R2018a on Ubuntu 18.04LTS

Postby n3rdx » Mon Nov 26, 2018 3:15 am

Update: I made progress today. Got 100% build - These are some notes that might help others.
My environment is
  • Ubuntu 64-bit Linux (VirtualBox VM guest OS/Windows 10 Home OS on HP laptop host
  • 6 GB of RAM of possible 12 GB physical RAM
  • Assigned 1 CPU (2 Cores)
  • 18.04 LTS.

With reference to http://gmatcentral.org/display/GW/GMAT+ ... ild+System

In The top level CMakeLists.txt, I had to manually add in 'include(CheckCXXCompilerFlag) - otherwise the CMAKE process was complaining that the CHECK_CXX_COMPILER_FLAG was not a valid CMAKE command.

Code: Select all
# check fPIC flag on GCC compilers

if(CMAKE_COMPILER_IS_GNUCC)
include(CheckCXXCompilerFlag)
  CHECK_CXX_COMPILER_FLAG("-fPIC" GCC_PIC)
  if(GCC_PIC)
    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
  endif()
endif()


I then tried to configure > generate from CMAKE-GUI per the directions, and tried to follow the make instructions as specified. After several cycles of going through compilation and failing abruptly (error messages need more detail when they fail, I determined that the existing CMAKE-GUI:

  • Chose Python 2 instead of Python 3 (Had to manually choose the directories and executable)
  • I was missing python3-dev (so, had to sudo apt install python3-dev)
  • I do not have Matlab (so commented out entire Matlab section in CMAKE)
  • For all of the changes above, DELETE the CMAKE cache > Configure > CHECK THE PARAMETERS > repeat until happy > GENERATE

At the end, it was simple: cd to the build directory, and then sudo make -j2 and then if 100% with no errors, sudo make install

Still, I would like to ask if there is a better way to suppress the modules that I don't need/want/have, so I don't get the numerous errors messages on my terminal output. Also, I note that the installation phase / building phase intermixes regular user roles with superuser roles - does the GMAT system really need to be run as a superuser? Should I have created the system as a regular user and only install as a superuser? I ask, as the depends/configure.sh process actually failed if it was not done as a superuser, if I can recall what happened a few days ago.

Code: Select all
sudo !$
sudo ./GMAT-xR2018a
Moderator is updating data files...
Moderator is creating core engine...

../plugins/libMatlabInterface.so: cannot open shared object file: No such file or directory
*** Library "../plugins/libMatlabInterface" did not open.

../plugins/proprietary/libMsise86.so: cannot open shared object file: No such file or directory
*** Library "../plugins/proprietary/libMsise86" did not open.

../plugins/proprietary/libNRLMsise00.so: cannot open shared object file: No such file or directory
*** Library "../plugins/proprietary/libNRLMsise00" did not open.

../plugins/proprietary/libSNOptimizer.so: cannot open shared object file: No such file or directory
*** Library "../plugins/proprietary/libSNOptimizer" did not open.

../plugins/proprietary/libVF13Optimizer.so: cannot open shared object file: No such file or directory
*** Library "../plugins/proprietary/libVF13Optimizer" did not open.
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Setting nutation file to ../data/planetary_coeff/NUTATION.DAT
Setting leap seconds file to ../data/time/tai-utc.dat
2018-11-25 22:01:28 GMAT Moderator successfully created core engine

(GMAT-xR2018a:15525): IBUS-WARNING **: 22:01:28.667: The owner of /home/haque/.config/ibus/bus is not root!
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405

(GMAT-xR2018a:15525): Gtk-CRITICAL **: 22:01:28.911: IA__gtk_widget_set_size_request: assertion 'width >= -1' failed
2018-11-25 22:01:29 GMAT GUI successfully launched.
*** Error loading "libMatlabInterface": GMAT could not load the MATLAB interface. Please check that MATLAB is installed and configured correctly.  See the User Guide for instructions, or disable the appropriate PLUGIN line in bin/gmat_startup_file.txt to remove this error.
*** Unable to load the dynamic library "../plugins/proprietary/libMsise86"
*** Unable to load the dynamic library "../plugins/proprietary/libNRLMsise00"
*** Unable to load the dynamic library "../plugins/proprietary/libSNOptimizer"
*** Unable to load the dynamic library "../plugins/proprietary/libVF13Optimizer"



Samudra N3RDX
n3rdx
 
Posts: 7
Joined: Mon Jun 19, 2017 2:07 am
Location: Washington, DC


Return to Compiling GMAT

Who is online

Users browsing this forum: No registered users and 1 guest

cron