PySolid icon indicating copy to clipboard operation
PySolid copied to clipboard

DLL load failed while importing solid for manual installation on Windows

Open Oussamaaat opened this issue 1 year ago • 11 comments

(python 3.11.3 windows)

when running python -c "import pysolid; print(pysolid.__version__)" i get 0.3.2 which means pysolid was installed succesfully ? when i run python PySolid/tests/grid.py i get the following error :


D:\test_gnss\PySolid\tests\grid.py Traceback (most recent call last): File "D:\test_gnss\gnss\Lib\site-packages\pysolid\grid.py", line 45, in calc_solid_earth_tides_grid from pysolid.solid import solid_grid ImportError: DLL load failed while importing solid: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\test_gnss\PySolid\tests\grid.py", line 33, in tide_u) = pysolid.calc_solid_earth_tides_grid(dt_obj, atr, verbose=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\test_gnss\gnss\Lib\site-packages\pysolid\grid.py", line 50, in calc_solid_earth_tides_grid raise ImportError(msg) ImportError: Cannot import name 'solid' from 'pysolid'! Maybe solid.for is NOT compiled yet. Check instruction at: https://github.com/insarlab/PySolid.

Oussamaaat avatar May 19 '24 23:05 Oussamaaat

My guess is that the solid.for is not compiled as well. How did you install the code?

yunjunz avatar May 22 '24 02:05 yunjunz

i used the 3rd option below, it seemed to have compiled it but i'll try again today... thank you for your feedback!! any suggestions for compilers on windows ?

# option 3: manually compile the Fortran code and setup environment variable
cd PySolid/src/pysolid
f2py -c -m solid solid.for
export PYTHONPATH=${PYTHONPATH}:~/tools/PySolid

Oussamaaat avatar May 22 '24 07:05 Oussamaaat

I would recommend using conda/mamba install directly, instead of compiling it yourself, which can be buggy. I have not tried it on windows before.

yunjunz avatar May 22 '24 07:05 yunjunz

thanks, i tried conda but the error is still there.. i think the .for file is not compiled successfully... i'll see if i can install it on linux wsl

Oussamaaat avatar May 22 '24 15:05 Oussamaaat

thanks, i tried conda but the error is still there.. i think the .for file is not compiled successfully... i'll see if i can install it on linux wsl

Well.....I have the same issue. I used conda to install all requested packages (successed).

To install Pysolid,

  1. First I use "python -m pip install PySolid", the error message is below: ..... Building wheel for PySolid (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for PySolid (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [20 lines of output] *** scikit-build-core 0.9.8 using CMake 3.30.0 (wheel) *** Configuring CMake... 2024-07-18 15:09:13,582 - scikit_build_core - WARNING - Can't find a Python library, got libdir=None, ldlibrary=None, multiarch=None, masd=None loading initial cache file C:\Users\201113~1\AppData\Local\Temp\tmp7pzmcsae\build\CMakeInit.txt -- Building for: NMake Makefiles CMake Error at CMakeLists.txt:5 (project):not compiled successfully Running

      'nmake' '-?'
    
     failed with:
    
      no such file or directory
    

    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_Fortran_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

    *** CMake configuration failed [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PySolid Failed to build PySolid ERROR: Could not build wheels for PySolid, which is required to install pyproject.toml-based projects

it seems something wrong in the pyproject.toml. Anyway, can't work.

  1. If I use " f2py -c -m solid solid.for " ERROR: Unable to detect linker for compiler flang -Wl,--version stdout: stderr: flang.exe: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found] flang.exe: error: unable to execute command: program not executable flang.exe: error: linker command failed with exit code 1 (use -v to see invocation)

Therefore, I think "solid.for" is not compiled successfully. The problem could be the commands to built the solid.for . Does anyone know the output after successful compile the solid.for....

flex0902 avatar Jul 18 '24 07:07 flex0902

I change to install gcc version 13.2.0 and GNU fortran 13.2.0 (Rev6, Built by MSYS2 project) and manually compile the Fortran code and setup environment variable python -m numpy.f2py -c solid.for -m soild but it failed at the last step, " FAILED: soild.cp312-win_amd64.pyd" The message is below: ........ The Meson build system Version: 1.5.0 Source dir: C:\Users\201113Z10\AppData\Local\Temp\tmppf_ohmsa Build dir: C:\Users\201113Z10\AppData\Local\Temp\tmppf_ohmsa\bbdir Build type: native build Project name: soild Project version: 0.1 Fortran compiler for the host machine: gfortran (gcc 13.2.0 "GNU Fortran (Rev6, Built by MSYS2 project) 13.2.0") Fortran linker for the host machine: gfortran ld.bfd 13.2.0 C compiler for the host machine: cc (gcc 13.2.0 "cc (Rev6, Built by MSYS2 project) 13.2.0") C linker for the host machine: cc ld.bfd 13.2.0 Host machine cpu family: x86_64 Host machine cpu: x86_64 Program C:\Users\201113Z10\AppData\Local\Programs\Python\Python312\python.exe found: YES (C:\Users\201113Z10\AppData\Local\Programs\Python\Python312\python.exe) Run-time dependency python found: YES 3.12 Library quadmath found: YES Build targets in project: 1

Found ninja-1.11.1.git.kitware.jobserver-1 at C:\Users\201113Z10\AppData\Local\Programs\Python\Python312\Scripts\ninja.EXE INFO: autodetecting backend as ninja INFO: calculating backend command to run: C:\Users\201113Z10\AppData\Local\Programs\Python\Python312\Scripts\ninja.EXE -C C:/Users/201113Z10/AppData/Local/Temp/tmppf_ohmsa/bbdir ninja: Entering directory `C:/Users/201113Z10/AppData/Local/Temp/tmppf_ohmsa/bbdir' [5/6] Compiling Fortran object soild.cp312-win_amd64.pyd.p/solid.for.obj ../solid.for:1464:10:

1464 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1465:10:

1465 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1487:9:

1487 | ia=(rjd+0.5d0) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1489:9:

1489 | ic=(ib-122.1d0)/365.25d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1490:9:

1490 | id=365.25d0*ic | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1491:9:

1491 | ie=(ib-id)/30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1496:10:

1496 | it1=ie*30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1497:10:

1497 | idy=ib-id-it1+fmjd | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1498:10:

1498 | it2=ie/14.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1500:10:

1500 | it3=(7+imo)/10.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1504:10:

1504 | ihr=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1506:10:

1506 | imn=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1351:10:

1351 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1352:10:

1352 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1125:13:

1125 | i = ghad/360.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1387:10:

1387 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1388:10:

1388 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1411:10:

1411 | mjd=mjd0+tsec/86400.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1416:9:

1416 | ia=(rjd+0.5d0) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1418:9:

1418 | ic=(ib-122.1d0)/365.25d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1419:9:

1419 | id=365.25d0*ic | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1420:9:

1420 | ie=(ib-id)/30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1425:10:

1425 | it1=ie*30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1426:10:

1426 | idy=ib-id-it1+fmjd | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1427:10:

1427 | it2=ie/14.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1429:10:

1429 | it3=(7+imo)/10.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1433:10:

1433 | ihr=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:1435:10:

1435 | imn=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] ../solid.for:736:34:

736 | subroutine step2lon(xsta,fhr,t,xcorsta) | 1 Warning: Unused dummy argument 'fhr' at (1) [-Wunused-dummy-argument] [6/6] Linking target soild.cp312-win_amd64.pyd FAILED: soild.cp312-win_amd64.pyd ............

flex0902 avatar Jul 18 '24 16:07 flex0902

Finally, I manually compiled the Fortran code in Windows 11 ...after 3 days. Here is my steps.

  1. Install anaconda and create environment of Python 3.10.

    conda create --name py310 python=3.10

  2. Install Visual Studio community 2022 and Intel® oneAPI Base Toolkit for the c and fortran compiler. (https://visualstudio.microsoft.com/zh-hant/vs/ ; https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html) I also get the information to install the c and fortran compiler using PIP install, but I didn't try. (https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-windows/2024-2/pip.html#LIST-OF-AVAILABLE-PACKAGES) install Visual Studio community 2022 ---> choose C++ desktop environment remember the number of win11 SDK 10.0.22621.0 image you may need to restart the computer, to launch the environmental setting.

  3. Execute Anaconda prompt with administrator privileges (right click on Anaconda prompt and select as administrator) and activate the environment py310.

    conda activate py310

    install some dependencies required using pip.

    pip install meson pip install numpy pip install scipy pip install scikit_build_core pip install setuptools_scm pip install matplotlib conda install -c conda-forge pysolid

Now, you may install the pysolid 0.3.2 successfully. The package of pysolid is in the path as: C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid-0.3.2.dist-info

However, when using the following and it will show "DLL load failed..." (something like that....so I try to manually compiling the soild.for)

python -c "import pysolid; print(pysolid.version)"

After you download the source code and go to the folder "pysolid-0.3.3\src\pysolid" There is solid.for in the folder.

f2py -c -m solid solid.for

If it find the c and fortran compiler, it will like figure below: image

You will have error messages as below: C:\Users\flex0\anaconda3\envs\py310\include\pyconfig.h(59): fatal error C1083: �L�k�}�ҥ]�t�ɮ�: 'io.h': No such file or directory

To solve the error messages and the number in the path is the win SDK number:

>set INCLUDE=C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64

>set LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Intel\oneAPI\compiler\2024.2\lib

Copy "rc.exe" and "rcdll.dll" from C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64
to C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx86\x64\

Again, > f2py -c -m solid solid.for and no error messages. image

You will get a " solid.cp310-win_amd64.pyd" with the original files of "solid.for", " init.py", "grid.py", "point.py" in the folder.

  1. Copy these files "solid.cp310-win_amd64.pyd", "solid.for", " init.py", "grid.py", "point.py"
    to C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid (before replace the files in the folder, you can backup the original files)

  2. Change the name of the folder: C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid-0.3.2.dist-info
    into C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid-0.3.3.dist-info

  3. Edit METADATA in C:\Users\flex0\anaconda3\envs\py310\Lib\site-packages\pysolid-0.3.3.dist-info

image

Check you have install pysolid 0.3.3

>python -c "import pysolid; print(pysolid.__version__)"

image

and no DLL load faile.......
  1. In python code (.py) to import pysolid in grid mode. use:
    from pysolid.solid import solid_grid

Hope you guys success! Only for python 3.10, not works for python 3.12

flex0902 avatar Jul 22 '24 05:07 flex0902

i've been followed your step until faced this problem

ModuleNotFoundError: No module named 'distutils.msvccompiler'

can you help me to fixed this?

Faiz@LAPTOP-D10R3FHC MINGW64 /c/Users/Faiz/pysolid-0.3.3/pysolid-0.3.3/src/pysolid $ f2py -c -m solid solid.for running build running config_cc INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src INFO: build_src INFO: building extension "solid" sources INFO: f2py options: [] INFO: f2py:> C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solidmodule.c creating C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 Reading fortran codes... Reading file 'solid.for' (format:fix,strict) Line #37 in solid.for:" real, intent(in) :: glad0, steplat, nlat, glod0" updatevars: attempt to change the type of "glad0" ("double precision") to "real". Ignoring. Line #37 in solid.for:" real, intent(in) :: glad0, steplat, nlat, glod0" updatevars: attempt to change the type of "steplat" ("double precision") to "real". Ignoring. Line #37 in solid.for:" real, intent(in) :: glad0, steplat, nlat, glod0" updatevars: attempt to change the type of "nlat" ("integer") to "real". Ignoring. Line #37 in solid.for:" real, intent(in) :: glad0, steplat, nlat, glod0" updatevars: attempt to change the type of "glod0" ("double precision") to "real". Ignoring. Line #756 in solid.for:" data ((datdi(i,j),i=1,9),j=1,5)/ 0, 0, 0, 1, 0, 0.47, 0.23, 0.16, 0.07, 0, 2, 0, 0, 0, -0.20,-0.12,-0.11,-0.05, 1, 0,-1, 0, 0, -0.11,-0.08,-0.09,-0.04, 2, 0, 0, 0, 0, -0.13,-0.11,-0.15,-0.07, 2, 0, 0, 1, 0, -0.05,-0.05,-0.06,-0.03/" analyzeline: implied-DO list "((datdi(i,j),i=1,9),j=1,5)" is not supported. Skipping. Post-processing... Block: solid Block: solid_grid Block: solid_point Block: detide Block: st1l1 Block: step2diu Block: step2lon Block: st1idiu Block: st1isem Block: sprod Block: enorm8 Block: zero_vec8 Block: moonxyz Block: getghar Block: sunxyz Block: lhsaaz Block: geoxyz Block: rge Block: rot1 Block: rot3 Block: setjd0 Block: civjts Block: jtsciv Block: civmjd Block: mjdciv Block: utc2ttt Block: gps2ttt Block: utc2tai Block: getutcmtai Block: tai2tt Block: gps2tai Post-processing (stage 2)... Building modules... Building module "solid"... Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "solid_grid"... tide_e,tide_n,tide_u = solid_grid(iyr,imo,idy,ihh,imm,iss,glad0,steplat,nlat,glod0,steplon,nlon) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "solid_point"... secs,tide_e,tide_n,tide_u = solid_point(glad,glod,iyr,imo,idy,step_sec) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "detide"... detide(xsta,mjd,fmjd,xsun,xmon,dxtide,lflag) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "st1l1"... st1l1(xsta,xsun,xmon,fac2sun,fac2mon,xcorsta) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "step2diu"... step2diu(xsta,fhr,t,xcorsta) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "step2lon"... step2lon(xsta,fhr,t,xcorsta) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "st1idiu"... st1idiu(xsta,xsun,xmon,fac2sun,fac2mon,xcorsta) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "st1isem"... st1isem(xsta,xsun,xmon,fac2sun,fac2mon,xcorsta) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "sprod"... sprod(x,y,scal,r1,r2) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "enorm8"("enorm8")... Constructing wrapper function "enorm8"... enorm8 = enorm8(a) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "zero_vec8"... zero_vec8(v) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "moonxyz"... moonxyz(mjd,fmjd,rm,lflag) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "getghar"... getghar(mjd,fmjd,ghar) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "sunxyz"... sunxyz(mjd,fmjd,rs,lflag) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "lhsaaz"... lhsaaz(u,v,w,ra,az,va) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "geoxyz"... geoxyz(gla,glo,eht,x,y,z) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "rge"... rge(gla,glo,u,v,w,x,y,z) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "rot1"... rot1(theta,x,y,z,u,v,w) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "rot3"... rot3(theta,x,y,z,u,v,w) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "setjd0"... setjd0(iyr,imo,idy) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "civjts"... civjts(iyr,imo,idy,ihr,imn,sec,tsec) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "jtsciv"... jtsciv(tsec,iyr,imo,idy,ihr,imn,sec) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "civmjd"... civmjd(iyr,imo,idy,ihr,imn,sec,mjd,fmjd) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Constructing wrapper function "mjdciv"... mjdciv(mjd,fmjd,iyr,imo,idy,ihr,imn,sec) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "utc2ttt"("utc2ttt")... Constructing wrapper function "utc2ttt"... utc2ttt = utc2ttt(tutc) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "gps2ttt"("gps2ttt")... Constructing wrapper function "gps2ttt"... gps2ttt = gps2ttt(tgps) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "utc2tai"("utc2tai")... Constructing wrapper function "utc2tai"... utc2tai = utc2tai(tutc) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "getutcmtai"("getutcmtai")... Constructing wrapper function "getutcmtai"... getutcmtai = getutcmtai(tsec) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "tai2tt"("tai2tt")... Constructing wrapper function "tai2tt"... tai2tt = tai2tt(ttai) Generating possibly empty wrappers" Maybe empty "solid-f2pywrappers.f" Creating wrapper for Fortran function "gps2tai"("gps2tai")... Constructing wrapper function "gps2tai"... gps2tai = gps2tai(tgps) Constructing COMMON block support for "stuff"... rad,pi,pi2 Constructing COMMON block support for "comgrs"... a,e2 Constructing COMMON block support for "limitflag"... leapflag Constructing COMMON block support for "mjdoff"... mjd0 Wrote C/API module "solid" to file "C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solidmodule.c" Fortran 77 wrappers are saved to "C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solid-f2pywrappers.f" INFO: adding 'C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\fortranobject.c' to sources. INFO: adding 'C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10' to include_dirs. copying C:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\f2py\src\fortranobject.c -> C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 copying C:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\f2py\src\fortranobject.h -> C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 INFO: adding 'C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solid-f2pywrappers.f' to sources. INFO: build_src: building npy-pkg config files C:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build_ext INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils INFO: customize MSVCCompiler INFO: customize MSVCCompiler using build_ext INFO: get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']' INFO: customize GnuFCompiler WARN: Could not locate executable g77 WARN: Could not locate executable f77 INFO: customize IntelVisualFCompiler WARN: Could not locate executable ifort WARN: Could not locate executable ifl INFO: customize AbsoftFCompiler WARN: Could not locate executable f90 INFO: customize CompaqVisualFCompiler INFO: Found executable C:\msys64\usr\bin\DF.exe INFO: customize IntelItaniumVisualFCompiler WARN: Could not locate executable efl INFO: customize Gnu95FCompiler INFO: Found executable C:\msys64\mingw64\bin\gfortran.exe INFO: customize Gnu95FCompiler INFO: customize Gnu95FCompiler using build_ext INFO: building 'solid' extension INFO: compiling C sources creating C:\msys64\tmp\tmpbuhjjiwk\Release\msys64 creating C:\msys64\tmp\tmpbuhjjiwk\Release\msys64\tmp creating C:\msys64\tmp\tmpbuhjjiwk\Release\msys64\tmp\tmpbuhjjiwk creating C:\msys64\tmp\tmpbuhjjiwk\Release\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNPY_DISABLE_OPTIMIZATION=1 -IC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 -IC:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\core\include -IC:\Users\Faiz\anaconda3\envs\py310\include -IC:\Users\Faiz\anaconda3\envs\py310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt -IC:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64 /TcC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solidmodule.c /FoC:\msys64\tmp\tmpbuhjjiwk\Release\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solidmodule.obj INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNPY_DISABLE_OPTIMIZATION=1 -IC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 -IC:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\core\include -IC:\Users\Faiz\anaconda3\envs\py310\include -IC:\Users\Faiz\anaconda3\envs\py310\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt -IC:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64 /TcC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\fortranobject.c /FoC:\msys64\tmp\tmpbuhjjiwk\Release\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\fortranobject.obj INFO: compiling Fortran sources INFO: Fortran f77 compiler: C:\msys64\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops Fortran f90 compiler: C:\msys64\mingw64\bin\gfortran.exe -Wall -g -fno-second-underscore -O3 -funroll-loops Fortran fix compiler: C:\msys64\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O3 -funroll-loops INFO: compile options: '-IC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 -IC:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\core\include -IC:\Users\Faiz\anaconda3\envs\py310\include -IC:\Users\Faiz\anaconda3\envs\py310\Include -c' INFO: gfortran.exe:f77: solid.for INFO: gfortran.exe:f77: C:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10\solid-f2pywrappers.f solid.for:36:40:

36 | real, intent(in) :: glad0, steplat, nlat, glod0 | 1 Error: Symbol 'glad0' at (1) already has basic type of REAL solid.for:1466:10:

1466 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1467:10:

1467 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1489:9:

1489 | ia=(rjd+0.5d0) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1491:9:

1491 | ic=(ib-122.1d0)/365.25d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1492:9:

1492 | id=365.25d0*ic | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1493:9:

1493 | ie=(ib-id)/30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1498:10:

1498 | it1=ie*30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1499:10:

1499 | idy=ib-id-it1+fmjd | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1500:10:

1500 | it2=ie/14.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1502:10:

1502 | it3=(7+imo)/10.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1506:10:

1506 | ihr=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1508:10:

1508 | imn=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1353:10:

1353 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1354:10:

1354 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1127:13:

1127 | i = ghad/360.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1389:10:

1389 | it1=365.25d0*y | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1390:10:

1390 | it2=30.6001d0*(m+1) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1413:10:

1413 | mjd=mjd0+tsec/86400.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1418:9:

1418 | ia=(rjd+0.5d0) | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1420:9:

1420 | ic=(ib-122.1d0)/365.25d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1421:9:

1421 | id=365.25d0*ic | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1422:9:

1422 | ie=(ib-id)/30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1427:10:

1427 | it1=ie*30.6001d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1428:10:

1428 | idy=ib-id-it1+fmjd | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1429:10:

1429 | it2=ie/14.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1431:10:

1431 | it3=(7+imo)/10.d0 | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1435:10:

1435 | ihr=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] solid.for:1437:10:

1437 | imn=tmp | 1 Warning: Possible change of value in conversion from REAL(8) to INTEGER(4) at (1) [-Wconversion] error: Command "C:\msys64\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O3 -funroll-loops -IC:\msys64\tmp\tmpbuhjjiwk\src.win-amd64-3.10 -IC:\Users\Faiz\anaconda3\envs\py310\lib\site-packages\numpy\core\include -IC:\Users\Faiz\anaconda3\envs\py310\include -IC:\Users\Faiz\anaconda3\envs\py310\Include -c -c solid.for -o C:\msys64\tmp\tmpbuhjjiwk\Release\solid.o" failed with exit status 1

meteogeodesist avatar Feb 10 '25 07:02 meteogeodesist

Having the same issue on Windows 11 with a mamba installation:

(base) C:\Users\AlexMatakos\git\cssrlib>mamba create -n cssrlib python=3.11
(base) C:\Users\AlexMatakos\git\cssrlib>mamba activate cssrlib
(cssrlib) C:\Users\AlexMatakos\git\cssrlib>mamba install -c conda-forge pysolid
(cssrlib) C:\Users\AlexMatakos\git\cssrlib>pip show pysolid
Name: pysolid
Version: 0.3.2
Summary: A Python wrapper for solid to compute solid Earth tides
Home-page: https://github.com/insarlab/PySolid
Author: Dennis Milbert
Author-email: Zhang Yunjun <[email protected]>
License: GPL-3.0-or-later
Location: C:\Users\AlexMatakos\miniconda3\envs\cssrlib\Lib\site-packages
Requires: numpy, scipy
Required-by:
(cssrlib) C:\Users\AlexMatakos\git\cssrlib>python -c "from pysolid.solid import sold_grid
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: DLL load failed while importing solid: The specified module could not be found.

Any ideas/fixes so far?

alex-skyfora avatar Mar 04 '25 11:03 alex-skyfora

Hi, It has been a while since this post, but maybe what I did can help. I have a python environment dedicated to Mintpy with the required tools. I had issues trying to get PySolid with Python3.11 on windows. I had error messages with conda.

To make it work, I downloaded the source code from GitHub and I had to compile the executable myself.

Make sure you have all the needed libraries. You will also need meson and fortran compiler installed cmake and gfortran with conda. I don't know which compiler is actually needed, I went into a rabbit hole of trying different things.

In my case, I needed to specify the backend to use meson and not distutils which always bring the error. "modulenotfounderror: no module named 'distutils.msvccompiler' " I also had to help the tool to find the libraries, so I used -L

In the folder src/pysolid, I did the command: python -m numpy.f2py -c solid.for -m solid --backend meson -L"C:\Users_username_\miniconda3\envs\mintpy\Library\lib"

The compilation was successful, and test scripts work.

Hopefully that helps.

christine-lion avatar May 15 '25 03:05 christine-lion

An executable pysolid 0.3.3 under python 3.10 and windows 11. https://github.com/flex0902/pysolid_py310

good luck!

flex0902 avatar May 28 '25 05:05 flex0902