fastFM
fastFM copied to clipboard
Cannot compile fastFM on Windows 10
Good morning, Unfortunately, I was not able to compile and install fastFM on my Windows 10 x64 machine. I am using Python 2.7.11 |Anaconda 2.3.0 (64-bit)| (default, Feb 16 2016, 09:58:36) [MSC v.1500 64 bit (AMD64)]. I tried with different compilers: g++, w64-mingw32, and Microsoft Visual C++ Compiler for Python 2.7. Your help would be greatly appreciated. Regards
@nicolasfguillaume Windows is not actively supported and I don't know if someone managed to compile fastFM on windows before.
I would try to compile with g++ first. Feel free to post you error messages here. I or someone else might be ableto help you to guess what goes wrong. Just make sure that you start from scratch and post every command and output.
Hello,
In cmd.exe I typed: C:\Users\Nicolas\Desktop\fastfm_test\fastFM>python setup.py install
And then I get the following:
running install running bdist_egg running egg_info writing requirements to fastFM.egg-info\requires.txt writing fastFM.egg-info\PKG-INFO writing top-level names to fastFM.egg-info\top_level.txt writing dependency_links to fastFM.egg-info\dependency_links.txt reading manifest file 'fastFM.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'fastFM.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib running build_py running build_ext skipping 'fastFM\ffm.c' Cython extension (up-to-date) building 'ffm' extension C:\TDM-GCC-64\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -IC:\Users\Nicolas\Anaconda\lib\site-packages\numpy\core\include -IC:\Users\Nicolas\Anaconda\include -IC:\Users\Nicolas\Anaconda\PC -c fastFM\ffm.c -o build\temp.win-amd64-2.7\Release\fastfm\ffm.o In file included from C:\Users\Nicolas\Anaconda\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1777:0, from C:\Users\Nicolas\Anaconda\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18, from C:\Users\Nicolas\Anaconda\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4, from fastFM\ffm.c:268: writing build\temp.win-amd64-2.7\Release\fastfm\ffm.def C:\TDM-GCC-64\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\fastfm\ffm.o build\temp.win-amd64-2.7\Release\fastfm\ffm.def -LfastFM/ -LfastFM-core/bin/ -LfastFM-core/externals/CXSparse/Lib/ -LC:\Users\Nicolas\Anaconda\libs -LC:\Users\Nicolas\Anaconda\PCbuild\amd64 -LC:\Users\Nicolas\Anaconda\PC\VS9.0\amd64 -lm -lfastfm -lcxsparse -lblas -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\ffm.pyd C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas collect2.exe: error: ld returned 1 exit status error: command 'C:\TDM-GCC-64\bin\gcc.exe' failed with exit status 1
It seems that the compiler cannot find the BLAS library on my system. Per the BLAS website (http://www.netlib.org/blas/), it seems that BLAS is available for Windows at http://icl.cs.utk.edu/lapack-for-windows/lapack/#build. Unfortunately, it looks like installing BLAS on Windows is possible but quite a process.
I'm curious to know if anyone was ever able to use fastFM on Windows.
I need it too :-( Can the author please consider using wheels ?
@hshteingart Wheels are platform specific, we are providing them for OSX having them for windows would be great. However, I'm not developing on windows and even the OSX was contributed. Let's hope someone with more windows experience helps us out.
HI nicolasfguillaume , all, I'm currently fighting with same problem on Windows 10 x64, same error, did you find any solution finally?, Please any recommendation?
I'll try to deploy it on a Linux machine, thanks anyway, regards, R.
D:\PROGRAM\SDKs\Anaconda3.220\Scripts\gcc.bat -mdll -O -Wall -IfastFM/ -IfastFM-core/include/ -IfastFM-core/externals/CXSparse/Include/ -Id:\program\sdks\anaconda3.220\lib\site-packages\numpy\core\include -Id:\program\sdks\anaconda3.220\include -Id:\program\sdks\anaconda3.220\include -c fastFM\ffm.c -o build\temp.win-amd64-3.4\Release\fastfm\ffm.o fastFM\ffm.c:247:58: fatal error: ../fastFM-core/externals/CXSparse/Include/cs.h: No such file or directory compilation terminated. error: command 'D:\PROGRAM\SDKs\Anaconda3.220\Scripts\gcc.bat' failed with exit status 1
_----------------------------------------
Command "d:\program\sdks\anaconda3.220\python.exe -u -c "import setuptools, tokenize;file='C:\TEMP\rheras\pip-lcx3dkbl-build\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\TEMP\rheras\pip-6h7fkq9x-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\TEMP\rheras\pip-lcx3dkbl-build_
(WSL) Windows subsystem for Linux may be the solution if you have Windows 10.
I was able to install it on WSL without problems and also to use jupyter notebook. I'm on Creators update.
@EgZvor Thanks for the update, did you run the tests? Can you share your step by step install instructions? I would like to add this information to the README if it works for other people too.
@ibayer Sure. On windows I downloaded the Creators upgrade from microsoft official site. While installing it looks like transition from Win7/8 to Win10 and there's 15gb of files left to be able to go back to previous update. I am not sure if it is critical to make this upgrade, I made it because I had the old build which hadn't allowed me to use .exe
files inside WSL.
After that I installed anaconda downloading also from official site linux version, using wget
. It is the latest release and has python 3.6 build in it. With Anaconda every dependency was pretty much installed. I also installed python-dev
through apt-get
just in case.
Then I just followed the instructions in README.
sudo apt-get install python-dev libopenblas-dev
is essential.
Also it won't hurt to sudo apt-get update | sudo apt-get upgrade
I did a binary installation, so I'm not sure how to run tests there's none in python package and if I download repository from git they don't seem to work, because there's just test_*.py files and I guess there should be one unifiying them.
I checked the source code on that files and ran
$python test*
It didn't print anything so I guess every assert was successful
I decided to make
fastFM to run c tests as well.
The strange problem I stumbled upon was I couldn't cd to /externals/OpenBLAS
I looked at Makefile and the first line was like this
( cd ../../externals/CXSparse ; $(MAKE) library )
Unlike the second line, so I prepended the same
( export USE_THREAD=0; cd ../../externals/OpenBLAS ; $(MAKE) libs)
And it worked.
I did make check
and all tests have been passed.
I went back to do python tests and find out that in my case nosetests needed --exe
option to run tests. I got this warning
DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection
module into which all the refactored classes and functions are moved. Also note that the interface of
the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
But other than that all 29 tests have been passed.
@EgZvor Thanks for the details, the warning is nothing to be worried about (see https://github.com/ibayer/fastFM/pull/83). Can you give the the exact change you had to make to the Makefile?
@ibayer
I changed
( export USE_THREAD=0; cd externals/OpenBLAS ; $(MAKE) libs)
to
( export USE_THREAD=0; cd ../../externals/OpenBLAS ; $(MAKE) libs)
Here's the patch Makefile.txt
Thanks, fixed https://github.com/ibayer/fastFM-core/pull/23 .
Thanks guys for your comments and help, fortunately I moved it to a Ubuntu environment and after some problems already fixed, it seems all is working OK, although now I have problems in order to build one of the matrix (compare) needed for using bpr.FMRecommender. Anyway maybe I'll open a new thread here. Cheers.