sacd-ripper icon indicating copy to clipboard operation
sacd-ripper copied to clipboard

sacd_extrackt arm64

Open antonellocaroli opened this issue 4 years ago • 9 comments

would you be able to adapt the configuration and build files so that arm64 and arm build is also possible?

as setmind did

https://github.com/setmind/sacd-ripper

antonellocaroli avatar Apr 05 '20 22:04 antonellocaroli

I think we just need to change this part:

Extra flags for GCC

if (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang")) add_definitions( -pipe -Wall -Wextra -Wcast-align -Wpointer-arith -O3 -Wno-unused-parameter -msse2 xml2-config --cflags --libs) endif (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))

in

STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER) if(NOT CMAKE_BUILD_TYPE_UPPER STREQUAL "DEBUG") if (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang")) add_definitions( -pipe -Wall -Wextra -Wcast-align -Wpointer-arith -O3 -Wno-unused-parameter) endif () if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm*") add_definitions( -msse2) endif () endif ()

antonellocaroli avatar Apr 06 '20 07:04 antonellocaroli

anyway then comes to this error

[ 97%] Building C object CMakeFiles/sacd_extract.dir/tmp/sacd-ripper/libs/libsacd/scarletbook_xml.c.o /tmp/sacd-ripper/libs/libsacd/scarletbook_xml.c:5:10: fatal error: libxml/xmlreader.h: No such file or directory 5 | #include <libxml/xmlreader.h> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.

antonellocaroli avatar Apr 06 '20 08:04 antonellocaroli

Dear Antonello, Sorry for late response, but I had no spare time. Thanks for your interest ! I think the cause is LIBXML2 library. I use this library for exporting all metadate in xml format. Changed CMakeLists.txt and main.c to compile without libxml2 (only for ARM processors).

EuFlo avatar May 26 '20 06:05 EuFlo

Buonasera @antonellocaroli ,

could you try again to compile on ARM hardware.

For Linux on RPis you need to install the following dependency:

sudo apt install libxml2-dev

Regards,

ArminiusTux

ArminiusTux avatar Jul 06 '20 18:07 ArminiusTux

I finally managed to build for arm64 on M1 Mac: I transformed the cmake project into Xcode with:

cd path to tools/sacd_extract
cmake -G Xcode

In Xcode you can see generated errors more easily, I added two frameworks Built phase > Link binaries with library: libiconv.tbd and libxml2.dylib

In Build Setting > Apple Clang Custom Compiler flags > other flags > debug remove

` xml2-config --cflags --libs`

see also https://stackoverflow.com/questions/7464851/libiconv-not-linking-to-ios-project/72529004#72529004?newreg=c7bf51997d98451e99b9dc926892c5a7

crismi2 avatar Sep 23 '23 08:09 crismi2

The last working version for me on M series Mac is MrWicked's 0.3.6 - is there a newer server side that I need for your client? When I try to compile, I get a bunch of alignment errors and it will not link. I wonder if the packed structs need a bit of rethinking? I also noticed that mkdir is configured with a char* 2nd parameter instead of a mode_t (int). I'm honestly not sure where to start with the alignment issues, it's been a while since I coded in C and this seems to be a side-effect of clang, 64bit registers and ARM CPUs. I have tried to compile with GCC, clang and zig cc and none of them are successful.

fayep avatar Aug 08 '24 03:08 fayep

A) Try to build on your macOS Mx/Apple Silicon using brew and cmake:

xcode-select --install /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install cmake git clone https://github.com/EuFlo/sacd-ripper.git cd sacd-ripper/tools/sacd_extract cmake . make

B) where did you spotted that mkdir configured with a char* 2nd param ? C) There is no newer server. No needed. This commit - 117 of sacd_extract client- solve an incompatibility on macOS Sonoma 14.4/14.5.

EuFlo avatar Aug 09 '24 05:08 EuFlo

I have tried to compile with GCC, clang and zig cc and none of them are successful.

Hello Fayep! Have you tried again to compile using the above A) instructions?

EuFlo avatar Aug 27 '24 08:08 EuFlo

Hi, sorry for taking a while to get back to you. I updated my XCode and that seems to have fixed everything. Compiled first time. Thanks.

fayep avatar Sep 03 '24 21:09 fayep