Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2021-12-01 21:45:46



Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3, 4  Next
ARM64 port (was: Porting Difficulties) 
Author Message

Joined: 2009-03-17 18:42:51
Posts: 4774
Reply with quote
Good news !

For the architecture detection in cmake, just replace the "set(ARCH x86_64)" line in indra/cmake/Variables.cmake with:
Code:
# Only 64 bits builds are now supported, for all plateforms.
# *TODO: support for cross-compilation on a different build architecture ?
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "AMD64")
   set(ARCH x86_64)
elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "aarch64*" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm64*")
   set(ARCH arm64)
else ()
   message(FATAL_ERROR "Unsupported architecture ${CMAKE_HOST_SYSTEM_PROCESSOR}, sorry !")
endif ()
message(STATUS "Architecture to build for: ${ARCH}")


Then you can make everything architecture-specific depend on ${ARCH} tests in the cmake files, such as in indra/cmake/Boost.cmake, where, instead of the 'set(ARCH_SUFFIX "-a64")' I suggested above, you can use:
Code:
include(Variables)

if (${ARCH} STREQUAL "x86_64")
   set(ARCH_SUFFIX "-x64")
elseif (${ARCH} STREQUAL "arm64")
   set(ARCH_SUFFIX "-a64")
endif ()


The above two changes have already been included for next release.


2021-08-20 10:34:54
Profile WWW

Joined: 2021-08-18 09:56:48
Posts: 22
Reply with quote
Ran into issue when trying to build my cleaned up non system libs version... can't find the following libs and by this I mean you don't appear to have them and I can't find the linden versions:
gstreamer
libelfio
libuuid


2021-08-20 17:42:18
Profile

Joined: 2009-03-17 18:42:51
Posts: 4774
Reply with quote
bjbdragon wrote:
Ran into issue when trying to build my cleaned up non system libs version... can't find the following libs and by this I mean you don't appear to have them and I can't find the linden versions:
gstreamer
This one is a header-only version. There is no library linked to the plugins: the gstreamer libraries are dynamically loaded at runtime. Just use the same pre-built package as for Linux x86_64 builds.
Quote:
libelfio
Also a header-only version (ELFIO is entirely implemented in headers: no library at all involved). Same thing: use the pre-built package provided for Linux x86_64 builds.
Quote:
libuuid
This library is part of any Linux distribution (but is needed at link time, and since it is not guaranteed that the user will have libuuid-devel (i.e. the header and libuuid.so file) installed when building the viewer, I provide it as pre-built package). Just package it manually (library files + header) in the same way as what I did for Linux x86_64, using your distro files.


2021-08-20 17:58:36
Profile WWW

Joined: 2021-08-18 09:56:48
Posts: 22
Reply with quote
Thanks, that worked! How can I generate a patch so that you can look over and see if things look clean? Will of course have to wait until I get a successful compile.


2021-08-20 18:28:13
Profile

Joined: 2009-03-17 18:42:51
Posts: 4774
Reply with quote
bjbdragon wrote:
Thanks, that worked! How can I generate a patch so that you can look over and see if things look clean?
This is explained here. :)


2021-08-20 19:34:41
Profile WWW

Joined: 2021-08-18 09:56:48
Posts: 22
Reply with quote
These changes seem to build cleanly with minimal alterations to the actual viewer sources... the bulk of this diff file is the sse2neon.h code, making it too large to attach to the forum. Please let me know what you think of these changes.

http://muckdragon.info/coolvlviewer/arm64-build-patches.txt


2021-08-21 00:59:31
Profile

Joined: 2009-03-17 18:42:51
Posts: 4774
Reply with quote
bjbdragon wrote:
These changes seem to build cleanly with minimal alterations to the actual viewer sources...
Great job, thank you ! :D

Quote:
the bulk of this diff file is the sse2neon.h code
In fact, that header shall be downloaded as a "pre-built" package, when needed (i.e. for arm64 builds only) and not be made part of the viewer sources (which may only contain external sources common to all OSes/architectures for components which have been modified specifically for the viewer; e.g. OpenGL hearders, OpenJPEG, json-cpp, phmap).

Quote:
Please let me know what you think of these changes.
Good looking. I made the following changes:

  • Made sse2neon.h into a pre-built library package that goes into the viewer general include/ directory, allowing to include that header from anywhere (e.g. OpenJPEG sources) without the need to make anything dependent on llcommon.
  • Reshuffled the optimization options in 00-Common.cmake, also added "-march=armv8-a+fp+simd" to C and C++ build flags for arm64 builds, as mandated in the "Usage" section of the sse2neon.h README file. Let me know whether this works for your builds or if inappropriate, but to me, it looks like omitting these flags would result in an un-optimized (and thus slower) arm64 build...
  • Proper FMOD Studio enablement/disabling.
  • Reinstated 32 bits x86 builds forbidding logic.
  • Minor cleanup and coding conventions fixes.
  • Added copyright and credits: please let me know if you wish to be credited under another name than your "bjbdragon" login name on this forum...

Here is the amended patch, please let me know if it allows to compile the viewer fine on your side: EDIT: removed, used the v2 patch in the message below.


2021-08-21 12:34:46
Profile WWW

Joined: 2021-08-18 09:56:48
Posts: 22
Reply with quote
This breaks early in the build, because for some reason the "prebuilt" sse2neon.h hasn't been pulled by the time libopenjpeg tries to compile:

/home/ruuko/src/linden/indra/libopenjpeg/dwt.c:35:11: fatal error: sse2neon.h: No such file or directory
# include "sse2neon.h"
^~~~~~~~~~~~
compilation terminated.
/home/ruuko/src/linden/indra/libopenjpeg/mct.c:33:11: fatal error: sse2neon.h: No such file or directory
# include "sse2neon.h"
^~~~~~~~~~~~
compilation terminated.


2021-08-21 15:22:04
Profile

Joined: 2021-08-18 09:56:48
Posts: 22
Reply with quote
Additionally, you accidentally entered "amd64" which should be "arm64". But, this change is not enough and libopenjpeg build is not even looking at our linden/include directory.

# SSE2 to Neon conversion header is needed for arm64 builds
if (ARCH STREQUAL "amd64")
use_prebuilt_binary(sse2neon)
endif ()

Also, and this does not seem related to my patching at all.. there is a bunch of garbage created by a libuuid download.

rockpro64:~/src/linden$ ls
LICENSES install.xml linux-build viewer-linux-aarch64-release
bin install.xml.orig linux-build.sh windows-prebuild.bat
doc installed.xml macos-prebuild.sh
include lib python
indra libuuid-1.3.0-linux64-20180312.tar.bz2 scripts


2021-08-21 15:30:23
Profile

Joined: 2009-03-17 18:42:51
Posts: 4774
Reply with quote
Well, yes, just a typo, and a missing include_directories() directive in indra/libopenjpeg/CMakeLists.txt...

This new patch should work: EDIT: removed. Get patch v3 in next message...

As for the "garbage", it's not any garbage, but just the unpacked pre-built packages stuff and necessary build items. You can zap them with './linux-build.sh -z' to return to a clean sources tree state.


2021-08-21 15:54:53
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 38 posts ]  Go to page Previous  1, 2, 3, 4  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.