Dear Marcelo,

Yes, this is embarassing. The libraries to be linked could indeed evolve and I did'nt experience this for quite a long time on Windows.

You could try to run the link command in the directory interface/src/python without the -lmsvcr140 option, this could work, but this could also end with some missing references. In that case, the problem is to find the convenient library containing the references, which could be a bit tricky.

Best regards,

Yves



Le 01/07/2021 à 16:22, Marcelo Frydman a écrit :

Yves,

Thanks again for all your support. I set the variables with:

export PYTHONPATH="C:/Users/m.frydman/Anaconda3"

export PYTHON="C:/Users/m.frydman/Anaconda3/python"

I ran the configure again with:

./configure --with-blas="-lblas -lgfortran" --disable-superlu

The /configure/ could set the proper path for Python this time:

checking for python3.8... C:/Users/m.frydman/Anaconda3/python

checking for a version of Python >= '2.1.0'... yes

checking for the distutils Python package... yes

checking for Python include path... -IC:\Users\m.frydman\Anaconda3\include

checking for Python library path... -LC:\Users\m.frydman\Anaconda3\Lib -lpython38

checking for Python site-packages path... C:\Users\m.frydman\Anaconda3\Lib\site-packages

checking python extra libraries... None None

checking python extra linking flags... None

….

-----------------------------------------------------------------------

Ready to build getfem

building MATLAB interface: NO

building OCTAVE interface: NO

building PYTHON interface: YES (requires numpy, scipy and also mpi4py for the parallel version)

building SCILAB interface: NO

If you want to build the shared library of GetFEM, use --enable-shared

(by default, only the static one will be built)

-----------------------------------------------------------------------

I ran a /make clean/ and /make/ to start all over.

make clean

make

However, a new error while compiling the Python interface.

C:\msys64\mingw64\bin\gcc.exe -shared -s .\Release\getfem_python_c.o .\Release\_getfem.cp38-win_amd64.def -L../.libs -L../../../src/.libs -LC:\Users\m.frydman\Anaconda3\libs -LC:\Users\m.frydman\Anaconda3\PCbuild\amd64 -lgetfemint -lgetfem -lsmumps -ldmumps -lcmumps -lzmumps -lmumps_common -lmpiseq -lpord -lqhullstatic -lsuperlu -lsuperlu -llapack -lblas -lgfortran -lstdc++ -lm -lpython38 -lmsvcr140 -o .\_getfem.cp38-win_amd64.pyd

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcr140

collect2.exe: error: ld returned 1 exit status

error: command 'C:\\msys64\\mingw64\\bin\\gcc.exe' failed with exit status 1

I tried to find any library/DLL with msvcr140, but I haven’t. Please help!

Regards,

Marcelo

*From:*Yves Renard <[email protected]>
*Sent:* miércoles, 30 de junio de 2021 10:31
*To:* Marcelo Frydman <[email protected]>
*Cc:* [email protected]
*Subject:* Re: ModuleNotFoundError: No module named '_getfem'

Dear Marcelo,

Yes, Python is detected from the migw64 so that the interface will be build for this version.

The problem should be that the dynamic library build is not compatible with Python from Anaconda

(In that case, you should be able to run a python script which call GetFEM from the Python of migw64)

May be you can try to run the configure script with the option

PYTHON="path_for_anaconda_python..."

Best regards,

Yves

Le 29/06/2021 à 17:56, Marcelo Frydman a écrit :

    Yves,

    Please see below the end note from the configure script. It is
    suggesting Python is detected.

    Libraries Used:

    ---------------

    - QD library not found (don't worry, this library is only
    recommended for very specific uses).

    - Qhull found. Using the Qhull library for delaunay triangulations.

    - Mumps found. A direct solver for large sparse linear systems.

    - Lapack library found: -llapack

    - BLAS library found. Link options: -lblas -lgfortran

      You can give the location of your prefered blas library with either

      the --with-blas=<lib> option, or the BLAS_LIBS environment variable

      for example: ./configure BLAS_LIBS="-L/usr/lib/sse2/atlas/ -lblas"

      Use blas with 32 bits integers

    -----------------------------------------------------------------------

    Ready to build getfem

      building MATLAB interface: NO

      building OCTAVE interface: NO

      building PYTHON interface: YES (requires numpy, scipy and also
    mpi4py for the parallel version)

      building SCILAB interface: NO

      If you want to build the shared library of GetFEM, use
    --enable-shared

      (by default, only the static one will be built)

    -----------------------------------------------------------------------

    However, if you for the specific python check (see below), the
    Python from migw64 is the one used, not from Anaconda.

    checking for python... /mingw64/bin/python

    checking for python version... 3.8

    checking for python platform... win32

    checking for python script directory...
    ${prefix}/lib/python3.8/site-packages

    checking for python extension module directory...
    ${exec_prefix}/lib/python3.8/site-packages

    Building with python (/mingw64/bin/python) support (use
    --enable-python=no to disable it)

    You will need the python-numpy and python-scipy packages.

    checking for python3.8... (cached) /mingw64/bin/python

    checking for a version of Python >= '2.1.0'... yes

    checking for the distutils Python package... yes

    checking for Python include path...
    -IC:/msys64/mingw64/include/python3.8

    checking for Python library path...
    -LC:/msys64/mingw64/lib/python3.8 -lpython3.8

    checking for Python site-packages path...
    C:/msys64/mingw64/lib/python3.8/site-packages

    checking python extra libraries... -lws2_32 -lm -lversion -lshlwapi

    checking python extra linking flags...

    Thanks again,

    Marcelo

    *From:*Yves Renard <[email protected]>
    <mailto:[email protected]>
    *Sent:* martes, 29 de junio de 2021 12:44
    *To:* Marcelo Frydman <[email protected]>
    <mailto:[email protected]>
    *Cc:* [email protected] <mailto:[email protected]>
    *Subject:* Re: ModuleNotFoundError: No module named '_getfem'

    Dear Marcelo,

    If the python installation is correct, it should be detected by
    the configure script. When you run the configure script, at the
    end, it should be noted that python is detected. Is it the case ?

    Best regards,

    Yves

    Le 29/06/2021 à 15:05, Marcelo Frydman a écrit :

        Yves,

        Thank you very much for your ready answer. Please see below
        the PYTHONPATH and Environment set in Spyder/Anaconda.

        There wasn’t any /_getfem.*/ created during the compilation
        process. I am not sure I am building the Pyhton interface
        properly. There was a step:

        /Install Anaconda2 and add to windows path
        //C:\install_dir\Anaconda2// and
        //C:\install_dir\Anaconda2\Scripts// where //install_dir// is
        the installation directory of Anaconda2 (//ProgramData// by
        default for a system installation)/

        I am not sure what does it mean. Do I need to set these
        variables elsewhere in MSYS before building the Pyhton
        interface? Any problem with the PYTHONPATH set?

        Thanks again,

        Marcelo

        *From:*Yves Renard <[email protected]>
        <mailto:[email protected]>
        *Sent:* martes, 29 de junio de 2021 04:28
        *To:* Marcelo Frydman <[email protected]>
        <mailto:[email protected]>; [email protected]
        <mailto:[email protected]>
        *Subject:* Re: ModuleNotFoundError: No module named '_getfem'

        Dear Marcelo,

        Did you set the PYTHONPATH variable after building the interface ?

        Best regards,

        Yves

        Le 28/06/2021 à 20:57, Marcelo Frydman a écrit :

            Dear GetFem users,

            I have just installed Getfem on Windows (Msys). I have
            followed the instructions on:
            http://getfem.org/install/install_windows.html
            <http://getfem.org/install/install_windows.html>

            The compilation process was working fine, without major
            issue. I ran “make check” before building the Pyhton
            interface, and got a positive message:

            /Testsuite summary for getfem 5.4.1/

            
/============================================================================/

            */# TOTAL: 41/*

            /# PASS:  41/

            /# SKIP:  0/

            /# XFAIL: 0/

            /# FAIL:  0/

            /# XPASS: 0/

            /# ERROR: 0/

            However, Python interface is not working. I ran “make
            check” for the Pyhton examples:

            /FAIL//: check_export.py/

            /FAIL//: check_global_functions.py/

            /FAIL//: check_asm.py/

            /FAIL//: check_secondary_domain.py/

            /FAIL//: check_mixed_mesh.py/

            /FAIL//: demo_wave.py/

            /FAIL//: demo_wave_equation.py/

            /FAIL//: demo_laplacian.py/

            /FAIL//: demo_laplacian_HHO.py/

            /FAIL//: demo_elasticity_HHO.py/

            /FAIL//: demo_thermo_elasticity_electrical_coupling.py/

            /FAIL//: check_levelset.py/

            
/============================================================================/

            /Testsuite summary for getfem 5.4.1/

            
/============================================================================/

            */# TOTAL: 12/*

            /# PASS:  0/

            /# SKIP:  0/

            /# XFAIL: 0/

            /# FAIL:  12/

            /# XPASS: 0/

            /# ERROR: 0/

            
/============================================================================/

            /See interface/tests/python/test-suite.log/

            
/============================================================================/

            I tried to run one of the examples in Spyder, and got the
            following error:


            /Python 3.8.10 (default, May 19 2021, 13:12:57) [MSC
            v.1916 64 bit (AMD64)]/

            /Type "copyright", "credits" or "license" for more
            information./

            //

            /IPython 7.22.0 -- An enhanced Interactive Python./

            //

            /Traceback (most recent call last):/

            //

            /  File
            "C:\msys64\home\m.frydman\getfem\interface\src\python\getfem.py",
            line 45, in <module>/

            /    from ._getfem import */

            //

            /ImportError: attempted relative import with no known
            parent package/

            //

            //

            /During handling of the above exception, another exception
            occurred:/

            //

            /Traceback (most recent call last):/

            //

            /  File
            "C:\msys64\home\m.frydman\getfem\interface\src\python\getfem.py",
            line 47, in <module>/

            /    from _getfem import */

            //

            /ModuleNotFoundError: No module named '_getfem'/

            //

            Looking forward to start having fun with GetFem.

            Thanks,

            Marcelo

--
           Yves Renard ([email protected]  
<mailto:[email protected]>)       tel : (33) 04.72.43.87.08

           INSA-Lyon

           20, rue Albert Einstein

           69621 Villeurbanne Cedex, FRANCE

           http://math.univ-lyon1.fr/~renard  
<http://math.univ-lyon1.fr/~renard>

        ---------

--
       Yves Renard ([email protected]  
<mailto:[email protected]>)       tel : (33) 04.72.43.87.08

       INSA-Lyon

       20, rue Albert Einstein

       69621 Villeurbanne Cedex, FRANCE

       http://math.univ-lyon1.fr/~renard  <http://math.univ-lyon1.fr/~renard>

    ---------

--
   Yves Renard ([email protected]  <mailto:[email protected]>)    
   tel : (33) 04.72.43.87.08
   INSA-Lyon
   20, rue Albert Einstein
   69621 Villeurbanne Cedex, FRANCE
   http://math.univ-lyon1.fr/~renard  <http://math.univ-lyon1.fr/~renard>
---------


--

  Yves Renard ([email protected])       tel : (33) 04.72.43.87.08
  INSA-Lyon
  20, rue Albert Einstein
  69621 Villeurbanne Cedex, FRANCE
  http://math.univ-lyon1.fr/~renard

---------

Reply via email to