EuFlo / sacd-ripper

SACD ripping software using a PS3
GNU General Public License v2.0
116 stars 20 forks source link

sacd_extrackt arm64 #1

Open antonellocaroli opened 4 years ago

antonellocaroli commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.

EuFlo commented 4 years ago

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).

ArminiusTux commented 4 years ago

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

crismi2 commented 11 months ago

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

fayep commented 1 month ago

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.

EuFlo commented 4 weeks ago

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 commented 1 week ago

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?

fayep commented 3 days ago

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.