[petsc-users] petsc4py f2py

Aurelien Ponte aurelien.ponte at ifremer.fr
Thu Jan 18 13:34:13 CST 2018


Hum, after rereading Barry's email I feel I am confused about the point 
of adding the -E flag.
So I am pasting the full log of the make in case it may be useful:

(petsc) br146-244:qgsolver aponte$ make 
PYTHON=/Users/aponte/.miniconda3/envs/petsc/bin/python build
/Users/aponte/.miniconda3/envs/petsc/bin:/opt/local/bin:/opt/local/sbin:/Users/aponte/.miniconda3/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Library/TeX/texbin:/usr/local/bin:/Users/aponte/Installed/f90tohtml:/usr/local/mysql/bin:/Users/aponte/Tools/ftagshtml-0.520/bin:/usr/local/ferret/bin:/usr/local/bin:/Users/aponte/Installed/f90tohtml:/usr/local/mysql/bin:/Users/aponte/Tools/ftagshtml-0.520/bin:/usr/local/ferret/bin
/Users/aponte/.miniconda3/envs/petsc/bin/python
/bin/sh
env \
         F77="/opt/local/bin/mpif90-openmpi-gcc49" F77FLAGS="-Os -Os  
-I/opt/local/include" \
         F90="/opt/local/bin/mpif90-openmpi-gcc49" F90FLAGS="-Os -Os  
-I/opt/local/include -E" \
         LDSHARED="/opt/local/bin/mpif90-openmpi-gcc49" \
     /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)) {
                   ^
ld: warning: ignoring file 
build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o, file was built for 
unsupported file format ( 0x23 0x20 0x31 0x20 0x22 0x2E 0x2F 0x74 0x69 
0x6D 0x65 0x73 0x74 0x65 0x70 0x70 ) which is not the architecture being 
linked (x86_64): build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o
/bin/rm -f -r build timestepper_advmodule.c
(petsc) br146-244:qgsolver aponte$


Le 18/01/2018 à 20:23, Aurelien Ponte a écrit :
> Thanks,
>
> I corrected the two errors in the fortran code Lisandro spotted.
>
> I added the -E option in the makefile:
>         F90="${FC}" F90FLAGS="${FC_FLAGS} -E" \
>
> make now goes through and produce two files:
> timestepper_adv.cpython-36m-darwin.so.dSYM
> timestepper_adv.cpython-36m-darwin.so
>
> I have not tested these libraries yet but will do soon.
> Do you believe I am good to go?
>
> Finally, I have several warning that may be of some interest, if you 
> have quick fixes, I am a taker !
>
> /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)) {
>                   ^
> ld: warning: ignoring file 
> build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o, file was built 
> for unsupported file format ( 0x23 0x20 0x31 0x20 0x22 0x2E 0x2F 0x74 
> 0x69 0x6D 0x65 0x73 0x74 0x65 0x70 0x70 ) which is not the 
> architecture being linked (x86_64): 
> build/temp.macosx-10.9-x86_64-3.6/timestepper_adv.o
>
> Le 18/01/2018 à 20:01, Lisandro Dalcin a écrit :
>> Line 71 is likely wrong, too, you likely meant:
>>
>> do k=grd%zs,grd%ze
>>
>> On 18 January 2018 at 21:59, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>>> On 18 January 2018 at 18:56, Aurelien Ponte 
>>> <aurelien.ponte at ifremer.fr> wrote:
>>>> The code is found here:
>>>> https://github.com/apatlpo/qgsolver/tree/fwrapping/qgsolver
>>> Your code is not valid Fortran, you cannot use brackets [] for
>>> indexing in lines 80-90, you have to use parentheses ().
>>>
>>> -- 
>>> Lisandro Dalcin
>>> ============
>>> Research Scientist
>>> Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
>>> Extreme Computing Research Center (ECRC)
>>> King Abdullah University of Science and Technology (KAUST)
>>> http://ecrc.kaust.edu.sa/
>>>
>>> 4700 King Abdullah University of Science and Technology
>>> al-Khawarizmi Bldg (Bldg 1), Office # 0109
>>> Thuwal 23955-6900, Kingdom of Saudi Arabia
>>> http://www.kaust.edu.sa
>>>
>>> Office Phone: +966 12 808-0459
>>
>>
>

-- 
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