[petsc-dev] PETSc-Cuda with gfortran 4.7

Dave Nystrom dnystrom1 at comcast.net
Wed Mar 13 20:01:23 CDT 2013


Attached is nvcc.profile and nvcc.profile.orig.  See the last line in
nvcc.profile.

Also, to build gcc 4.6.3 on Fedora 17, I needed to follow the following
procedure.

yum install gcc mpfr-devel libmpc libmpc-devel glibc-devel glibc-devel.i686

configure --prefix=where_to_install \
          --program-suffix=46 \
          --enable-languages=c,c++,fortran

make
make install

Not sure why glibc-devel.i686 is needed for a 64 bit install but I had to
have that for the build to work.

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nvcc.profile
Type: application/octet-stream
Size: 361 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130313/87752313/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nvcc.profile.orig
Type: application/octet-stream
Size: 305 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130313/87752313/attachment-0001.obj>
-------------- next part --------------

Satish Balay writes:
 > Can you post your current nvcc.profile? [to see how its modified to specify a different
 > compiler]
 > 
 > thanks,
 > Satish
 > 
 > On Wed, 13 Mar 2013, Nystrom, William D wrote:
 > 
 > > Asmund,
 > > 
 > > Do the failures you report below occur in cuda code that is ultimately compiled with nvcc?
 > > I have not had problems compiling petsc-dev with cuda support on a Fedora 17 system
 > > which uses gcc-4.7.2 and gfortran-4.7.2.  However, I have gcc 4.6.3 installed also and
 > > have nvcc pointed at it by using the /usr/local/cuda/bin/nvcc.profile with a couple of lines
 > > added.  So, when I build petsc-dev on my Fedora 17 system, it uses gcc-4.7.2 and
 > > gfortran-4.7.2 for everything except cuda code located in .cu files.  I would worry about
 > > removing some functionality in 4.7.2 with your suggested modification.
 > > 
 > > Thanks,
 > > 
 > > Dave
 > > 
 > > --
 > > Dave Nystrom
 > > LANL HPC-5
 > > Phone: 505-667-7913
 > > Email: wdn at lanl.gov
 > > Smail: Mail Stop B272
 > >        Group HPC-5
 > >        Los Alamos National Laboratory
 > >        Los Alamos, NM 87545
 > > 
 > > 
 > > ________________________________________
 > > From: petsc-dev-bounces at mcs.anl.gov [petsc-dev-bounces at mcs.anl.gov] on behalf of ?smund Ervik [Asmund.Ervik at sintef.no]
 > > Sent: Wednesday, March 13, 2013 6:32 AM
 > > To: Karl Rupp
 > > Cc: petsc-dev at mcs.anl.gov
 > > Subject: Re: [petsc-dev] PETSc-Cuda with gfortran 4.7
 > > 
 > > Hi Karli,
 > > 
 > > I don't think this interferes with anything else, since all it does is
 > > undef some C++ stuff which conflicts with CUDA, and was introduced in
 > > gcc 4.7. That is, the things it undefines are also undefined when one
 > > uses gcc 4.6 or lower. It is general for gcc >= 4.7.
 > > 
 > > Best regards,
 > > \AA smund
 > > 
 > > On 12. mars 2013 15:13, Karl Rupp wrote:
 > > > Hi Ervik,
 > > >
 > > > thanks for the hint. Do you happen to have any information on whether
 > > > the suggested fix interferes with other versions of GCC or CUDA? Is this
 > > > specific to version 4.7.2 or a 'general fix' for GCC?
 > > >
 > > > Best regards,
 > > > Karli
 > > >
 > > >
 > > > On 03/12/2013 02:35 AM, ?smund Ervik wrote:
 > > >> Hi all,
 > > >>
 > > >> (This suggestion is two lines of code, so I hope it will survive the git/hg apocalypse/transition today. If not, I'll resend it tomorrow.)
 > > >>
 > > >> Trying to compile PETSc with Cuda enabled, following the example in config/examples/arch-cuda-double.py, I get an error with gfortran 4.7.2 when making (configure works fine).
 > > >> This error is apparently well-known with Cuda and gcc 4.7.2. To fix it, I added two lines to include/petsc-private/petscimpl.h:
 > > >> #undef _GLIBCXX_ATOMIC_BUILTINS
 > > >> #undef _GLIBCXX_USE_INT128
 > > >> and everything works fine. I guess you should add this to petsc-dev, possibly with some if-statement around these lines.
 > > >>
 > > >> Best regards,
 > > >> ?smund Ervik
 > > >>
 > > >
 > > >
 > > 
 > > --
 > > Sendt fra Thunderbird
 > > 


More information about the petsc-dev mailing list