Open flotang-gtt opened 2 years ago
I'm getting the same issue. I have tried using Visual Studio 2019 and now 2022 but both give the same error.
CMake command:
cmake -DBUILD_INTERFACE_PYTHON=ON -S . -B build/release -G"Visual Studio 17 2022" -A x64
Most of the build goes fine, but I get this warning:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(245,5): warning MSB8065: Custom build for item "C:\nomad\build\release\CMakeFiles\22394b8fd786518d0fbe36821e717628\PyNomad.so.rule" succeeded, but specified output "c:\nomad\build\release\interfaces\pynomad\pynomad.so" has not been created. This may cause incremental build to work incorrectly. [C:\nomad\build\release\interfaces\PyNomad\pynomad.vcxproj]
Then after installing etc I get the same import message mentioned above when trying to import PyNomad. Installation has gone fine on my MacOS and Linux machines, only the Windows machine is causing issues.
I am having the same issue. I run the following:
cmake -DBUILD_INTERFACE_PYTHON=ON -S . -B build/release -G "Visual Studio 17 2022" -A x64
cmake --build build/release --config Release
(I get the same warning @DanielFNG posted)
cmake --install build/release
and when I try to import it (by extending my PYTHONPATH to include the PyNomad folder), I get the error @flotang-gtt posted.
I don't have a PYTHONPATH variable but I have the path to Nomad libraries directory (c:/Users/ctribes\Documents\GitHub\nomad\build\release\bin in my case) in the %PATH% variable.
When building Nomad with Python interface I don't see any mention of PyNomad.so. The build process creates an PyNomad.cp38-win_amd64.lib and PyNomad.cp38-win_amd64.exp. From that, a PyNomad.cp38-win_amd64.pyd files is created and copied into the .....\AppData\Roaming\Python\Python38\site-packages. I perform Nomad building in an Anaconda prompt shell.
The pyd file is the dynamic link library loaded with doing the import PyNomad in Python shell for windows. This library calls for libnomad dlls upon running. Hence, the nomad libraries directory must be in the %PATH%.
Hi, when following the directions from https://nomad-4-user-guide.readthedocs.io/en/latest/LibraryMode.html#pynomad-interface, in combination with the info in the readme of the python interface (there's a bit of a difference between these two, fyi, in the online version, the quite necessary
--config Release
option, without which the build fails when linking), a .pyd file is generated and an .egg is put into the site-packages, everything seemingly working fine.However, importing with pynomad does not work:
ImportError: DLL load failed while importing PyNomad: The specified module could not be found.
Given the instructions mentioned above are working with the "old" msvc versions, it may be relevant that I tried it using
-G"Visual Studio 17 2022"
which does not support an [Arch] option because w32 is deprecated (I think).Any hints?