<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">+SciPy list<br>
      <br>
    </div>
    <blockquote type="cite"
cite="mid:CABL7CQiEW_WQvzZQ8iuV_AcTcwi8+ay3wpptev7JRdXC_v1Ecg@mail.gmail.com">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Sat, Aug 5, 2017 at 7:24 AM, Jeff
            Layton <span dir="ltr"><<a
                href="mailto:laytonjb@att.net" target="_blank"
                moz-do-not-send="true">laytonjb@att.net</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">Good afternoon!<br>
              <br>
              I'm trying to build a Python module using F2PY on a simple
              Fortran code using the PGI 17.4 community compilers.<br>
              <br>
              I'm using Conda 4.3.21 with Python 2.7.13 and F2PY 2. The
              command line I'm using is,<br>
              <br>
              <br>
              f2py --compiler=pg --fcompiler=pg -c -m mdevice
              mdevice.f90<br>
              <br>
              <br>
              The output from f2py is at the end of the email. Any
              suggestions are greatly appreciated.<br>
            </blockquote>
            <div><br>
              --compiler=pg seems wrong, that specifies the C/C++
              compiler to use not the Fortran compiler. Hence you get
              the error "don't know how to compile C/C++ code on
              platform 'posix' with 'pg' compiler". Try just leaving
              that off (thereby using the default C compiler you have
              installed, probably gcc).<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Ralf - thanks for the response! I had tried that before and F2PY
    still thinks it's using the PGI C compiler:<br>
    <br>
    <br>
    running build<br>
    running config_cc<br>
    unifing config_cc, config, build_clib, build_ext, build commands
    --compiler options<br>
    running config_fc<br>
    unifing config_fc, config, build_clib, build_ext, build commands
    --fcompiler options<br>
    running build_src<br>
    build_src<br>
    building extension "mdevice" sources<br>
    f2py options: []<br>
    f2py:> /tmp/tmpkxCUbk/src.linux-x86_64-2.7/mdevicemodule.c<br>
    creating /tmp/tmpkxCUbk/src.linux-x86_64-2.7<br>
    Reading fortran codes...<br>
            Reading file 'mdevice.f90' (format:free)<br>
    Post-processing...<br>
            Block: mdevice<br>
                            Block: devicequery<br>
    In: :mdevice:mdevice.f90:devicequery<br>
    get_useparameters: no module cudafor info used by devicequery<br>
    Post-processing (stage 2)...<br>
    Building modules...<br>
            Building module "mdevice"...<br>
                    Constructing wrapper function "devicequery"...<br>
                      devicequery()<br>
            Wrote C/API module "mdevice" to file
    "/tmp/tmpkxCUbk/src.linux-x86_64-2.7/mdevicemodule.c"<br>
      adding '/tmp/tmpkxCUbk/src.linux-x86_64-2.7/fortranobject.c' to
    sources.<br>
      adding '/tmp/tmpkxCUbk/src.linux-x86_64-2.7' to include_dirs.<br>
    copying
/home/laytonjb/anaconda2/lib/python2.7/site-packages/numpy/f2py/src/fortranobject.c
    -> /tmp/tmpkxCUbk/src.linux-x86_64-2.7<br>
    copying
/home/laytonjb/anaconda2/lib/python2.7/site-packages/numpy/f2py/src/fortranobject.h
    -> /tmp/tmpkxCUbk/src.linux-x86_64-2.7<br>
    build_src: building npy-pkg config files<br>
    running build_ext<br>
    customize UnixCCompiler<br>
    customize UnixCCompiler using build_ext<br>
    customize PGroupFCompiler<br>
    Found executable /opt/pgi/linux86-64/pgidir/pgf90<br>
    Found executable /opt/pgi/linux86-64/pgidir/pgf77<br>
    Found executable /opt/pgi/linux86-64/17.4/bin/pgfortran<br>
    customize PGroupFCompiler using build_ext<br>
    building 'mdevice' extension<br>
    compiling C sources<br>
    C compiler: /opt/pgi/linux86-64/pgidir/pgcc -fno-strict-aliasing -g
    -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC<br>
    <br>
    creating /tmp/tmpkxCUbk/tmp<br>
    creating /tmp/tmpkxCUbk/tmp/tmpkxCUbk<br>
    creating /tmp/tmpkxCUbk/tmp/tmpkxCUbk/src.linux-x86_64-2.7<br>
    compile options: '-I/tmp/tmpkxCUbk/src.linux-x86_64-2.7
-I/home/laytonjb/anaconda2/lib/python2.7/site-packages/numpy/core/include
    -I/home/laytonjb/anaconda2/include/python2.7 -c'<br>
    pgcc: /tmp/tmpkxCUbk/src.linux-x86_64-2.7/mdevicemodule.c<br>
    pgcc-Error-Unknown switch: -fno-strict-aliasing<br>
    pgcc-Error-Unknown switch: -fwrapv<br>
    pgcc-Error-Unknown switch: -Wall<br>
    pgcc-Error-Unknown switch: -Wstrict-prototypes<br>
    pgcc-Error-Unknown switch: -fno-strict-aliasing<br>
    pgcc-Error-Unknown switch: -fwrapv<br>
    pgcc-Error-Unknown switch: -Wall<br>
    pgcc-Error-Unknown switch: -Wstrict-prototypes<br>
    error: Command "/opt/pgi/linux86-64/pgidir/pgcc -fno-strict-aliasing
    -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
    -I/tmp/tmpkxCUbk/src.linux-x86_64-2.7
-I/home/laytonjb/anaconda2/lib/python2.7/site-packages/numpy/core/include
    -I/home/laytonjb/anaconda2/include/python2.7 -c
    /tmp/tmpkxCUbk/src.linux-x86_64-2.7/mdevicemodule.c -o
    /tmp/tmpkxCUbk/tmp/tmpkxCUbk/src.linux-x86_64-2.7/mdevicemodule.o"
    failed with exit status 1<br>
    <br>
    <br>
    <br>
    I'm definitely at a lose here. I have no idea how to make F2PY work
    with the PGI compilers. I'm beginning to think F2PY is completely
    borked unless you use the defaults (gcc).<br>
    <br>
    <br>
    Thanks!<br>
    <br>
    Jeff<br>
    <br>
    <br>
    <blockquote type="cite"
cite="mid:CABL7CQiEW_WQvzZQ8iuV_AcTcwi8+ay3wpptev7JRdXC_v1Ecg@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
              <br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <br>
              Thanks!<br>
              <br>
              Jeff<br>
              <br>
              <br>
              Output from f2py:<br>
              <br>
              <br>
              <br>
              running build<br>
              running config_cc<br>
              unifing config_cc, config, build_clib, build_ext, build
              commands --compiler options<br>
              running config_fc<br>
              unifing config_fc, config, build_clib, build_ext, build
              commands --fcompiler options<br>
              running build_src<br>
              build_src<br>
              building extension "mdevice" sources<br>
              f2py options: []<br>
              f2py:> /tmp/tmptN1fdp/src.linux-x86_6<wbr>4-2.7/mdevicemodule.c<br>
              creating /tmp/tmptN1fdp/src.linux-x86_6<wbr>4-2.7<br>
              Reading fortran codes...<br>
                      Reading file 'mdevice.f90' (format:free)<br>
              Post-processing...<br>
                      Block: mdevice<br>
                                      Block: devicequery<br>
              In: :mdevice:mdevice.f90:deviceque<wbr>ry<br>
              get_useparameters: no module cudafor info used by
              devicequery<br>
              Post-processing (stage 2)...<br>
              Building modules...<br>
                      Building module "mdevice"...<br>
                              Constructing wrapper function
              "devicequery"...<br>
                                devicequery()<br>
                      Wrote C/API module "mdevice" to file
              "/tmp/tmptN1fdp/src.linux-x86_<wbr>64-2.7/mdevicemodule.c"<br>
                adding '/tmp/tmptN1fdp/src.linux-x86_<wbr>64-2.7/fortranobject.c'
              to sources.<br>
                adding '/tmp/tmptN1fdp/src.linux-x86_<wbr>64-2.7' to
              include_dirs.<br>
              copying /home/laytonjb/anaconda2/lib/p<wbr>ython2.7/site-packages/numpy/f<wbr>2py/src/fortranobject.c
              -> /tmp/tmptN1fdp/src.linux-x86_6<wbr>4-2.7<br>
              copying /home/laytonjb/anaconda2/lib/p<wbr>ython2.7/site-packages/numpy/f<wbr>2py/src/fortranobject.h
              -> /tmp/tmptN1fdp/src.linux-x86_6<wbr>4-2.7<br>
              build_src: building npy-pkg config files<br>
              running build_ext<br>
              error: don't know how to compile C/C++ code on platform
              'posix' with 'pg' compiler<br>
              <br>
              <br>
              ______________________________<wbr>_________________<br>
              NumPy-Discussion mailing list<br>
              <a href="mailto:NumPy-Discussion@python.org"
                target="_blank" moz-do-not-send="true">NumPy-Discussion@python.org</a><br>
              <a
                href="https://mail.python.org/mailman/listinfo/numpy-discussion"
                rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailma<wbr>n/listinfo/numpy-discussion</a><br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
NumPy-Discussion mailing list
<a class="moz-txt-link-abbreviated" href="mailto:NumPy-Discussion@python.org">NumPy-Discussion@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/numpy-discussion">https://mail.python.org/mailman/listinfo/numpy-discussion</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>