[petsc-users] petsc4py f2py

Smith, Barry F. bsmith at mcs.anl.gov
Thu Jan 18 22:50:22 CST 2018



> On Jan 18, 2018, at 10:48 PM, Aurelien Ponte <aurelien.ponte at ifremer.fr> wrote:
> 
> there are indeed not petsc related mod files in /Users/aponte/.miniconda3/envs/petsc/include
> 
> I installed petsc4py via conda, may this be the issue?

  I don't know. Does conda build the "Fortran" part of PETSc? If not that would explain the missing mod files.

  Barry

> 
> aurélien
> 
> 
> Le 19/01/2018 à 05:43, Smith, Barry F. a écrit :
>> Fatal Error: Can't open module file 'petsc.mod' for reading at (1): No such file or directory
>> error: Command "/opt/local/bin/gfortran -Wall -g -fno-second-underscore -DF2PY_REPORT_ON_ARRAY_COPY=1 -I/Users/aponte/.miniconda3/envs/petsc/include -I/Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/petsc4py/include -I. -Ibuild/src.macosx-10.9-x86_64-3.6/. -I/Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include -I/Users/aponte/.miniconda3/envs/petsc/include/python3.6m -c -c ./timestepper_adv.F90 -o build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o -Jbuild/temp.macosx-10.9-x86_64-3.6/ -Ibuild/temp.macosx-10.9-x86_64-3.6/"
>> 
>> Normally the module files like petsc.mod would be in the $PETSC_DIR/$PETSC_ARCH/include so in your case I'm guessing /Users/aponte/.miniconda3/envs/petsc/include
>> 
>> so first do and ls and see if there are any *.mod files in that directory?
>> 
>> Barry
>> 
>> 
>>> On Jan 18, 2018, at 10:17 PM, Aurelien Ponte <aurelien.ponte at ifremer.fr> wrote:
>>> 
>>> Ok, I believe I made some progress.
>>> I found one more issue: PETSC_DIR was pointing toward an old macport install of petsc
>>> This is fixed now and here is what I have (without -E):
>>> 
>>> (petsc) barracuda:qgsolver aponte$ make PYTHON=~/.miniconda3/envs/petsc/bin/python PETSC_DIR=~/.miniconda3/envs/petsc build
>>> env \
>>>     F77="" F77FLAGS="" \
>>>     F90="" F90FLAGS="" \
>>>     LDSHARED="" \
>>>     /Users/aponte/.miniconda3/envs/petsc/bin/python setup.py -q build_ext --inplace
>>> Reading .f2py_f2cmap ...
>>>     Mapping "integer(kind=HANDLE_KIND)" to "long"
>>>     Mapping "integer(kind=handle_kind)" to "long"
>>> Successfully applied user defined changes from .f2py_f2cmap
>>> In file included from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0,
>>>                  from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
>>>                  from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
>>>                  from build/src.macosx-10.9-x86_64-3.6/./fortranobject.h:13,
>>>                  from ./timestepper_advmodule.c:18:
>>> /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
>>>  #warning "Using deprecated NumPy API, disable it by " \
>>>   ^
>>> In file included from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0,
>>>                  from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
>>>                  from /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
>>>                  from build/src.macosx-10.9-x86_64-3.6/./fortranobject.h:13,
>>>                  from build/src.macosx-10.9-x86_64-3.6/./fortranobject.c:2:
>>> /Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
>>>  #warning "Using deprecated NumPy API, disable it by " \
>>>   ^
>>> build/src.macosx-10.9-x86_64-3.6/./fortranobject.c: In function 'format_def':
>>> build/src.macosx-10.9-x86_64-3.6/./fortranobject.c:138:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>>>          if (size < sizeof(notalloc)) {
>>>                   ^
>>> ./timestepper_adv.F90:11.6:
>>> 
>>>   use petsc
>>>       1
>>> Fatal Error: Can't open module file 'petsc.mod' for reading at (1): No such file or directory
>>> ./timestepper_adv.F90:11.6:
>>> 
>>>   use petsc
>>>       1
>>> Fatal Error: Can't open module file 'petsc.mod' for reading at (1): No such file or directory
>>> error: Command "/opt/local/bin/gfortran -Wall -g -fno-second-underscore -DF2PY_REPORT_ON_ARRAY_COPY=1 -I/Users/aponte/.miniconda3/envs/petsc/include -I/Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/petsc4py/include -I. -Ibuild/src.macosx-10.9-x86_64-3.6/. -I/Users/aponte/.miniconda3/envs/petsc/lib/python3.6/site-packages/numpy/core/include -I/Users/aponte/.miniconda3/envs/petsc/include/python3.6m -c -c ./timestepper_adv.F90 -o build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o -Jbuild/temp.macosx-10.9-x86_64-3.6/ -Ibuild/temp.macosx-10.9-x86_64-3.6/" failed with exit status 1
>>> 
>>> -- 
>>> Aurélien Ponte
>>> Tel: (+33) 2 98 22 40 73
>>> Fax: (+33) 2 98 22 44 96
>>> UMR 6523, IFREMER
>>> ZI de la Pointe du Diable
>>> CS 10070
>>> 29280 Plouzané
>>> 
> 
> -- 
> Aurélien Ponte
> Tel: (+33) 2 98 22 40 73
> Fax: (+33) 2 98 22 44 96
> UMR 6523, IFREMER
> ZI de la Pointe du Diable
> CS 10070
> 29280 Plouzané
> 



More information about the petsc-users mailing list