[petsc-dev] Extending Petsc

Jose David Bermeol jbermeol at purdue.edu
Thu Sep 12 10:41:25 CDT 2013


Hi, now I'm trying to compile Petsc with mkl, not just for BLAS/LAPACK functions, but for all functionalities of mkl. What I did until now is to add the file mkl.py to config/PETSc/packages, with the following code:

import PETSc.package

class Configure(PETSc.package.NewPackage):
  def __init__(self, framework):
    PETSc.package.NewPackage.__init__(self, framework)
    self.functions    = ['set_default_options']
    self.includes     = ['mkl.h']
    self.liblist      = [['libmkl_intel_lp64.so', 'libmkl_intel_thread.so', 'libmkl_core.so']]
    self.double       = 1
    self.complex      = 1
    #self.worksonWindows   = 1
    #self.downloadonWindows= 1
    return

I base the implementation in papi.py and SuperLu.py. Then I'run

./configure --with-mpi-dir=$MPI_HOME --with-mkl-lib=$MKL_ROOT/lib/intel64 --with-mkl-include=$MKL_ROOT/include

And it throws the following error:

*******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):
-------------------------------------------------------------------------------
--with-mkl-lib=['PATH/lib/intel64'] and 
--with-mkl-include=['PATH/include'] did not work
*******************************************************************************

the trace in configure.log is not clear, and I'm not sure if the problem is because all the libraries are shared object libraries (.so) and not static(.a). So maybe you have ideas of why this is happening.

Thanks 

----- Original Message -----
From: "Barry Smith" <bsmith at mcs.anl.gov>
To: "Jose David Bermeol" <jbermeol at purdue.edu>
Cc: petsc-dev at mcs.anl.gov
Sent: Wednesday, September 11, 2013 8:27:23 PM
Subject: Re: [petsc-dev] Extending Petsc


On Sep 11, 2013, at 5:23 PM, Jose David Bermeol <jbermeol at purdue.edu> wrote:

> So a couple of more question:
> 
> 1. My code in Petsc and my package depends on intel mkl, I was thinking to compile Petsc to use mkl using --with-mkl-dir flag, do I have to add something in the setupDependencies() method, and because mkl is not in config.packages how can I do that? 

   You copy something like superlu.py to mkl.py and edit that.  

    PETSc automatically loads up all the files in the config/PETSc/packages directory so you don't have to list your new file anywhere in setup dependencies or anything

> 
> 2. My package is already installed, so do I have to code the install method?

    Nope

> 
> Thanks 
> 
> ----- Original Message -----
> From: "Barry Smith" <bsmith at mcs.anl.gov>
> To: "Jose David Bermeol" <jbermeol at purdue.edu>
> Cc: petsc-dev at mcs.anl.gov
> Sent: Wednesday, September 11, 2013 5:25:36 PM
> Subject: Re: [petsc-dev] Extending Petsc
> 
> 
>   You need to put a file in config/PETSc/packages   with the name package.py (name of your package) you can, for example, copy superlu.py and edit it to match your package. This is the file that will make sure that PETSC_HAVE_PACKAGE is defined.
> 
>   Barry
> 
> 
> 
> On Sep 11, 2013, at 4:21 PM, Jose David Bermeol <jbermeol at purdue.edu> wrote:
> 
>> Hi, right now I'm working in add a new solver for seq aij matrices. What I have until this point are the following files inside the folder aij/seq/:
>> 
>>   - package/       folder with my code
>>   - package.c      a initial implementation of the solver.
>>   - makefile       is basically a copy of the make file in superlu, but using the name of my package instead of "superlu".
>> 
>> Also I add to petscmat.h my solver type. Then I run ./configure with the flag --with-package-dir=PATH_TO_PACKAGE. The thing is that when I'm compiling the variable PETSC_HAVE_PACKAGE doesn't show up, I guess that means the variable is 0 or something else happens, and my code is not going to be compile. So if you could give some ideas of why Petsc doesn't compile my code.
>> 
>> 
>> Thanks 
>> 



More information about the petsc-dev mailing list