cgru icon indicating copy to clipboard operation
cgru copied to clipboard

Compiling on aarch64?

Open Ramel opened this issue 2 years ago • 4 comments

Hello,

I'm trying to compile on an aarch64 debian 10 machine, but it hangs with :

$ ./build.sh
CGRU_VERSION 2.3.1 : '/home/***/cgru'
CGRU_REVISION e77ad43e1cdddd19b148ddb2d43c9f3309054d1d
Detecting UNIX distribution...
Debian 10 i386
Building on 'Debian'
-- 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
-- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.7m.so (found version "3.7.3")
PostgreSQL found. Building with SQL.
Setting c++11 standard for GCC 8.3.0
Using std::regex ECMAScript regular expressions (Perl-like).
-- Qt version 5.11.3
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   filesystem
--   system
--   python
-- Configuring done
-- Generating done
-- Build files have been written to: /home/***/cgru/afanasy/src/project.cmake
Scanning dependencies of target afanasy
[  0%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/address.cpp.o
[  0%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/af.cpp.o
[  1%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/afattr.cpp.o
[  1%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/afnode.cpp.o
[  1%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/afqueue.cpp.o
[  2%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/afwork.cpp.o
[  2%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/blockdata.cpp.o
[  2%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/branch.cpp.o
[  3%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/client.cpp.o
[  3%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/common/base64.cpp.o
[  3%] Building CXX object libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/common/dlMutex.cpp.o
In file included from /home/***/cgru/afanasy/src/libafanasy/common/dlMutex.cpp:10:
/home/***/cgru/afanasy/src/libafanasy/common/dlMutex.cpp: In constructor ‘DlMutex::DlMutex()’:
/home/***/cgru/afanasy/src/libafanasy/common/dlCompileAssert.h:15:55: error: ‘assertion_failed’ is not a member of ‘DlCompileAssert<false>’
 #define compile_assert(expr) DlCompileAssert<(expr)>::assertion_failed();
                                                       ^~~~~~~~~~~~~~~~
/home/***/cgru/afanasy/src/libafanasy/common/dlMutex.cpp:31:2: note: in expansion of macro ‘compile_assert’
  compile_assert(sizeof(m_data) >= sizeof(pthread_mutex_t));
  ^~~~~~~~~~~~~~
make[2]: *** [libafanasy/CMakeFiles/afanasy.dir/build.make:193: libafanasy/CMakeFiles/afanasy.dir/home/***/cgru/afanasy/src/libafanasy/common/dlMutex.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:91: libafanasy/CMakeFiles/afanasy.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I've seen this error on another issue with Osx :

https://github.com/CGRU/cgru/issues/317#issuecomment-274172453

But I don't known if it's possible to compile on aarch64 in fact! As I see that all debian packages are in amd64.

Ramel avatar Nov 05 '21 16:11 Ramel

Hi! I have not heard that someone managed to compile the project on aarch64. You can also try to ask some special programming on aarch64 forums. It is a very tiny file that produced the error: https://github.com/CGRU/cgru/blob/master/afanasy/src/libafanasy/common/dlCompileAssert.h What's wrong with it for aarch64?

timurhai avatar Nov 08 '21 12:11 timurhai

It seem's that if I remove "::" line 15 in cgru/afanasy/src/libafanasy/common/dlCompileAssert.h. It compiles. But don't known why!

 #define compile_assert(expr) DlCompileAssert<(expr)>::assertion_failed();

I don't think that's the solution and as I don't code in C, don't undersand why it's compling! What are the purpose of "::"?

Ramel avatar Nov 08 '21 17:11 Ramel

https://stackoverflow.com/questions/5345527/what-does-the-mean-in-c

timurhai avatar Nov 08 '21 17:11 timurhai

dlCompileAssert.h:15:55: error: ‘assertion_failed’ is not a member of ‘DlCompileAssert<false>

Seems to tell that DlCompileAssert return False but this case is not taken into account in "dlCompileAssert.h". Perhaps an error with compile_assert method. Don't known if it's arm64 or aarch64 related!

Ramel avatar Nov 09 '21 11:11 Ramel