LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
256 stars 77 forks source link

osx bigsur M1 support? #246

Closed stereo3d closed 3 years ago

stereo3d commented 3 years ago

is there any possibility to get ltfs on Apple Silicon M1?

piste-jp commented 3 years ago

Sorry, I don't have any M1 machine. So I can't say it is possible.

But I assume we can support if if the conditions below are met.

piste-jp commented 3 years ago

Please reopen when there is an issue on M1 machine.

stereo3d commented 3 years ago

MacOS Fuse now supports M1 since version 4.1.0 I try to build on OSX Mac Mini with Big Sur 11.2.4 M1 silicon

% brew cask install osxfuse Error: Unknown command: cask corrected the command from the instructions: brew install --cask osxfuse

homebrew is downloading an old osxfuse: Downloading https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.1

I manually Installed downloaded pkg of 4.1.0 in dmg

followed the instructions for install on mac osx:

export ICU_PATH="/usr/local/opt/icu4c/bin"
export LIBXML2_PATH="/usr/local/opt/libxml2/bin"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
export PATH="$PATH:$ICU_PATH:$LIBXML2_PATH"

./autogen.sh
LDFLAGS="-framework CoreFoundation -framework IOKit" ./configure --disable-snmp
make

after that the process ends with multiple errors: here is the end of the output:

64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/lib/libicudata.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../../messages/liblibltfs_dat.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file ../../messages/libinternal_error_dat.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file ../../messages/libtape_common_dat.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
Undefined symbols for architecture arm64:
  "_bin_mkltfs_dat", referenced from:
      _main in mkltfs-mkltfs.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [mkltfs] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
alarix@mmm1 ltfs % 
piste-jp commented 3 years ago

It looks object file created by the ICU is for amd64, in other words for x86_64.

The message resource bundle is created by the ICU and provided as the object code. And he linker links it as same as the object code. But the linker said the file looks the object of x86_64.

From the log below, your ICU module is for x86_64 not arm64 and utilities of the ICU is running on the Rosetta 2. So the binaries created by the ICU (macOS-x86_64) is for x86_64.

ld: warning: ignoring file /usr/local/lib/libicudata.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64

I think you need to install the ICU binaries for amd64 somehow.

stereo3d commented 3 years ago

Dear @piste-jp-ibm many thanks you for the hint. I will find out what I can do and keep you updated.

stereo3d commented 3 years ago

i reinstalled ICU4C

...
==> Pouring icu4c-68.2.arm64_big_sur.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"' >> ~/.zshrc

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"

For pkg-config to find icu4c you may need to set: export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig"

I addesdpath to my zshrc shell I did

source ~/.zshrc

i forced linking:

brew link --force icu4c
Warning: Refusing to link macOS provided/shadowed software: icu4c
If you need to have icu4c first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"' >> ~/.zshrc

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig"
alarix@mmm1 ltfs % 

I added the path to the config command, the path in the manual are different from what homebrew recommends:

LDFLAGS="-framework CoreFoundation -framework IOKit -L/opt/homebrew/opt/icu4c/lib" CPPFLAGS="-I/opt/homebrew/opt/icu4c/include" ./configure --disable-snmp

I still get errors related to the architecture and also icu. I attache config outputs and make outputs for your information. Please let me know if you have any iddication what I should try.

m1_configure.log m1_make_output.log m1_make.log

piste2750 commented 3 years ago

@uwe22 , I would like to make a comment from my personal ID.

The ICU is still built for x86_64. I think you just install it with brew install icu and the home-brew has the precompiled binary only for x86_64.

You might need to install the ICU with --enable-bar option to build it from the source. (See https://docs.brew.sh/FAQ)

ld: warning: ignoring file /usr/local/lib/libicui18n.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/lib/libicudata.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file /usr/local/lib/libicuuc.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
stereo3d commented 3 years ago

dear @piste2750 I really appreciate your support. I tried your advice. It seems --enable-bar is not supported in this case, also icu is not found by homebrew, it suggests to install instead icu4c since it has the most similar name.

I managed to make homebrew compile by adding the option: --build-from-source

brew install --build-from-source icu4c
==> Downloading https://github.com/unicode-org/icu/releases/download/release-68-
Already downloaded: /Users/alarix/Library/Caches/Homebrew/downloads/f9101dc8dedeffd29c43df0042f53e616a8ef85354be59a88b3fdbe1e5be9b9d--icu4c-68_2-src.tgz
==> ./configure --prefix=/opt/homebrew/Cellar/icu4c/68.2 --disable-samples --dis
==> make
==> make install
==> Caveats
icu4c is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/icu4c/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/icu4c/sbin:$PATH"' >> ~/.zshrc

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig"

==> Summary
🍺  /opt/homebrew/Cellar/icu4c/68.2: 259 files, 73MB, built in 59 seconds

As I try to continue following the instructions, autoghen.sh fails. I have submitted a different issue for this case. Thank you for your kind support and suggestions.