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

Problem while building cblosc2 on ARM64 #87

Closed
kif opened this issue Sep 12, 2019 · 12 comments · Fixed by #88
Closed

Problem while building cblosc2 on ARM64 #87

kif opened this issue Sep 12, 2019 · 12 comments · Fixed by #88

Comments

@kif
Copy link
Contributor

kif commented Sep 12, 2019

Hi,
I am testing blosc2 on ARM64, actually the Pine64. Not a super powerful board but it is 64bits and has neon SIMD and this is what I am interested in.
https://www.pine64.org/devices/single-board-computers/pine-a64/
The operating system is debian10 hence kernel 4.19 and gcc8.3

Here is the error message, it is likely the expectations for following the standard is slightly different from one architecture to another ... but I am not that fluent in C:

kieffer@pine64:/data/workspace/c-blosc2$ cd build/
kieffer@pine64:/data/workspace/c-blosc2/build$ rm -rf *    
kieffer@pine64:/data/workspace/c-blosc2/build$ cmake ..
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Configuring for Blosc version: 2.0.0-beta.4.dev
-- Using LZ4 internal sources.
-- Using LIZARD internal sources.
-- Using MINIZ internal sources for ZLIB support.
-- Using ZSTD internal sources.
-- No IPP libraries found.
-- Not using IPP accelerated compression.
-- No build type specified. Defaulting to 'Release'.
-- Building for system processor aarch64
-- Adding run-time support for NEON
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
Skipping test_shuffle_roundtrip_altivec on non-ALTIVEC builds
Skipping test_shuffle_roundtrip_avx2 on non-AVX2 builds
Skipping test_shuffle_roundtrip_sse2 on non-SSE2 builds
-- Configuring done
CMake Warning (dev) at blosc/CMakeLists.txt:258 (add_library):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "blosc2_static" of type "STATIC_LIBRARY" has the following
  visibility properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /data/workspace/c-blosc2/build
kieffer@pine64:/data/workspace/c-blosc2/build$ make
Scanning dependencies of target blosc_shared_testing
[  1%] Building C object blosc/CMakeFiles/blosc_shared_testing.dir/blosc2.c.o
In file included from /data/workspace/c-blosc2/blosc/blosc2.c:18:
/data/workspace/c-blosc2/blosc/blosc2.h:1162:34: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 #define blosc_timestamp_t struct timespec
                                  ^~~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.h:1168:39: note: in expansion of macro 'blosc_timestamp_t'
 BLOSC_EXPORT void blosc_set_timestamp(blosc_timestamp_t* timestamp);
                                       ^~~~~~~~~~~~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.h:1162:34: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 #define blosc_timestamp_t struct timespec
                                  ^~~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.h:1173:41: note: in expansion of macro 'blosc_timestamp_t'
 BLOSC_EXPORT double blosc_elapsed_nsecs(blosc_timestamp_t start_time,
                                         ^~~~~~~~~~~~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.h:1162:34: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 #define blosc_timestamp_t struct timespec
                                  ^~~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.h:1179:40: note: in expansion of macro 'blosc_timestamp_t'
 BLOSC_EXPORT double blosc_elapsed_secs(blosc_timestamp_t start_time,
                                        ^~~~~~~~~~~~~~~~~
In file included from /data/workspace/c-blosc2/blosc/blosc2.c:51:
/data/workspace/c-blosc2/internal-complibs/miniz-2.0.8/miniz.c:3031:9: note: #pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.
 #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
         ^~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.c: In function 'blosc_compress_context':
/data/workspace/c-blosc2/blosc/blosc2.c:1592:23: warning: passing argument 1 of 'blosc_set_timestamp' from incompatible pointer type [-Wincompatible-pointer-types]
   blosc_set_timestamp(&last);
                       ^~~~~
In file included from /data/workspace/c-blosc2/blosc/blosc2.c:18:
/data/workspace/c-blosc2/blosc/blosc2.h:1168:58: note: expected 'struct timespec *' but argument is of type 'struct timespec *'
 BLOSC_EXPORT void blosc_set_timestamp(blosc_timestamp_t* timestamp);
                                                          ^
/data/workspace/c-blosc2/blosc/blosc2.c:1644:25: warning: passing argument 1 of 'blosc_set_timestamp' from incompatible pointer type [-Wincompatible-pointer-types]
     blosc_set_timestamp(&current);
                         ^~~~~~~~
In file included from /data/workspace/c-blosc2/blosc/blosc2.c:18:
/data/workspace/c-blosc2/blosc/blosc2.h:1168:58: note: expected 'struct timespec *' but argument is of type 'struct timespec *'
 BLOSC_EXPORT void blosc_set_timestamp(blosc_timestamp_t* timestamp);
                                                          ^
/data/workspace/c-blosc2/blosc/blosc2.c:1645:39: error: type of formal parameter 1 is incomplete
     double ctime = blosc_elapsed_secs(last, current);
                                       ^~~~
/data/workspace/c-blosc2/blosc/blosc2.c:1645:45: error: type of formal parameter 2 is incomplete
     double ctime = blosc_elapsed_secs(last, current);
                                             ^~~~~~~
/data/workspace/c-blosc2/blosc/blosc2.c: In function 'blosc_get_complib_info':
/data/workspace/c-blosc2/blosc/blosc2.c:2592:14: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
   *complib = strdup(clibname);
              ^~~~~~
              strcmp
/data/workspace/c-blosc2/blosc/blosc2.c:2592:12: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   *complib = strdup(clibname);
            ^
/data/workspace/c-blosc2/blosc/blosc2.c:2593:12: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   *version = strdup(clibversion);
            ^
make[2]: *** [blosc/CMakeFiles/blosc_shared_testing.dir/build.make:63: blosc/CMakeFiles/blosc_shared_testing.dir/blosc2.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: blosc/CMakeFiles/blosc_shared_testing.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
@kif
Copy link
Contributor Author

kif commented Sep 12, 2019

Apparently it has to be C11, not C99 ... it compiles a bit further

@kif
Copy link
Contributor Author

kif commented Sep 12, 2019

The auto-guess of the version of the glibc apparently is the root of the bug ...

@FrancescAlted
Copy link
Member

So are you finally able to compile blosc2 in your pine64 box?

@kif
Copy link
Contributor Author

kif commented Sep 12, 2019 via email

@FrancescAlted
Copy link
Member

Ha, it is curious because I don't remeber having this problems with struct_timespec.h in Ubuntu 16.04/18.04 for Raspberry. Maybe the issue is just in Debian? Very strange...

Regarding bshuf_trans_bit_elem_scal() name inconsistencies, yeah, currently that is quite a mess of naming, but fortunately, this is not part of the public API, so if you want to put some order in this naming jungle, you are welcome.

@kif
Copy link
Contributor Author

kif commented Sep 13, 2019

Maybe it is debian ... I just got access (again) to the power9 with debian 10 and it is the same issue. I'll check twice on amd64 and arm32 but surprisingly it works there without complain.

About the unconsistency of the private API, I noticed it only because I benchmarked those functions.

@kif
Copy link
Contributor Author

kif commented Sep 17, 2019

Coming back on this "failed to build from scratch", I tested on the power9 and arm64:

#include <time.h>
#include <stdio.h>
int main()
{
   printf("Posix is %d",__USE_POSIX199309);
   return 0;
}

And guess what? both are properly defined. May the error be in the cmake default options ?

@kif
Copy link
Contributor Author

kif commented Sep 17, 2019

I tested if "features.h" was properly included or not and apparently it was. The error is somewhere else.
@picca this issue looks to be specific to debian10, any idea ?

@picca
Copy link

picca commented Sep 17, 2019 via email

@kif
Copy link
Contributor Author

kif commented Sep 19, 2019

I just "debootstrapped" a ubuntu 18.04 system (gcc7) on ppc64le and the issue is apparently the same.

It should not be a debian issue. I will git-bisect.

@kif
Copy link
Contributor Author

kif commented Sep 19, 2019

It compiles with clang7 but neither with gcc7 nor gcc8. The problem is apparently in the expand of the macros. It looks like std=c99 is not having effect, or at least not as much as on amd64

@kif
Copy link
Contributor Author

kif commented Sep 23, 2019

kif pushed a commit to kif/c-blosc2 that referenced this issue Sep 23, 2019
FrancescAlted pushed a commit that referenced this issue Nov 26, 2019
* Prevent "FTBFS" on linux arm64 and ppc64le

close #87

* The byte-shuffling for 2-bytes data-type works on altivec

* Fix the 4-bytes object shuffle

Correct the style as well according to guidelines. Still WIP

* some more refactoring

* implementation for 16-byte wide shuffle

* Make code resilient to unaligned read access as well

* unshuffle works for 16, 32 and 64 bits data-type.

128bit datatype and larger are still under dev'

* re-implement SSE2 -> altivec

* First SSE2-free version

* work on basic porting of bitshuffle to VSX

* translation of simple functions SSE -> VSX

* simplfy the reading using vec_xl instead of vec_ld

* Use VSX load & store everywhere.

Make the code much more readable and simpler

* working on the VSX vectorisation of the bitshuffle algorithm ...

* tests are again passing...

* bitunshuffle implemented in altivec

Treating data after the vectorized part remains to be implemented.
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

Successfully merging a pull request may close this issue.

3 participants