[petsc-users] How to configure PETSc with gcc-4.9

Justin Dong jsd1 at rice.edu
Fri Apr 25 00:25:36 CDT 2014


I'll leave it running for a few hours and see what happens.

In the meantime, is it possible to tell PETSc to compile a specific .c file
using gcc-4.9? Something along the lines of this:

ALL:

include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules
include ${PETSC_DIR}/conf/test

main: main.o
gcc-4.9 -${CLINKER} -fopenmp -o main main.o ${PETSC_LIB}
${RM} -f main.o

The main reason I want to compile with gcc-4.9 is because I need to use
openmp for a simple parallel for loop. With the gcc compiler I have now
(clang), there's no support for openmp. I can get gcc-4.9 to work outside
of PETSc, but am not sure how to get it to work here if I want to do it for
a single example, or if that's even possible.


On Thu, Apr 24, 2014 at 10:03 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>    Leave it to run for several hours it could be that gcc-4.9 is just
> taking a very long time on mpich.
>
>    Barry
>
> On Apr 24, 2014, at 8:35 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
> > On Thu, Apr 24, 2014 at 9:27 PM, Justin Dong <jsd1 at rice.edu> wrote:
> > Hi all,
> >
> > I'm trying to configure PETSc on Mac OS X with gcc-4.9. Currently, it's
> configured with gcc that comes with Xcode, but I want to use gcc-4.9 that I
> installed myself. I try:
> >
> >
> > ./configure --with-cc=gcc-4.9 --with-fc=gfortran
> --download-f-blas-lapack --download-mpich
> >
> >
> >
> > But while configuring MPICH it gets stuck indefinitely. I've included
> the output below after I terminate the process. I don't have this issue if
> I just configure with cc=gcc. Any ideas what the problem is here?
> >
> > From the stack trace, its just taking a long time. If it overruns the
> timeout, it should just die. You can try
> > running using -useThreads=0 if you suspect the timeout is not working.
> >
> >    Matt
> >
> > ^CTraceback (most recent call last):
> >
> >   File "./configure", line 10, in <module>
> >
> >     execfile(os.path.join(os.path.dirname(__file__), 'config',
> 'configure.py'))
> >
> >   File "./config/configure.py", line 372, in <module>
> >
> >     petsc_configure([])
> >
> >   File "./config/configure.py", line 287, in petsc_configure
> >
> >     framework.configure(out = sys.stdout)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/framework.py",
> line 933, in configure
> >
> >     child.configure()
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/package.py",
> line 558, in configure
> >
> >     self.executeTest(self.configureLibrary)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/base.py",
> line 115, in executeTest
> >
> >     ret = apply(test, args,kargs)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/packages/MPI.py",
> line 748, in configureLibrary
> >
> >     config.package.Package.configureLibrary(self)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/package.py",
> line 486, in configureLibrary
> >
> >     for location, directory, lib, incl in self.generateGuesses():
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/package.py",
> line 232, in generateGuesses
> >
> >     d = self.checkDownload(1)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/packages/MPI.py",
> line 351, in checkDownload
> >
> >     return config.package.Package.checkDownload(self, requireDownload)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/package.py",
> line 340, in checkDownload
> >
> >     return self.getInstallDir()
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/package.py",
> line 187, in getInstallDir
> >
> >     return os.path.abspath(self.Install())
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/packages/MPI.py",
> line 366, in Install
> >
> >     return self.InstallMPICH()
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/config/packages/MPI.py",
> line 544, in InstallMPICH
> >
> >     output,err,ret  = config.base.Configure.executeShellCommand('cd
> '+mpichDir+' && ./configure '+args, timeout=2000, log = self.framework.log)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/script.py",
> line 254, in executeShellCommand
> >
> >     (output, error, status) = runInShell(command, log, cwd)
> >
> >   File
> "/Users/justindong/Classes/CAAMResearch/petsc-3.4.4/config/BuildSystem/script.py",
> line 243, in runInShell
> >
> >     thread.join(timeout)
> >
> >   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
> line 958, in join
> >
> >     self.__block.wait(delay)
> >
> >   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
> line 358, in wait
> >
> >     _sleep(delay)
> >
> >
> > KeyboardInterrupt
> >
> >
> >
> >
> >
> > Sincerely,
> >
> > Justin
> >
> >
> >
> >
> > --
> > What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> > -- Norbert Wiener
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140425/548a532d/attachment.html>


More information about the petsc-users mailing list