Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Ubuntu/16.04 #25

Open
lucidfrontier45 opened this issue Oct 4, 2017 · 5 comments
Open

Cannot build on Ubuntu/16.04 #25

lucidfrontier45 opened this issue Oct 4, 2017 · 5 comments

Comments

@lucidfrontier45
Copy link

Hi. I would like to make some modification on fastfm but I couldn't compile this fastfm-core module. I'm using Ubuntu/16.04 with gcc 5.4.0 .

Here is my compile error log. Looks it is a OpenBlas problem though.

$ make                            
( cd externals/CXSparse ; make library )
make[1]: Entering directory '/home/du/workspace/fastFM/fastFM-core/externals/CXSparse'
( cd Lib ; make )
make[2]: Entering directory '/home/du/workspace/fastFM/fastFM-core/externals/CXSparse/Lib'
make[2]: Nothing to be done for 'default'.
make[2]: Leaving directory '/home/du/workspace/fastFM/fastFM-core/externals/CXSparse/Lib'
make[1]: Leaving directory '/home/du/workspace/fastFM/fastFM-core/externals/CXSparse'
( export USE_THREAD=0; cd externals/OpenBLAS ; make libs)
make[1]: Entering directory '/home/du/workspace/fastFM/fastFM-core/externals/OpenBLAS'
getarch_2nd.c: In function ‘main’:
getarch_2nd.c:12:35: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function)
     printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
                                   ^
getarch_2nd.c:12:35: note: each undeclared identifier is reported only once for each function it appears in
getarch_2nd.c:13:35: error: ‘SGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function)
     printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
                                   ^
getarch_2nd.c:14:35: error: ‘DGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function)
     printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
                                   ^
getarch_2nd.c:15:35: error: ‘DGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function)
     printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
                                   ^
getarch_2nd.c:19:35: error: ‘CGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function)
     printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M);
                                   ^
getarch_2nd.c:20:35: error: ‘CGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function)
     printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N);
                                   ^
getarch_2nd.c:21:35: error: ‘ZGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function)
     printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M);
                                   ^
getarch_2nd.c:22:35: error: ‘ZGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function)
     printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N);
                                   ^
getarch_2nd.c:69:50: error: ‘SGEMM_DEFAULT_Q’ undeclared (first use in this function)
     printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 *  sizeof(float)));
                                                  ^
getarch_2nd.c:70:50: error: ‘DGEMM_DEFAULT_Q’ undeclared (first use in this function)
     printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 *  sizeof(double)));
                                                  ^
getarch_2nd.c:71:50: error: ‘CGEMM_DEFAULT_Q’ undeclared (first use in this function)
     printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 *  sizeof(float)));
                                                  ^
getarch_2nd.c:72:50: error: ‘ZGEMM_DEFAULT_Q’ undeclared (first use in this function)
     printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 *  sizeof(double)));
                                                  ^
make[1]: *** [getarch_2nd] Error 1
Makefile:123: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
make[1]: Leaving directory '/home/du/workspace/fastFM/fastFM-core/externals/OpenBLAS'
Makefile:3: recipe for target 'lib' failed
make: *** [lib] Error 2

By the way, the doc says I have to install OpenBLAS with apt-get but the makefile code looks just using extrenals/OpenBLAS, not system OpenBLAS. Is this build procedure correct?

@ibayer
Copy link
Owner

ibayer commented Oct 4, 2017

I think our travis-ci runs 16.04, so this should really work.

Please make sure that you use --recursive in

git clone --recursive https://github.com/ibayer/fastFM-core.git

I assume you are building from the latest master?

the doc says I have to install OpenBLAS with apt-get but

Where? This is not correct anymore (OpenBLAS is included as sub-module).

Here is my compile error log. Looks it is a OpenBlas problem though.

Just tested again, this works for me on 16.04:

cd /tmp/
git clone --recursive https://github.com/ibayer/fastFM-core.git
cd fastFM-core
make
cd demo
make
make demo_lib

@lucidfrontier45
Copy link
Author

lucidfrontier45 commented Oct 4, 2017

Makefile:123: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.. Stop.

This was the direct cause. My CPU is Core-i7 7700k Kaby Lake and OpenBLAS failed to auto-detect its architecture. I added TARGET=HASWELL to my env and make was successful.
Maybe we should notice it in the doc.

the doc says I have to install OpenBLAS with apt-get but

Where? This is not correct anymore (OpenBLAS is included as sub-module).

Sorry, what the fastfm-core doc says to install was atlas (for cblas interface I suppose), not openblas.
https://github.com/ibayer/fastFM-core#installation

# Install cblas (Linux only).
$ sudo apt-get install libatlas-base-dev

But the doc of fastfm itself still says to install openblas. (for cblas I suppose)
https://github.com/ibayer/fastFM#installation

# Install cblas and python-dev header (Linux only).
# - cblas can be installed with libatlas-base-dev or libopenblas-dev (Ubuntu)
$ sudo apt-get install python-dev libopenblas-dev

@ibayer
Copy link
Owner

ibayer commented Oct 4, 2017

Looks like a special case to me OpenBLAS: Detecting CPU failed. but adding a note to the README is a good idea.

We don't install OpenBLAS or ATLAS on our build machine https://github.com/ibayer/fastFM/blob/master/.travis.yml .

I believe neither is needed, but we should double check on a clean machine.

Thanks for reporting the issues. Feel free to open a PR to fix the docs.

@lucidfrontier45
Copy link
Author

FYI, the same openblas issue was reported in the official repo.

OpenMathLib/OpenBLAS#1006

@ibayer
Copy link
Owner

ibayer commented Oct 5, 2017

Thanks, that very good to know. So we should put a note in the README and update the OpenBLAS version as soon as a new release comes out (problem fixed in dev master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants