[Gate-users] Workaround for compiling Gate on OS X 10.8 Mountain Lion & 10.7 Lion
Gaens, Michaela
m.gaens at fz-juelich.de
Wed Sep 5 08:23:29 CEST 2012
Hi Marc and Gate Users,
I actually ran into the same trouble when trying to compile Gate v6.2 on Mac OS X Lion yesterday. In the end I also managed to compile and run Gate, but I went the other way and looked at the code instead of the compiler.
Looking at the definition of std:ostringstream (http://www.cplusplus.com/reference/iostream/ostringstream/ostringstream/), the used constructor in GateUIcmdWithAVector.hh line 124 indeed has the wrong arguments, since it does not expect an integer. After a slight modification the error disappeared.
I then encountered one more error related to GateMaps.hh:
/Applications/gate_v6.2/source/digits_hits/include/GateMaps.hh:120:7: error: use of undeclared identifier 'insert'
It seems that a "this->" was missing there.
After changing that, the compilation completed (using llvm-gcc-4.2) and also the benchmarks worked fine.
I have attached the modified files.
GateUIcmdWithAVector.hh belongs into the folder gate_v6.2/source/general/include and GateMaps.hh into the folder gate_v6.2/source/digit_hits/include .
Maybe someone can have a look if my modifications make sense.
Michaela
On 05.09.2012, at 02:50, Marc Chamberland wrote:
> Hi Gate Users!
>
> Always one to bite the bullet, I eagerly downloaded Gate v6.2 and tried to compile it on OS X 10.8 Mountain Lion with the default compiler on the system (llvm-gcc 4.2).
>
> However, I ran into the problems described in this previous message: http://article.gmane.org/gmane.comp.science.opengate.user/1923/
>
> The compilation failed with some of these errors:
>
> Entering source/arf ...
> Compiling GateARFTableMgr.cc ...
> In file included from src/GateARFTableMgr.cc:13:
> In file included from ../arf/include/GateARFTableMgrMessenger.hh:27:
> ../general/include/GateUIcmdWithAVector.hh:124:22: error: no matching
> constructor for initialization of 'std::ostringstream' (aka
> 'basic_ostringstream<char>')
> std::ostringstream os(st,100);
> ^ ~~~~~~
> /usr/include/c++/4.2.1/sstream:436:7: note: candidate constructor not
> viable: no known conversion from 'int' to 'ios_base::openmode' (aka
> 'std::_Ios_Openmode') for 2nd argument
> basic_ostringstream(const __string_type& __str,
> ^
>
> However, I have a workaround for those who experience these issues. I was able to compile and run Gate v6.2 successfully by recompiling Geant4 9.5.p01 and Gate v6.2 with the regular "flavour" of gcc and not the llvm one included in Mountain Lion.
>
> I simply installed gcc 4.2 using Macports (macports.org; search for the port called apple-gcc42) and added the following line to the very beginning of the two CMakeLists.txt files found in the Geant4 and Gate folders, respectively:
>
> SET(CMAKE_CXX_COMPILER "/opt/local/bin/g++-apple-4.2")
>
> With this line, cmake will use the compiler prescribed above (change to the appropriate location on your system).
>
> I have validated my Gate installation with the benchmarks and everything seems to work fine.
>
> I hope this helps!
> Marc
>
>
>
> __________________________
>
> Marc Chamberland, MSc
> PhD candidate
> Department of Physics
> Carleton University
> Ottawa (ON)
>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Kennen Sie schon unsere app? http://www.fz-juelich.de/app
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GateMaps.hh
Type: application/octet-stream
Size: 5329 bytes
Desc: GateMaps.hh
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20120905/dd2e7058/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GateUIcmdWithAVector.hh
Type: application/octet-stream
Size: 4187 bytes
Desc: GateUIcmdWithAVector.hh
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20120905/dd2e7058/attachment-0003.obj>
More information about the Gate-users
mailing list