simde icon indicating copy to clipboard operation
simde copied to clipboard

document meson and that it is preferred over cmake

Open mr-c opened this issue 4 years ago • 9 comments
trafficstars

Add a nice summation of the following to https://github.com/simd-everywhere/simde/blob/master/CONTRIBUTING.md

ninja test will run all the tests (in parallel)

I usually just run the executables individually, (INSN=x86/sse; ninja test/${INSN}-{native,emul}-c && test/${INSN}-native-c && test/${INSN}-emul-c is pretty standard), but you can also run specific tests… see https://mesonbuild.com/Unit-tests.html

So, for example, meson test x86/sse/{native,emul}/{c,cpp} will run all 4 SSE tests.

mkdir build
cd build
meson ..
ninja test
``

mr-c avatar Nov 28 '20 18:11 mr-c

Partially fixed in https://github.com/simd-everywhere/simde/commit/15f0e244669c084646c2527ca53522c98935ff37

mr-c avatar Nov 30 '20 16:11 mr-c

hi, using https://github.com/simd-everywhere/simde/blob/master/CONTRIBUTING.md build method, still not pass build. it report following error.

The Meson build system Version: 0.47.2 Source dir: /home/ll/simde/test Build dir: /home/ll/simde/test/build Build type: native build

ERROR: First statement must be a call to project

LuoZero avatar Dec 18 '20 15:12 LuoZero

Hello @luozero , can you share the commands you ran? I followed the instructions at https://github.com/simd-everywhere/simde/blob/master/CONTRIBUTING.md#building-the-tests and it worked for me

~/src/simde$ mkdir build
~/src/simde$ cd build
~/src/simde/build$ CFLAGS="-march=native" CXXFLAGS="-march=native" meson ..
The Meson build system
Version: 0.56.0
Source dir: /home/michael/src/simde
Build dir: /home/michael/src/simde/build
Build type: native build
Project name: SIMDe
Project version: 0.7.0-rc.1
Using 'CFLAGS' from environment with value: '-march=native'
C compiler for the host machine: ccache cc (gcc 10.2.1 "cc (Debian 10.2.1-1) 10.2.1 20201207")
C linker for the host machine: cc ld.bfd 2.35.1
Using 'CXXFLAGS' from environment with value: '-march=native'
C++ compiler for the host machine: ccache c++ (gcc 10.2.1 "c++ (Debian 10.2.1-1) 10.2.1 20201207")
C++ linker for the host machine: c++ ld.bfd 2.35.1
Using 'CFLAGS' from environment with value: '-march=native'
Using 'CXXFLAGS' from environment with value: '-march=native'
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Compiler for C supports arguments -fopenmp-simd: YES 
Compiler for C++ supports arguments -fopenmp-simd: YES 
Compiler for C supports arguments -Wpsabi: YES 
Compiler for C++ supports arguments -Wpsabi: YES 
Build targets in project: 854

Found ninja-1.10.1 at /usr/bin/ninja
~/src/simde/build$ ninja test
[ lots of output]

mr-c avatar Dec 18 '20 15:12 mr-c

Version: 0.47.2

Meson is too old. I'm not actually sure what version is required, but IIRC something around 0.52.

You probably want to install via pip: https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip. Or, of course, you can use CMake; a big part of the reason it's still in tree is to support old distros.

nemequ avatar Dec 18 '20 23:12 nemequ

update meson, still can not build, following is the log, [root@ecs-f81d build]# CFLAGS="-march=native" CXXFLAGS="-march=native" meson .. The Meson build system Version: 0.56.0 Source dir: /home/ll/simde/test Build dir: /home/ll/simde/test/build Build type: native build

ERROR: First statement must be a call to project

A full log can be found at /home/ll/simde/test/build/meson-logs/meson-log.txt

using CMAKE, in x86_64 can pass build an test. but in aarch64, it report following issue. make Scanning dependencies of target simde-test-emul [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/mmx.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/sse.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/sse2.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/sse3.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/ssse3.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/sse4.1.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/sse4.2.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/avx.c.o [ 1%] Building C object CMakeFiles/simde-test-emul.dir/x86/avx2.c.o In file included from /home/ll/simde/test/x86/avx2.c:25:0: /home/ll/simde/test/../simde/x86/avx2.h: In function ‘test_simde_mm256_srl_epi64’: /home/ll/simde/test/../simde/x86/avx2.h:4779:25: internal compiler error: in expand_shift_1, at expmed.c:2245 r_.u64 = a_.u64 >> HEDLEY_STATIC_CAST(int64_t, shift); ^ Please submit a full bug report, with preprocessed source if appropriate. See http://bugzilla.redhat.com/bugzilla for instructions. Preprocessed source stored into /tmp/ccqFYaqs.out file, please attach this to your bugreport. make[2]: *** [CMakeFiles/simde-test-emul.dir/x86/avx2.c.o] Error 1 make[1]: *** [CMakeFiles/simde-test-emul.dir/all] Error 2

LuoZero avatar Dec 19 '20 02:12 LuoZero

in aarch64, need to modify two files /home/ll/simde/test/../simde/x86/avx2.h :4779 r_.u64 = a_.u64 >> (uint8_t)(HEDLEY_STATIC_CAST(int64_t, shift)); vim /home/ll/simde/test/../simde/x86/avx512/srl.h:168 r_.u64 = a_.u64 >> (int8_t)(count_.i64[0]); then can pass build and test.

LuoZero avatar Dec 19 '20 02:12 LuoZero

What compiler, compiler version, and architecture(s) (host and target) are you using? Also, since you're using -march=native, what features does your CPU support (since you're using -march=native)? If you're using distro packages, it might be helpful to know what distro and release, too. There are a few known issues with AVX-512 on old compilers which we can't really work around, though they only occur when AVX-512 is enabled in the compiler but SIMDe isn't allowed to use them (SIMDE_NO_NATIVE is defined), which really should only happen during testing.

As for the Meson issue, did you delete the build directory after updating Meson? Meson is usually quite good about handling configuration changes gracefully, but honestly I haven't tried updating Meson the rebuilding the project. That error is definitely the same error you see when trying to build with old versions of Meson and I've never seen it with newer versions, so I'm pretty confident that it's related.

nemequ avatar Dec 21 '20 22:12 nemequ

thanks nemequ,

compile and target are the same one. used Architecture: aarch64

CMake can work, it's ok to build.

LuoZero avatar Dec 22 '20 14:12 LuoZero

What about compiler and flags?

I'm not really concerned about the issue with Meson (I still think that should be resolved with a fresh build on a newer version), but I'd like to figure out what is going on with that ICE. The changes you mentioned should not be necessary, that's definitely a compiler bug and in order to work around that I need to be able to reproduce it. It sounds a bit like GCC #94488, but that should have been fixed in more recent GCC and there are work-arounds in place in SIMDe to avoid it in older versions of GCC…

nemequ avatar Dec 24 '20 17:12 nemequ