ail-project / ail-framework

AIL framework - Analysis Information Leak framework
GNU Affero General Public License v3.0
537 stars 80 forks source link

ARM Building Errors #141

Open vncloudsco opened 2 years ago

vncloudsco commented 2 years ago

Dear @adulau

Form https://github.com/ail-project/ail-framework/pull/134

we tried to build the system on ARM platform and got the errors problem

2022-03-15 07:30:47 (7.38 MB/s) - ‘/home/ubuntu/ail-framework/ardb/src/../deps/rocksdb-6.8.1.tar.gz’ saved [6037007]

<<<<< Done dowloading RocksDB
>>>>> Unpacking ROCKSDB
<<<<< Done unpacking ROCKSDB
>>>>> Building ROCKSDB
make[2]: Entering directory '/home/ubuntu/ail-framework/ardb/deps/rocksdb-6.8.1'
$DEBUG_LEVEL is 0
  GEN      util/build_version.cc
$DEBUG_LEVEL is 0
  GEN      util/build_version.cc
  CC       cache/clock_cache.o
.........................................
  CC       util/compression_context_cache.o
  CC       util/crc32c.o
util/crc32c.cc:357:1: error: template with C linkage
  357 | template<void (*CRC32)(uint64_t*, uint8_t const**)>
      | ^~~~~~~~
In file included from ./util/crc32c_arm64.h:15,
                 from util/crc32c.cc:21:
/usr/lib/gcc/aarch64-linux-gnu/9/include/arm_acle.h:33:1: note: ‘extern "C"’ linkage started here
   33 | extern "C" {
      | ^~~~~~~~~~
util/crc32c.cc:477:13: error: conflicting declaration of ‘std::string rocksdb::crc32c::IsFastCrc32Supported()’ with ‘C’ linkage
  477 | std::string IsFastCrc32Supported() {
      |             ^~~~~~~~~~~~~~~~~~~~
In file included from util/crc32c.cc:12:
./util/crc32c.h:20:20: note: previous declaration with ‘C++’ linkage
   20 | extern std::string IsFastCrc32Supported();
      |                    ^~~~~~~~~~~~~~~~~~~~
util/crc32c.cc:1249:10: error: conflicting declaration of ‘uint32_t rocksdb::crc32c::Extend(uint32_t, const char*, size_t)’ with ‘C’ linkage
 1249 | uint32_t Extend(uint32_t crc, const char* buf, size_t size) {
      |          ^~~~~~
In file included from util/crc32c.cc:12:
./util/crc32c.h:25:17: note: previous declaration with ‘C++’ linkage
   25 | extern uint32_t Extend(uint32_t init_crc, const char* data, size_t n);
      |                 ^~~~~~
util/crc32c.cc:1255:1: error: expected ‘}’ at end of input
 1255 | }  // namespace ROCKSDB_NAMESPACE
      | ^
In file included from ./util/crc32c_arm64.h:15,
                 from util/crc32c.cc:21:
/usr/lib/gcc/aarch64-linux-gnu/9/include/arm_acle.h:33:12: note: to match this ‘{’
   33 | extern "C" {
      |            ^
make[2]: *** [Makefile:2117: util/crc32c.o] Error 1
make[2]: Leaving directory '/home/ubuntu/ail-framework/ardb/deps/rocksdb-6.8.1'
make[1]: *** [Makefile:411: /home/ubuntu/ail-framework/ardb/src/../deps/rocksdb-6.8.1/librocksdb.a] Error 2
make[1]: Leaving directory '/home/ubuntu/ail-framework/ardb/src'
make: *** [Makefile:4: all] Error 2
root@instance-20211011-1640-795620:/home/ubuntu/ail-framework# 
adulau commented 1 year ago

The latest release of AIL 5.0 replaced ardb with kvrocks.

vncloudsco commented 4 months ago

@adulau PyFaup Python Module not support arm please tell me how to configure it?

adulau commented 4 months ago

Good question. We will have a look at faup to see if we cannot provide them a patch.

vncloudsco commented 4 months ago

@adulau Thank you, I'm waiting to hear from you and hope it will be resolved soon

adulau commented 4 months ago

Can you give us some details about the ARM architecture/os used? Is it Linux, MacOS?

vncloudsco commented 4 months ago

@adulau this details about the ARM architecture

Linux instanc #58~20.04.1-Ubuntu SMP Thu Feb 15 13:21:32 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

My os:

NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

i also ran it on macbook m1 and got error

vncloudsco commented 4 months ago

Info file lib after building PyFaup Python Module only file was created

root@instance-20211014-1710:/home/ail-framework/faup/src/lib/bindings/python/pyfaup/Linux/x86_64# file libfaupl.so 
libfaupl.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e13326f94f9ff22a42431aa1cdf7a8c020201666, stripped

i get log like below when run

Flask_server.py         modules     static
blueprints              server.crt  templates
create_default_user.py  server.key  update_thirdparty.sh
VT submission is disabled
Traceback (most recent call last):
  File "./Flask_server.py", line 36, in <module>
    from blueprints.crawler_splash import crawler_splash
  File "/home/ail-framework/var/www/blueprints/crawler_splash.py", line 28, in <module>
    from lib import crawlers
  File "/home/ail-framework/bin/lib/crawlers.py", line 28, in <module>
    from pyfaup.faup import Faup
  File "/home/ail-framework/AILENV/lib/python3.8/site-packages/pyfaup-1.2-py3.8.egg/pyfaup/__init__.py", line 34, in <module>
    bind.library = cdll.LoadLibrary(LOAD_LIB)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/ail-framework/AILENV/lib/python3.8/site-packages/pyfaup-1.2-py3.8.egg/pyfaup/Linux/x86_64/libfaupl.so: cannot open shared object file: No such file or directory
Terrtia commented 4 months ago

Can you please try to update the faup shared library path : https://github.com/stricaud/faup/tree/master?tab=readme-ov-file#why-do-i-receive-the-error-libfauplso1-cannot-open-shared-object-file-when-trying-to-run-faup

adulau commented 3 months ago

@vncloudsco did you try the what @Terrtia recommended to you?

vncloudsco commented 3 months ago

@Terrtia @adulau thank you, buy I tested and it's not true for my case, on arm, the software cannot be built into a complete library file, you cannot use the x86_64 file for arm. I can't find the library file for arm after building it doesn't exist