Arangodb: Version 3.5 does not compile on SSE3 machines

Created on 25 Nov 2019  路  3Comments  路  Source: arangodb/arangodb

My Environment

  • __ArangoDB Version__: 3.5.2
  • __Storage Engine__: RocksDB
  • __Deployment Mode__: Single Server
  • __Deployment Strategy__: Manual Start
  • __Infrastructure__: own
  • __Operating System__: Ubuntu 18.04
  • __Total RAM in your machine__: 4Gb.
  • __Disks in use__: SSD
  • __Used Package__: Source

Component, Query & Data

__Affected feature__:
Source compilation

Steps to reproduce

Compilation according to instructions at https://www.arangodb.com/docs/stable/cookbook/compiling-debian.html - in particular:

  1. git clone git://github.com/arangodb/arangodb.git
  2. cd arangodb/
  3. git checkout v3.5.2
  4. mkdir build
  5. cd build
  6. cmake .. -DUSE_OPTIMIZE_FOR_ARCHITECTURE=On
  7. make

__Problem__:
Compilation of ArangoDB version 3.5 fails on a machine with a CPU only supporting the SSE3 instruction set version, with the error message:

[ 21%] Building CXX object lib/CMakeFiles/arango.dir/__/3rdParty/velocypack/src/asm-utf8check.cpp.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/x86intrin.h:43:0,
                 from /tmp/arangodb/arangodb/3rdParty/velocypack/src/asm-utf8check.cpp:26:
/usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h: In function 芒聙聵bool arangodb::velocypack::validate_utf8_fast_sse42(const uint8_t*, std::size_t)芒聙聶:
/usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:67:1: error: inlining failed in call to always_inline 芒聙聵int _mm_testz_si128(__m128i, __m128i)芒聙聶: target specific option mismatch
 _mm_testz_si128 (__m128i __M, __m128i __V)
 ^~~~~~~~~~~~~~~
/tmp/arangodb/arangodb/3rdParty/velocypack/src/asm-utf8check.cpp:208:25: note: called from here
   return _mm_testz_si128(has_error, has_error);
          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
lib/CMakeFiles/arango.dir/build.make:830: recipe for target 'lib/CMakeFiles/arango.dir/__/3rdParty/velocypack/src/asm-utf8check.cpp.o' failed
make[2]: *** [lib/CMakeFiles/arango.dir/__/3rdParty/velocypack/src/asm-utf8check.cpp.o] Error 1
CMakeFiles/Makefile2:3396: recipe for target 'lib/CMakeFiles/arango.dir/all' failed
make[1]: *** [lib/CMakeFiles/arango.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

__Expected result__:
It would be great to be able to compile the latest versions of ArangoDB on old machines for testing purposes. Compilation of the previous major version 3.4, e.g. v3.4.8, works fine on SSE3 machines.

Related issues:
https://github.com/arangodb/arangodb/issues/7705
https://github.com/arangodb/arangodb/issues/8135

1 Bug 1 Question 2 Solved 2 Won't Fix

All 3 comments

Hi,
as stated in the other issues machines without these processor features are older than 10 years and we won't support this - so as previously told this is a won't fix.
However, there are several settings in CMakeCache.txt which may achieve what you want:

ASM_OPTIMIZATIONS=OFF
ASM686:BOOL=OFF
AMD64:BOOL=OFF

Thanks!

Setting ASM_OPTIMIZATIONS:BOOL=OFF in CMakeCache.txt (after running cmake .. -DUSE_OPTIMIZE_FOR_ARCHITECTURE=On) and leaving everything else unchanged did the trick.

The compilation of the tests did fail, with the message:

[ 97%] Building CXX object tests/CMakeFiles/arangodbtests.dir/IResearch/IResearchQueryOptimization-test.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
tests/CMakeFiles/arangodbtests.dir/build.make:3350: recipe for target 'tests/CMakeFiles/arangodbtests.dir/IResearch/IResearchQueryOptimization-test.cpp.o' failed
make[2]: *** [tests/CMakeFiles/arangodbtests.dir/IResearch/IResearchQueryOptimization-test.cpp.o] Error 4
CMakeFiles/Makefile2:4021: recipe for target 'tests/CMakeFiles/arangodbtests.dir/all' failed
make[1]: *** [tests/CMakeFiles/arangodbtests.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

But the database starts fine:

$ build/bin/arangod -c etc/relative/arangod.conf --server.endpoint tcp://127.0.0.1:8529 /tmp/database-dir
2019-11-26T10:43:15Z [18937] INFO [e52b0] ArangoDB 3.5.2 [linux] 64bit, using jemalloc, build tags/v3.5.2-0-gec4166527e-dirty, VPack 0.1.33, RocksDB 6.2.0, ICU 58.1, V8 7.1.302.28, OpenSSL 1.1.1  11 Sep 2018
2019-11-26T10:43:15Z [18937] WARNING [0458b] This is a maintainer version intended for debugging. DO NOT USE IN PRODUCTION!
2019-11-26T10:43:15Z [18937] WARNING [bd666] ==============================================================================
2019-11-26T10:43:15Z [18937] INFO [75ddc] detected operating system: Linux version 4.15.0-66-generic (buildd@lgw01-amd64-044) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019
2019-11-26T10:43:15Z [18937] WARNING [3909f] {memory} environment variable GLIBCXX_FORCE_NEW' is not set. it is recommended to set it to some value to avoid unnecessary memory pooling in glibc++
2019-11-26T10:43:15Z [18937] WARNING [56d59] {memory} execute 'export GLIBCXX_FORCE_NEW=1'
2019-11-26T10:43:15Z [18937] WARNING [118b0] {memory} maximum number of memory mappings per process is 65530, which seems too low. it is recommended to set it to at least 256000
2019-11-26T10:43:15Z [18937] WARNING [49528] {memory} execute 'sudo sysctl -w "vm.max_map_count=256000"'
2019-11-26T10:43:16Z [18937] INFO [43396] {authentication} Jwt secret not specified, generating...
2019-11-26T10:43:16Z [18937] INFO [144fe] using storage engine rocksdb
2019-11-26T10:43:16Z [18937] INFO [3bb7d] {cluster} Starting up with role SINGLE
2019-11-26T10:43:16Z [18937] INFO [a1c60] {syscall} file-descriptors (nofiles) hard limit is 1048576, soft limit is 1048576
2019-11-26T10:43:16Z [18937] INFO [24783] created database directory '/tmp/database-dir'
2019-11-26T10:43:16Z [18937] INFO [3844e] {authentication} Authentication is turned on (system only), authentication for unix sockets is turned on
2019-11-26T10:43:18Z [18937] INFO [6ea38] using endpoint 'http+tcp://127.0.0.1:8529' for non-encrypted requests
2019-11-26T10:43:18Z [18937] INFO [857d7] {authentication} Creating user "root"
2019-11-26T10:43:18Z [18937] INFO [cf3f4] ArangoDB (version 3.5.2 [linux]) is ready for business. Have fun!

It's very understandable that you can't be supporting all sorts of ancient hardware, but it's great to be able to put old machines lying around to use for testing purposes. Let's call it environmentally friendly : )

yea, what failed to compile is the c++ tests. They're pretty expensive and probably your machine just went OOM while attempting to do it.
But as you found out, its not neccessary to run arangodb.

Was this page helpful?
0 / 5 - 0 ratings