ShaningSoul / pi-qmc

Automatically exported from code.google.com/p/pi-qmc
GNU General Public License v2.0
0 stars 0 forks source link

Compiling on Max OS 10.5 #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I am trying to compile the pi code onto Mac OS X, but am running into a
couple of problems. I have installed blitz++, tvmet, libxml2, HDF5 etc and
./configure runs with out incident.

However when I come to run make, I get an error that it cannot find the
HDF5 files, placing these files in the same directory as the pi code fixes
this. However I then get the following error,

H5ReportBuilder.cc: In member function 'virtual void
H5ReportBuilder::writeStep(EstimatorManager&)':
H5ReportBuilder.cc:80: error: 'class H5::Attribute' has no member named 'flush'
H5ReportBuilder.cc: In member function 'virtual void
H5ReportBuilder::reportScalarStep(const ScalarEstimator&)':
H5ReportBuilder.cc:93: error: no matching function for call to
'H5::DataSpace::selectElements(H5S_seloper_t, int, const hsize_t**)'
./H5DataSpace.h:89: note: candidates are: void
H5::DataSpace::selectElements(H5S_seloper_t, size_t, const hsize_t*) const
make[3]: *** [H5ReportBuilder.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

It might just be a case that I'm not pointing it to the correct HDF5 files,
but I can't find anything in the help to indicate how / where to point it to.

I am trying this with the latest version of your code.

Cheers,

Peter.

Original issue reported on code.google.com by the...@gmail.com on 16 Feb 2009 at 4:11

GoogleCodeExporter commented 9 years ago
Hi Peter,

  I do all my development on intel and G5 macs running OS 10.5, so we should be able to get it to compile on 
your machine. Can you specify which compiler and HDF5 version you are using?

  I'm puzzled by the error you list above. I removed the flush call to H5::Attribute a while ago, due to just such 
an error when I moved from HDF5 1.6 to HDF5 1.8. If you look at the file 
lib/stat/H5ReportBuilder.cc in the 
subversion tree there is only a flush call on the H5File. Can you check if your 
current source code agrees with 
the subversion repository? Also, I removed all HDF5 C++ bindings from the code 
in an effort to improve 
portability, so the H5::Attribute message above looks like old code.

  The other error you describe is the inability of the configure script to find the HDF5 library. Again, this was 
something that I saw when I moved to g++ 4.4. The old configure script tests to 
look for a library generate 
errors with the newest (beta) gcc compilers. I rewrote configure so that it 
looks for specific routines in the 
libraries, which seems to work fine on the compilers I've tested on. The 
correct code should have a line 53 of 
configure.in that reads:

AC_CHECK_LIB(hdf5,H5Fopen)

  You should not have to put the HDF5 files in the source directory to compile. Please let me know if you 
continue to have problems after ensuring you have the latest configure script. 

 Thank you for posting this issue, and let me know if updating the code resolves your problem. I'd 
recommend using anonymous svn to google codes to update your source code.

  With g++ 4.4 for MacOSX from hpc.sourceforge.net, I use the following optimizations:

./configure --enable-sprng --with-ndim=3 CXXFLAGS="-g -O3 -ffast-math 
-ftree-vectorize -maltivec" 
F77=gfortran CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ 

(Leave out --enable-sprng if you don't have that library installed.)

-John

Original comment by john.shumwayjr on 17 Feb 2009 at 8:29

GoogleCodeExporter commented 9 years ago
Hi John,

I was using the code you put up on asu.edu - on your home page. And I was using 
gcc
4.0.1. With HDF5 1.8.2. However after reading your comments I've downloaded the 
code
from here, and have been trying it out with gcc 4.4.

In all the cases that follow, I find I still have to place the hdf5 files into 
the
directory's otherwise I get :

In file included from AsciiReportBuilder.cc:22:
EstimatorManager.h:24:18: error: hdf5.h: No such file or directory
In file included from AsciiReportBuilder.cc:22:
EstimatorManager.h:51: error: 'hid_t' has not been declared
make[3]: *** [AsciiReportBuilder.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I must have my hdf5 files installed in the wrong location, but I can't see 
where they
should go for the code to see them.

I did manage to compile the code form code.google.com using the gcc 4.0.1 
compilers,
however, when trying run one of the demos I run into a segmentation fault or 
bus error.

When attempting the same procedure with the new compilers, blitz++ can no 
longer be
found, I think this is down to an error with blitz (RE:
https://sourceforge.net/tracker/index.php?func=detail&aid=1979489&group_id=63961
&atid=505791
which also contains a patch I installed, which allows the ./configure to finish 
and
blitz to be found). However when trying to make I run into :

In file included from /usr/local/include/blitz/array/funcs.h:29,
                 from /usr/local/include/blitz/array/newet.h:29,
                 from /usr/local/include/blitz/array/et.h:27,
                 from /usr/local/include/blitz/array-impl.h:2515,
                 from /usr/local/include/blitz/array.h:32,
                 from SpinPhaseModel.h:20,
                 from LatticeSpinPhase.h:20,
                 from LatticeSpinPhase.cc:23:
/usr/local/include/blitz/funcs.h: In static member function 'static int
blitz::Fn_abs<int>::apply(int)':
/usr/local/include/blitz/funcs.h:509: error: conversion from 'int' to 
non-scalar type
'blitz::Range' requested
/usr/local/include/blitz/funcs.h: In static member function 'static float
blitz::Fn_abs<float>::apply(float)':
/usr/local/include/blitz/funcs.h:551: error: conversion from 'float' to 
non-scalar
type 'blitz::Range' requested
/usr/local/include/blitz/funcs.h: In static member function 'static double
blitz::Fn_abs<double>::apply(double)':
/usr/local/include/blitz/funcs.h:572: error: conversion from 'double' to 
non-scalar
type 'blitz::Range' requested
/usr/local/include/blitz/funcs.h: In static member function 'static long double
blitz::Fn_abs<long double>::apply(long double)':
/usr/local/include/blitz/funcs.h:593: error: conversion from 'long double' to
non-scalar type 'blitz::Range' requested
make[3]: *** [libspin_la-LatticeSpinPhase.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I wonder if you ran into a similar problem with regards to blitz and the new 4.4
compiler ?

Cheers,

Peter.

Original comment by the...@gmail.com on 18 Feb 2009 at 4:54

GoogleCodeExporter commented 9 years ago
Hi Peter,

  I should remove the old code from my ASU web page. I set up this subversion repository for just this reason, 
so everyone can have the latest versions. The quantum dot utilities on my ASU 
web page are also on google 
codes, under qdot-tools.

  If you got the program pi program compiled, it should be able to run the demos. Try this (I usually alias a 
3D build to pi3D, since I have also have 1D and 2D builds of pi):

jeffrey:temp jshumwa$ pi3D --demo

PIMC program: pi 1.2.0 (MPI disabled,  SPRNG disabled, 3-d)

Available demos:
     SHO                  A simple harmonic oscillator
     H_atom               A hydrogen atom
     He_atom              A helium atom
     spin                 A single spin in a magnetic field
     wire                 10 electrons in a quasi-1D GaAs (2D) wire

jeffrey:temp jshumwa$ pi3D --demo=SHO

PIMC program: pi 1.2.0 (MPI disabled,  SPRNG disabled, 3-d)

Requested demo: SHO

Writing simple harmonic oscillator input file: sho.xml

jeffrey:temp jshumwa$ cat sho.xml 
<?xml version="1.0"?>
<Simulation>
  <SuperCell a="25 A" x="1" y="1" z="1"/>
  <Species name="e" count="1" mass="1 m_e" charge="-1"/>
  <Temperature value="1 Ha" tau="0.1 Ha-1"/>
  <Action>
    <SpringAction/>
    <SHOAction/>
  </Action>
  <Estimators>
    <ThermalEnergyEstimator/>
    <VirialEnergyEstimator nwindow="500"/>
  </Estimators>
  <PIMC>
    <RandomGenerator/>
    <!-- Thermalize -->
    <Loop nrepeat="100">
      <ChooseSection nlevel="3">
         <Sample npart="1" mover="Free" species="e"/>
      </ChooseSection>
    </Loop>
    <!-- Sample data -->
    <Loop nrepeat="100">
      <Loop nrepeat="100">
        <ChooseSection nlevel="3">
          <Sample npart="1" mover="Free" species="e"/>
        </ChooseSection>
        <Measure estimator="all"/>
      </Loop>
      <Collect estimator="all"/>
      <WritePaths file="paths.out"/>
    </Loop>
  </PIMC>
</Simulation>
jeffrey:temp jshumwa$ pi3D sho.xml

PIMC program: pi 1.2.0 (MPI disabled,  SPRNG disabled, 3-d)
....

  For compiling with g++4.4, here's my experience and advice with blitz and HDF5.

Blitz++:
  Blitz seems to be pretty sensitive to the compiler. I know I have trouble moving between icpc and g++. I'd 
recommend configuring, building, and installing blitz++ using your favorite 
compiler, then sticking to that 
compiler. Just use CXX=/usr/local/bin/g++ or something like that in your 
configure command with blitz++.

HDF5:
  Again, you are probably safest configuring and building with your favorite compiler, but I haven't had too 
much trouble. The bigger issue is to change the prefix: --prefix=/usr/local 
Otherwise it defaults to installing 
in your home directory. Also, if you want c++ bindings (no longer required in 
my codes) you need --enable-
cxx  I haven't tried compiling with MPI support yet.

Also, the API changed significantly from HDF5-1.6 to HDF5-1.8. I've tried to 
modify my source codes so that 
they are compatible with both versions, but please let me know if you find any 
new bugs with HDF5.

I have occasionally used the hdf5 distribution from fink on my mac, but it's 
usually an older version and I've 
gotten away from doing that. My preference now is to install the needed 
packages in /usr/local/ on my mac.

-John

Original comment by john.shumwayjr on 19 Feb 2009 at 12:00

GoogleCodeExporter commented 9 years ago

Original comment by john.shumwayjr on 4 Jul 2009 at 9:06