Compiling Mac 10.9.4

Discussion of compilation configuration and issues

Compiling Mac 10.9.4

Postby whirlybird » Mon Aug 25, 2014 12:03 am

Hello! I have been trying to compile the software on my Mac, running os 10.9.4. I got pretty far, I thought, and now have an error I don't know what to do with. I was following the instructions at http://gmatcentral.org/display/GW/Building+on+Mac

I'm using GMAT version r12138, the most recent trunk.

1. Already had xcode installed.

2. Installed wxWidgets 3.0.1 successfully (I ran the demo apps it came with to check)

3. Got cspice

4. Internal GSFC link doesn't work, but was able to successfully compile f2c from netlib.org using the handy script at http://hpc.sourceforge.net/buildf2c

5. PCRE - compiled with no errors

6. GMAT configuration - did all the steps to edit BuildEnv.mk

7. Plugins - did not set up Matlab plugin, but did set up CInterface, EphemPropogator, Estimation, EventLocator, and ExtraPropogators

cd to top level directory, which was the gmat-code-trunk directory before I renamed it
set environment variable PLATFORM=mac
run make

Here is the output I don't know what to do with:
Code: Select all
$make

cd src; make -f MakeGmat.eclipse all; \
   cd ../plugins; make all; \

cd base; make -f MakeBase.eclipse all
g++ -O3 -funroll-loops -fno-rtti  -ffriend-injection  -Wall -fno-common -dynamic  -D__MAC__ -I/Applications/GMAT/cspice/include -D__USE_SPICE__ -arch i386 -Iinclude -Ifoundation -Ihardware -Iexecutive -Ievent -Iattitude -Ispacecraft -Iasset -Iforcemodel -Iforcemodel/harmonic -Ipropagator -Isubscriber -Icommand -Isolarsys -Ifactory -Istopcond -Iinterpreter -Iutil -Iinterpolator -Iinterface -Iparameter -Iconfigs -Iburn -Isolver -Ifunction -Icoordsystem -Imath -Iplugin -I../gui/include -I../gui/include/bitmaps -I../gui/app -I../gui/view -I../gui/output -I../gui/foundation -I../gui/subscriber -I../gui/mission  -c -o asset/AssetException.o asset/AssetException.cpp
clang: error: unknown argument: '-ffriend-injection' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make[2]: *** [asset/AssetException.o] Error 1
make[1]: *** [base/lib/libGmatBase.dylib] Error 2
cd CInterfacePlugin; make all;
cd src; make all
rm -rf ../lib/libCInterface.dylib
g++ -O3 -fno-strict-aliasing -fno-rtti -fPIC -Wall   -arch i386 -Iinclude -Iplugin -Ifactory -Ipropagator -Icommand -I../../../src/base/include -I../../../src/base/attitude -I../../../src/base/burn -I../../../src/base/command -I../../../src/base/configs -I../../../src/base/coordsystem -I../../../src/base/executive -I../../../src/base/event -I../../../src/base/factory -I../../../src/base/forcemodel -I../../../src/base/foundation -I../../../src/base/function -I../../../src/base/hardware -I../../../src/base/interface -I../../../src/base/interpolator -I../../../src/base/interpreter -I../../../src/base/math -I../../../src/base/parameter -I../../../src/base/plugin -I../../../src/base/propagator -I../../../src/base/solarsys -I../../../src/base/solver -I../../../src/base/stopcond -I../../../src/base/subscriber -I../../../src/base/spacecraft -I../../../src/base/util  -c -o command/PrepareMissionSequence.o command/PrepareMissionSequence.cpp
In file included from command/PrepareMissionSequence.cpp:19:
In file included from command/PrepareMissionSequence.hpp:24:
In file included from ../../../src/base/command/GmatCommand.hpp:37:
In file included from ../../../src/base/solarsys/SolarSystem.hpp:37:
In file included from ../../../src/base/solarsys/CelestialBody.hpp:33:
In file included from ../../../src/base/foundation/SpacePoint.hpp:36:
In file included from ../../../src/base/util/A1Mjd.hpp:29:
In file included from ../../../src/base/util/UtcDate.hpp:32:
../../../src/base/util/DateUtil.hpp:60:25: error: friend declaration specifying
      a default argument must be a definition
   friend Real GMAT_API ModifiedJulianDate(YearNumber year, MonthOfYear month,
                        ^
In file included from command/PrepareMissionSequence.cpp:20:
In file included from ../../../src/base/command/Propagate.hpp:26:
In file included from ../../../src/base/command/PropagationEnabledCommand.hpp:28:
In file included from ../../../src/base/propagator/Propagator.hpp:73:
In file included from ../../../src/base/forcemodel/PhysicalModel.hpp:106:
../../../src/base/spacecraft/Spacecraft.hpp:68:25: warning:
      'Spacecraft::HasAttitude' hides overloaded virtual function
      [-Woverloaded-virtual]
   virtual bool         HasAttitude();
                        ^
../../../src/base/foundation/SpacePoint.hpp:77:23: note: hidden overloaded
      virtual function 'SpacePoint::HasAttitude' declared here: different
      qualifiers (const vs none)
   virtual bool       HasAttitude() const;
                      ^
In file included from command/PrepareMissionSequence.cpp:20:
In file included from ../../../src/base/command/Propagate.hpp:26:
In file included from ../../../src/base/command/PropagationEnabledCommand.hpp:28:
In file included from ../../../src/base/propagator/Propagator.hpp:73:
In file included from ../../../src/base/forcemodel/PhysicalModel.hpp:106:
../../../src/base/spacecraft/Spacecraft.hpp:202:9: warning:
      'Spacecraft::SetEpoch' hides overloaded virtual function
      [-Woverloaded-virtual]
   void SetEpoch(const std::string &ep);
        ^
../../../src/base/spacecraft/SpaceObject.hpp:43:25: note: hidden overloaded
      virtual function 'SpaceObject::SetEpoch' declared here: type mismatch at
      1st parameter ('const Real' (aka 'const double') vs 'const std::string &'
      (aka 'const basic_string<char, char_traits<char>, allocator<char> > &'))
   virtual Real         SetEpoch(const Real ep);
                        ^
In file included from command/PrepareMissionSequence.cpp:20:
In file included from ../../../src/base/command/Propagate.hpp:26:
In file included from ../../../src/base/command/PropagationEnabledCommand.hpp:28:
In file included from ../../../src/base/propagator/Propagator.hpp:73:
In file included from ../../../src/base/forcemodel/PhysicalModel.hpp:106:
../../../src/base/spacecraft/Spacecraft.hpp:203:9: warning:
      'Spacecraft::SetEpoch' hides overloaded virtual function
      [-Woverloaded-virtual]
   void SetEpoch(const std::string &type, const std::string &ep, Real a1mjd);
        ^
../../../src/base/spacecraft/SpaceObject.hpp:43:25: note: hidden overloaded
      virtual function 'SpaceObject::SetEpoch' declared here: different number
      of parameters (1 vs 3)
   virtual Real         SetEpoch(const Real ep);
                        ^
In file included from command/PrepareMissionSequence.cpp:20:
In file included from ../../../src/base/command/Propagate.hpp:34:
In file included from ../../../src/base/stopcond/StopCondition.hpp:26:
In file included from ../../../src/base/parameter/paramdefs.hpp:24:
../../../src/base/parameter/Parameter.hpp:177:25: warning:
      'Parameter::GetCommentLine' hides overloaded virtual function
      [-Woverloaded-virtual]
                        GetCommentLine(Integer which = 1);
                        ^
../../../src/base/foundation/GmatBase.hpp:100:25: note: hidden overloaded
      virtual function 'GmatBase::GetCommentLine' declared here: different
      number of parameters (0 vs 1)
                        GetCommentLine() const;
                        ^
In file included from command/PrepareMissionSequence.cpp:20:
In file included from ../../../src/base/command/Propagate.hpp:34:
In file included from ../../../src/base/stopcond/StopCondition.hpp:26:
In file included from ../../../src/base/parameter/paramdefs.hpp:24:
../../../src/base/parameter/Parameter.hpp:178:25: warning:
      'Parameter::SetCommentLine' hides overloaded virtual function
      [-Woverloaded-virtual]
   virtual void         SetCommentLine(const std::string &comment,
                        ^
../../../src/base/foundation/GmatBase.hpp:101:25: note: hidden overloaded
      virtual function 'GmatBase::SetCommentLine' declared here: different
      number of parameters (1 vs 2)
   virtual void         SetCommentLine(const std::string &comment);
                        ^
5 warnings and 1 error generated.
make[3]: *** [command/PrepareMissionSequence.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2
whirlybird
 
Posts: 1
Joined: Sun Aug 24, 2014 11:44 pm

Re: Compiling Mac 10.9.4

Postby CharlesInHouston » Sat Aug 30, 2014 10:13 pm

We are both trying to do the same thing, we should exchange notes. First, I have exchanged email with the GSFC folks and we cannot install the GUI version of GMAT on 64 bit (I guess OS 10.9.4) systems. They have some more work to do to enable that.

We SHOULD be able to install the Console version (I guess it has a fixed window?). I have general instructions but have not yet gotten it to work.

You should edit the BuildEnv.mk file, in the macosx directory, to:

Code: Select all
# *** EDIT THIS *** - Flags used to control the build
# 1 = 64-bit, 0 = 32-bit - BUT set this only if it is not set in the main project Makefile
#                          OR you are building the GmatConsole separately
ifndef BUILD_64BIT
BUILD_64BIT = 0
endif 


Also in that directory, MakeBase.eclipse is named Makefile and should be renamed. If you "cat" that Makefile you can see that it is really MakeBase.eclipse.


For earlier systems:

The directions are not very good - you should not get wxWidgets, but if you look around on the wxWidgets link you will find wxMac, get that.

F2C is built into Spice and is not needed; PCRE is evidently also not used any more.

On my system it starts to build but I get a fatal error when it tries to find a SpiceUsr file! I think I have the paths set right and do not know what is going on. I am still writing back and forth with GSFC and will post a note here if I get an answer.

I have run GMAT on a Windows 7 system and it does everything that I need. Now if I can get it to run on my Mac I will be happier.

Would you be willing to exchange email adds, phone numbers so we could work through this???

Charles
Charles D Phillips
CEO
Intelligent Commercial Spaceflight, LLC
CharlesInHouston
 
Posts: 9
Joined: Sat Aug 30, 2014 9:59 pm

Re: Compiling Mac 10.9.4

Postby CharlesInHouston » Sun Aug 31, 2014 1:27 am

Now that I read my answer, it could have been clearer.

I modified BuildEnv.mk in the /macosx/ directory, to set that flag to build the Console (non-GUI) version. I ignored the F2C and PCRE parts of that file. When I moved BuildEnv.mk to the /GMAT_2014a.src/ directory and gave it the Make command, it did go off to build the application and then I got the fatal SpiceUsr error. I did rename Makefile to MakeBase.eclipse since that file comes with the original download with the wrong name.

Plugins do not work at this time if you were to be able to build a GMAT on a 64 bit system so we should ignore them for now.

I must have some error in my pathnames - there are two places where you set the path to Spice and they are the same right now. I may try some variations.

Charles
Houston, Texas
Charles D Phillips
CEO
Intelligent Commercial Spaceflight, LLC
CharlesInHouston
 
Posts: 9
Joined: Sat Aug 30, 2014 9:59 pm

Re: Compiling Mac 10.9.4

Postby CharlesInHouston » Tue Sep 02, 2014 8:44 pm

I believe that I have finally compiled GMAT in the "console" version but now I have no idea about how to get it to run!

Charles
Charles D Phillips
CEO
Intelligent Commercial Spaceflight, LLC
CharlesInHouston
 
Posts: 9
Joined: Sat Aug 30, 2014 9:59 pm


Return to Compiling GMAT

Who is online

Users browsing this forum: No registered users and 2 guests