[Users] failed build on local mac osx yosemite [SOLUTION for running HILBERT using macports]

Erik Schnetter schnetter at cct.lsu.edu
Thu May 28 09:57:08 CDT 2015


Yes.

Originally, __attribute__ is a built-in keyword for the compiler. It is not
a macro, as others suggested earlier. If you #define it to be empty, then
the compiler will never see the keyword, as the preprocessor deletes it. So
using #undef exactly undoes the action of the HDF5 header file, making the
original keyword again visible to the compiler.

-erik

On Thu, May 28, 2015 at 4:36 AM, Ian Hinder <ian.hinder at aei.mpg.de> wrote:

>
> On 28 May 2015, at 01:03, Erik Schnetter <schnetter at cct.lsu.edu> wrote:
>
> Instead of changing the order, can we add "#undef __attribute__" after
> #inluding <hdf5.h>, with a respective comment? This would undo more of the
> damage.
>
>
> So the definition of __attribute__ in hdf5 is overriding the built-in
> symbol with a macro, which allows us to then undefine the macro afterwards,
> which allows the built-in symbol to be visible again?  I was confused
> because I was thinking that undefining __attribute__ was the cause of the
> original problem.
>
>
>
> -erik
>
> On Wed, May 27, 2015 at 10:48 AM, Ian Hinder <ian.hinder at aei.mpg.de>
> wrote:
>
>>
>> On 27 May 2015, at 16:30, Roberto De Pietri <roberto.depietri at unipr.it>
>> wrote:
>>
>> Dear Comer:
>>
>> I would like to confirm you that Ian and Eric were able to correctly find
>> out the problem that originated  the build
>> problem on build using macports
>> * The HDF5 MacPorts port was updated from 1.8.14 to 1.8.15 on 16-May-2015
>>  (https://trac.macports.org/log/trunk/dports/science/hdf5/Portfile), 2
>> days before the ET release
>> * HDF5 is undefining __attribute__, and this is creating site effect
>>  (caused by including hdf5.h)
>>  that have standard c++ include to fail. This is true for gcc4.8 and
>> gcc5.1
>> * A simple solution is to change the order of includes in the include
>>  file:
>>  arrangements/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.hh. you can replace
>> this include with the
>>  one attached to the present mail.
>>
>>
>> This seems like a viable workaround until the problem is fixed in HDF5,
>> so I propose that it be implemented in CarpetIOHDF5 and backported to the
>> release branch.
>>
>>
>> * to have a fast start you may also copy the attached file:
>> osx-macports.run in
>>   simfactory/mdb/runscript.
>> * then set your local machine with the command
>>
>> simfactory/bin/sim setup
>>
>>
>> * edit the local machine file you created (using the previous command) in
>> simfactory/mdb/machine
>>  to have:
>>
>>
>> *** ASSUMING MACPORT IS INSTALLED (subversion is needed cause the version
>> that comes with XCOde
>> *** will not work [new XCODE 6.3.2 and MacPorts 2.3.3]
>>
>>
>> sudo port install subversion
>> sudo port install pkgconfig gcc49 fftw-3 gsl jpeg zlib hdf5 +fortran
>> +gfortran openmpi openssl
>>
>> ###  [FROM a MAIN DIRECTORY for the Cactus tree]
>>
>> curl -kLO
>> https://raw.githubusercontent.com/gridaphobe/CRL/ET_2015_05/GetComponents
>> chmod a+x GetComponents
>> ./GetComponents --parallel
>> https://bitbucket.org/einsteintoolkit/manifest/raw/ET_2015_05/einsteintoolkit.th
>>
>> ### [the enter in the cactus directory]
>>
>> cd Cactus
>>
>> cp [where_you_save_it]/CarpetIOHDF5.hh
>>   arrangements/Carpet/CarpetIOHDF5/src/
>> cp [where_you_save_it]/osx-macports.run  simfactory/mdb/runscript
>> simfactory/bin/sim setup
>>
>> ### [DO the local editing. In my case was the file named]
>> ### the following line should be present
>> ###
>> ###  optionlist      = osx-macports.cfg
>> ###  runscript       = osx-macports.run
>> ###  ppn             = 4
>> ###  max-num-threads = 4
>> ###  num-threads     = 1
>> ###  nodes           = 1
>> ###
>> ### NOT: my machine is “iMac (27-inch, Late 2009)”
>> ###   OS X Yosemite 10.10.3
>> ###
>> ###   Processor Name: Intel Core i5
>> ###   Processor Speed: 2,66 GHz
>> ###   Number of Processors: 1
>> ###   Total Number of Cores: 4
>> ###   L2 Cache (per Core): 256 KB
>> ###   L3 Cache: 8 MB
>> ###   Memory: 8 GB
>>
>>
>> simfactory/bin/sim build --thornlist thornlists/einsteintoolkit.th
>> simfactory/bin/sim create-run static_tov --parfile=par/static_tov.par
>> --proc=4 --num-threads=2
>>
>> ### Now the test TOV simulations should be running code is running on two
>> process using two cores each.
>>
>>
>> ## sudo port install python27
>> ## sudo port select —set python python27
>> ## sudo port install py-numpy py-scipy
>> ## sudo port install py-matplotlib
>> ## sudo port install py-h5py
>> ## sudo port install py-ipython
>> ## sudo port select —set ipython ipython27
>> ##
>> ##
>> ## TO SEE THE RESULTS:
>>
>> ipython —-pylab
>>
>> In [..]:
>> FILE='/Users/depietri/simulations/static_tov/output-0000/static_tov/hydrobase-rho.maximum.asc'
>> In [..]: d=loadtxt(FILE)
>> In [..]: plot(d[:,1],d[:,2]*1e3,'k-')
>> In [..]: ylim(1.25,1.30)
>> In [..]: xlabel(r’time   [CU c=1, G=1, $M_\odot$=1]')
>> In [..]: ylabel(r'max($\rho \cdot 10^3$)   [CU c=1, G=1, $M_\odot$=1]')
>> In [..]:
>>
>>
>>
>> <CarpetIOHDF5.hh><osx-macports.run>
>> ------------------------------------------------------------------
>> Roberto De Pietri        e-mail:roberto.depietri at fis.unipr.it
>> Dipartimento di Fisica   http://www.fis.unipr.it/~roberto.depietri
>> Universita' di Parma     tel: +39 (0521) 905280
>> Via G.P.Usberti 7/A      fax: +39 (0521) 905223
>> I-43100 PARMA --- ITALY
>>
>>
>>
>>
>>
>>
>> --
>> Ian Hinder
>> http://members.aei.mpg.de/ianhin
>>
>>
>
>
> --
> Erik Schnetter <schnetter at cct.lsu.edu>
> http://www.perimeterinstitute.ca/personal/eschnetter/
>
>
> --
> Ian Hinder
> http://members.aei.mpg.de/ianhin
>
>


-- 
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20150528/9b5fed69/attachment-0001.html 


More information about the Users mailing list