[petsc-users] About Configuring PETSc

Mark Adams mfadams at lbl.gov
Sat Mar 23 13:29:14 CDT 2019


On Sat, Mar 23, 2019 at 2:13 PM Maahi Talukder via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> I think I didn't build with PETSC-ARCH=arch-opt.
> So just to make sure, now I just run the command - ./configure  PETSC_ARCH
> = arch-opt - and it will create the missing directory and I can switch
> between different architectures, right?
>

I would not put any spaces around "=", and you can also just look at what
PETSc defaulted to and use that directory. PETSc will pick a default
architecture name and you should see an "arch..." directory in your PETSc
directory.


>
> Thanks,
> Maahi Talukder
>
> On Fri, Mar 22, 2019 at 3:12 PM Balay, Satish <balay at mcs.anl.gov> wrote:
>
>> Did you build PETSc with PETSC_ARCH=arch-opt?
>>
>> Btw - I used PETSC_ARCH=arch-debug to illustrate - but you already
>> have a build with PETSC_ARCH=arch-linux2-c-debug - so you should stick
>> to that.
>>
>> Satish
>>
>> On Fri, 22 Mar 2019, Maahi Talukder via petsc-users wrote:
>>
>> > Hi,
>> >
>> > I tried to run the command 'make PETSC_ARCH=arch-opt wholetest1' but it
>> > shows me the following error-
>> >
>> >
>> ..................................................................................................................................................
>> > [maahi at CB272PP-THINK1 Desktop]$ make PETSC_ARCH=arch-opt wholetest1
>> > /home/maahi/petsc/lib/petsc/conf/rules:960:
>> > */home/maahi/petsc/arch-opt/lib/petsc/conf/petscrules:
>> > No such file or directory*
>> > make: *** No rule to make target
>> > '/home/maahi/petsc/arch-opt/lib/petsc/conf/petscrules'.  Stop.
>> >
>> ........................................................................................................................................................
>> >
>> > My .bashrc is the following -
>> >
>> > .....................................................................
>> >
>> > PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/lib64/openmpi/bin
>> >
>> > export PATH
>> >
>> > export PETSC_DIR=$HOME/petsc
>> > export PETSC_ARCH=arch-linux2-c-debug
>> > #export PETSC_ARCH=arch-debug
>> >
>> >
>> ..........................................................................................
>> >
>> > Could you please tell me what went wrong?
>> >
>> > Regards,
>> > Maahi Talukder
>> >
>> >
>> > On Thu, Mar 21, 2019 at 11:55 PM Maahi Talukder <maahi.buet at gmail.com>
>> > wrote:
>> >
>> > > Thank you so much for your reply. That clear things up!
>> > >
>> > > On Thu, Mar 21, 2019 at 10:43 PM Balay, Satish <balay at mcs.anl.gov>
>> wrote:
>> > >
>> > >> On Thu, 21 Mar 2019, Maahi Talukder via petsc-users wrote:
>> > >>
>> > >> > Thank you for your reply.
>> > >> >
>> > >> > So do I need to set the value of PETSC_ARCH as needed in .bashrc
>> as I
>> > >> did
>> > >> > in case of PETSC_DIR ?
>> > >>
>> > >> You can specify PETSC_ARCH as an option to make. You can have a
>> default
>> > >> value set in .bashrc - and change to a different value on command
>> line.
>> > >>
>> > >> For ex: in .bashrc
>> > >>
>> > >> export PETSC_ARCH=arch-debug
>> > >>
>> > >> Now if you want to build with debug libraries:
>> > >>
>> > >> make wholetest1
>> > >>
>> > >> Now If you want to build with optimized libraries:
>> > >>
>> > >> make PETSC_ARCH=arch-opt wholetest1
>> > >>
>> > >>
>> > >> >  And by PETSC_ARCH=arch-opt, do you mean the
>> > >> > non-debugging mode?
>> > >>
>> > >> Yes. You can use whatever name you think is appropriate here.
>> > >>
>> > >> ./configure PETSC_ARCH=a-name-i-can-easily-associate-with-this-build
>> > >> [other configure options.]
>> > >>
>> > >> >
>> > >> > And I am using the following makefile with my code-
>> > >> >
>> > >> > CFLAGS =
>> > >> > FFLAGS =-I/home/maahi/petsc/include
>> > >> > -I/home/maahi/petsc/arch-linux2-c-debug/include -cpp -mcmodel=large
>> > >>
>> > >> Hm - you shouldn't be needing these options here. You should switch
>> your
>> > >> source files from .f to .F and .f90 to .F90 - and remove the above
>> FFLAGS
>> > >>
>> > >> Satish
>> > >>
>> > >> > CPPFLAGS =
>> > >> > FPPFLAGS =
>> > >> >
>> > >> >
>> > >> > include ${PETSC_DIR}/lib/petsc/conf/variables
>> > >> > include ${PETSC_DIR}/lib/petsc/conf/rules
>> > >> >
>> > >> > wholetest1: wholetest1.o
>> > >> > -${FLINKER} -o wholetest1 wholetest1.o ${PETSC_LIB}
>> > >> > ${RM} wholetest1.o
>> > >> >
>> > >> > So where do I add that PETSC_ARCH?
>> > >> >
>> > >> > Thanks,
>> > >> > Maahi Talukder
>> > >> >
>> > >> > On Thu, Mar 21, 2019 at 10:14 PM Balay, Satish <balay at mcs.anl.gov>
>> > >> wrote:
>> > >> >
>> > >> > > PETSc uses the concept of PETSC_ARCH to enable multiple in-place
>> > >> > > builds.
>> > >> > >
>> > >> > > So you can have a debug build with PETSC_ARCH=arch-debug, and a
>> > >> > > optimized build with PETSC_ARCH=arch-opt etc.
>> > >> > >
>> > >> > > And if you are using a petsc formatted makefile with your code -
>> you
>> > >> > > can switch between these builds by just switching PETSC_ARCH.
>> > >> > >
>> > >> > > Satish
>> > >> > >
>> > >> > > On Thu, 21 Mar 2019, Maahi Talukder via petsc-users wrote:
>> > >> > >
>> > >> > > > Dear All,
>> > >> > > >
>> > >> > > > Currently, I am running PETSc with debugging option. And it
>> says
>> > >> that if
>> > >> > > I
>> > >> > > > run ./configure --with-debugging=no, the performance would be
>> > >> faster. My
>> > >> > > > question is: what would I do if I want to go back to debugging
>> > >> mode, and
>> > >> > > If
>> > >> > > > I configure it now with no debugging option, would it make any
>> > >> changes to
>> > >> > > > my current setting?
>> > >> > > >
>> > >> > > > Regards,
>> > >> > > > Maahi Talukder
>> > >> > > >
>> > >> > >
>> > >> > >
>> > >> >
>> > >>
>> > >>
>> >
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190323/63391c0f/attachment.html>


More information about the petsc-users mailing list