Hi, recently I try to install fmm on native Windows environment without Cygwin by following the instructions mentioned at this PR https://github.com/cyang-kth/fmm/pull/165. However, the instructions are not comprehensive for new guys on C++ like me. Finally, I successfully install the fmm program and its python binding with the help of Google. And here they are (modified from https://github.com/cyang-kth/fmm/pull/165#issue-785671958):
Install MSVC (C++ tools or full Visual Studio set)
If you are using 64-bit Anaconda Python like me, just add an environment variable VCPKG_DEFAULT_TRIPLET with value x64-windows. Then you don't need to specify the triplet when install dependencies at step4.
Install dependencies with vcpkg: vcpkg install gdal boost-geometry boost-graph boost-serialization
Build with CMake: cmake --build . --parallel 4 --config Release
Install with CMake: cmake --install . --config Release. (This step will require admin permission as the program will be installed to the default directory C:\Program Files\fmm)
Describe the bug
After installing with CMake, the DLL missing problem is prompted when calling fmm.exe (ImportError: DLL load failed when importing fmm in Python).
I check the folder C:\Program Files\fmm\bin and don't find any DLL files. Then I copy all the DLL files in folder fmm\build\Release to it and problem solved.
Similarly, I copy the DLL files from fmm\build\python\Release to Lib\site-packages. However, the problem ImportError: DLL load failed in Python remained. Then I use Dependency Walker to check the DLL dependencies of the file Lib\site-packages\_fmm.pyd and find this:
Finally, I copy the FMMLIB.dll file from fmm\build\Release to Lib\site-packages and problem solved.
My suggestion is whether is possible to change CMakeLists.txt such that the generated DLL files will be copied to the right folders when installing.
Hi, recently I try to install fmm on native Windows environment without Cygwin by following the instructions mentioned at this PR https://github.com/cyang-kth/fmm/pull/165. However, the instructions are not comprehensive for new guys on C++ like me. Finally, I successfully install the fmm program and its python binding with the help of Google. And here they are (modified from https://github.com/cyang-kth/fmm/pull/165#issue-785671958):
VCPKG_DEFAULT_TRIPLET
with valuex64-windows
. Then you don't need to specify the triplet when install dependencies at step4.vcpkg install gdal boost-geometry boost-graph boost-serialization
vcpkg.json
:vcpkg install ...
command as step6 will automatically do it for you.mkdir build
andcd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake -DSWIG_EXECUTABLE=[path to swig.exe]
-DCMAKE_GENERATOR_PLATFORM=x64
cmake --build . --parallel 4 --config Release
cmake --install . --config Release
. (This step will require admin permission as the program will be installed to the default directoryC:\Program Files\fmm
)Describe the bug After installing with CMake, the
DLL missing
problem is prompted when calling fmm.exe (ImportError: DLL load failed
when importing fmm in Python).I check the folder
C:\Program Files\fmm\bin
and don't find any DLL files. Then I copy all the DLL files in folderfmm\build\Release
to it and problem solved.Similarly, I copy the DLL files from
fmm\build\python\Release
toLib\site-packages
. However, the problemImportError: DLL load failed
in Python remained. Then I use Dependency Walker to check the DLL dependencies of the fileLib\site-packages\_fmm.pyd
and find this: Finally, I copy theFMMLIB.dll
file fromfmm\build\Release
toLib\site-packages
and problem solved.My suggestion is whether is possible to change
CMakeLists.txt
such that the generated DLL files will be copied to the right folders when installing.Expected behavior Like https://fmm-wiki.github.io/docs/installation/windows.html#verfication-of-installation after
cmake --install
without manually copying DLL files.Screenshots