>> On Tue, May 31, 2011 at 1:08 PM, Kyunghoon Lee <[email protected]> wrote:
>>> Hello,
>>> 
>>> I'm trying to install libmesh on a MacOS X 10.6.7, which has a gcc-4.2 
>>> compiler from Xcode 3.2.6.  I had no trouble with compiling libmesh, but I 
>>> got a seg fault error for the examples.
>>> 
>>> First, I source-compiled petsc with the following configuration option:
>>> 
>>> export PETSC_DIR=$PWD
>>> ./config/configure.py --prefix=/usr/local/share/petsc/petsc-3.1-p8 
>>> --with-cc=gcc  --with-cxx=g++ --with-fc=0 —download-c-blas-lapack=1 
>>> --download-mpich=1
>>> make
>>> sudo make install PETSC_DIR=$PWD
>>> make PETSC_DIR=/usr/local/share/petsc/petsc-3.1-p8 test
>>> 
>>> and test results were good.  After petsc, I source-compiled an svn version 
>>> of libmesh with the following configuration option:
>>> 
>>> export METHOD=dbg
>>> ./configure PETSC_DIR=/usr/local/share/petsc/petsc-3.1-p8 --enable-petsc

> On May 31, 2011, at 1:22 PM, John Peterson wrote:
>> 
>> It's possible libmesh is using the wrong mpicc/mpicxx compilers when
>> you use this configuration line.  It will use the first one it finds
>> in your path, *not* the one you downloaded with PETSc.
>> 
>> So could you try:
>> 
>> CXX=/path/to/petsc/mpich/bin/mpicxx CC=/path/to/petsc/mpich/bin/mpicc
>> ./configure
>> 
>> and see if you have any better luck with the executables?
>> 
>> -- 
>> John
>> 
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with vRanger. 
>> Installation's a snap, and flexible recovery options mean your data is safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today. 
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> Libmesh-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users

On May 31, 2011, at 3:28 PM, Derek Gaston wrote:

> To avoid this... if you are not needing to compile any fortran then you can 
> just use the MPI that comes with OSX (OpenMP).  Just set CC, CXX, etc to 
> mpicc, mpicxx etc for both PetsC and libMesh... and don't tell PetsC to 
> download mpich.
> 
> Note that we don't typically work this way.  We usually download a third 
> party MPI (like MPICH2)... compile it and install it somewhere on our 
> system... then set our path and compiler environment variables to point to 
> this location and compile both PetsC and libMesh with it.  This has the nice 
> property that it is a bit more reusable across multiple packages you might be 
> compiling on your system.
> 
> So there are lots of options.... 
> 
> Derek

Thanks to John, Derek, and David's help, I was able to compile petsc and 
libmesh successfully on my Mac.  As they pointed out, the main problem was 
caused by inconsistent compilers used in building petsc and libmesh.  So I 
tried to use the same mpicc and mpicxx compilers.  

First, I used "--download-mpich=1" option in configuring petsc.  This way I can 
get mpicc from petsc-3.1-p8/externalpackages/ when petsc was compiled.  
However, somehow I could not get mpicxx.

Second, I used mpicc and mpicxx that come with Apple's Xcode.  I set 

export CXX=/usr/bin/mpicxx 
export CC=/usr/bin/mpicc

, but I got seg fault errors when I tested the compiled petsc with examples.

Last, I installed mpich2 separately using MacPorts such that

sudo port -v install mpich2 +default_mpi

, and then used mpicc and mpicxx from the MacPorts' mpich2 as follows:

export CXX=/opt/local/bin/mpicxx 
export CC=/opt/local/bin/mpicc

After that, I compiled petsc using the following commands.

export PETSC_DIR=$PWD
export CXX=/opt/local/bin/mpicxx 
export CC=/opt/local/bin/mpicc
./config/configure.py --prefix=/usr/local/share/petsc/petsc-3.1-p8 --with-fc=0 
--download-c-blas-lapack=1
make
sudo make install PETSC_DIR=$PWD
make PETSC_DIR=/usr/local/share/petsc/petsc-3.1-p8 test

(Note that I don't need Fortran, and I put the compiled petsc under 
/usr/local/share)

I had no errors in testing the compiled petsc.  Finally, I compiled libmesh 
with the following commands.

export METHOD=dbg
export CXX=/opt/local/bin/mpicxx 
export CC=/opt/local/bin/mpicc
./configure PETSC_DIR=/usr/local/share/petsc/petsc-3.1-p8 --enable-petsc  
make
make run_examples

Although I got the same warnings repetitively (plz see the below) for building 
libmesh and testing examples, all examples worked fine.  I really appreciate 
all the help from the nice guys!

Best regards,
K. Lee.

p.s.
The below is the warning messages I got for building libmesh and examples:

/opt/local/include/mpicxx.h:386: warning: unused parameter ‘oldtype’
/opt/local/include/mpicxx.h:386: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:386: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:386: warning: unused parameter ‘attr_in’
/opt/local/include/mpicxx.h:386: warning: unused parameter ‘attr_out’
/opt/local/include/mpicxx.h:388: warning: unused parameter ‘type’
/opt/local/include/mpicxx.h:388: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:388: warning: unused parameter ‘attr’
/opt/local/include/mpicxx.h:388: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:390: warning: unused parameter ‘oldtype’
/opt/local/include/mpicxx.h:390: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:390: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1453: warning: unused parameter ‘oldcomm’
/opt/local/include/mpicxx.h:1453: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1453: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1453: warning: unused parameter ‘attr_in’
/opt/local/include/mpicxx.h:1453: warning: unused parameter ‘attr_out’
/opt/local/include/mpicxx.h:1454: warning: unused parameter ‘comm’
/opt/local/include/mpicxx.h:1454: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1454: warning: unused parameter ‘attr’
/opt/local/include/mpicxx.h:1454: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1457: warning: unused parameter ‘oldcomm’
/opt/local/include/mpicxx.h:1457: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1457: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1886: warning: unused parameter ‘oldwin’
/opt/local/include/mpicxx.h:1886: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1886: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1886: warning: unused parameter ‘attr_in’
/opt/local/include/mpicxx.h:1886: warning: unused parameter ‘attr_out’
/opt/local/include/mpicxx.h:1888: warning: unused parameter ‘win’
/opt/local/include/mpicxx.h:1888: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1888: warning: unused parameter ‘attr’
/opt/local/include/mpicxx.h:1888: warning: unused parameter ‘ex’
/opt/local/include/mpicxx.h:1890: warning: unused parameter ‘oldwin’
/opt/local/include/mpicxx.h:1890: warning: unused parameter ‘keyval’
/opt/local/include/mpicxx.h:1890: warning: unused parameter ‘ex’
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to