Showing posts with label m1. Show all posts
Showing posts with label m1. Show all posts

Wednesday, April 24, 2024

learning rust; installing rustup; macchina; build redox

rust / rustup /  cargo
 
rust

the language 

https://tourofrust.com/index.html

redox os (unix-like os written in rust)

rustup

macports had to migrate, old install was on Monterey now on Ventura 13.6.6

setup steps (with brew)

Install rustup package manager first and then have rustup install rustc, cargo.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup toolchain install stable

 

the rust compiler is rustc

To clean up debug and other build files:

cargo clean

Apple Silicon Development Set up for Rust


Using Rust from Python

Pyo3

 

 

Crux

Cross-platform app development in Rust

Learn how to use Crux in your project

 

 

GUI Tool kits

slint

iced 

Tauri 2.0

  https://www.youtube.com/watch?v=rC4FCS-oMpg

  https://github.com/makepad/makepad

 
 
 
Comfy - 2d game engine in Rust/wgpu

Leaving Rust gamedev after 3 years

Miniquad/Macroquad

  Using D lang to mix C++ and Rust.

www.tipi.build

https://www.youtube.com/watch?v=z6j-lCOi4XM

Corrosion.rs c++ rust bridge


apps

warp (advanced feature terminal; requires login)

gitoxide

media

Writing an OS in Rust

  Philipp Oppermann's blog

  

Brodie interviews Jeremy Soller developer of Redox OS

Building a secure Operating System (Redox OS) with Rust (Interview)

 

https://areweguiyet.com/

zed.dev

A fast new editor to try:

zed.dev (macos, build on linux)

Configuring Rust Analyzer

 

run PopOS arm64

Reddit discussion: Installation guide for Pop!_OS (arm64) on Apple Silicon
  works great using UTM.
  Installation Guide.
 
 UTM cheat sheet

disabling GNOME

Learn Rust

 Crust of Rust by Jon Gjengset



nala install pop_OS!

apt search nala
sudo apt install nala

sudo nala install curl

## install rustup toolchain manager
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

## install rustc and cargo
rustup toolchain install stable

sudo nala install git
sudo nala install build-essential
sudo nala install clang
sudo nala install strip-nondeterminism


 

compile macchina on pop_OS!

# install macchina alt to neofetch
# https://github.com/Macchina-CLI/macchina/wiki/Installation#build-for-everything-else
#
git clone https://github.com/grtcdr/macchina
cd macchina
cargo build --release

strip target/release/macchina
cargo run --release

Build redox disk img

mkdir -p ~/tryredox
cd ~/tryredox/git clone https://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive
cd redox/
  370  make pull
  371  pwd
  372  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  373  nala search rust
  374  which rustc
  375  which cargo
  376  nala search rustc
  377  nala --help
  378  nala remove rustc
  379  sudo nala remove rustc
  380  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  381  exit
  382  which rust
  383  which rustc
  384  pwd
  385  cd tryredox/redox/
  386  make pull
  387  rustup --help
  388  cargo install --force cbindgen
  389  make pull
  390  cargo install --force nasm
  391  make pull
  392  nala search nasm
  393  nala install nasm
  394  sudo nala install nasm
  395  pwd
  396  make pull
  397  ls
  398  more build.sh
  399  ls
  400  pwd
  401  more README.md
  402  ./bootstrap.sh -d
  403  rustup toolchain list
  404  time make all
  405  ll
  406  cd build
  407  cd ..
  408  more README.md
  409  cd build
  410  ls
  411  cd x86_64/
  412  ls
  413  cd desktop/
  414  ll
  415  df -h .
  416  mount
  417  neofetch
  418  uptime
  419  sudo shutdown -h now


 
 
 

 



Sunday, September 11, 2022

Audacity 3.2.1 and libraries

Audacity 3.2.1

Tried arm64 and x86_64 both available for download.  The libraries are available in FAT binaries; works great.

 
Ignore below:

Building FFmpeg import/export library notes

Visit 2: building m1 arm64 apple silicon native ffmpeg


port install automake fdk-aac git lame libass libtool libvorbis libvpx \
opus sdl shtool texi2html theora wget x264 x265 xvid nasm
 Error: Port fdk-aac not found 
Error: Port opus not found
Error: Port sdl not found 

Error: Port shtool not found 

Error: Port theora not found



Error: Port shtool not found


Corrections:
sudo port install libfdk-aac
sudo port install libopus
sudo port install libsdl
sudo port install libtheora



sudo port install automake libfdk-aac lame libass libtool libvorbis libvpx libopus libsdl texi2html libtheora wget x264 x265 xvid nasm

  


Install shtool manually:
https://www.gnu.org/software/shtool/

 --annoying of MacPorts to drop shtool?  brew has a formula



In /Users/b____/Documents/builds/ffmpeg_src/ffmpeg-4.4

./configure

WARNING: pkg-config not found, library detection may fail.



sudo port install pkgconfig 

./configure
make

sudo make install



The binary will be installed in:

/usr/local/bin/ffmpeg

 

Success building ffmpeg but ...



Still no ffmpeg.55.64bit.dylib !?!

Let's wait for Release 3.2

 

Visit 1: Building audacity


Thursday, August 11, 2022

Solved: bootable ssd big sur m1 apple silicon

Creating bootable external ssd  macos big sur m1 apple silicon

I installed macos Big Sur 11.6.8 on an external 256GB m.2 NVME ssd connected to the Thunderbolt port on an m1 Apple Silicon machine.  I used both the standalone installer downloaded from the App Store and from macos Recovery mode (holding down the power button).

Each time install would fail at the first reboot of the installer.

The install log in the Installer gives a hint:

 bridge device not found 

Problem:
 
The ssd is bus powered; it is not powered up when the installer restarts.

Solution:

The external ssd needs an external power source.  I connected the ssd to a port on a drive dock with its own power brick.  After installation you can plug the external ssd into the Thunderbolt port again.  


In addition, remember to set your internal drive as the startup drive (Apple menu> system prefs>Startup Disk) when you disconnect your external ssd.  Your system may not start correctly if you don't set the startup disk.

This applies to macos Big Sur 11.6.8.


 

 

 



Thursday, October 14, 2021

emacs Universal build Intel x86_64 and arm64

emacs Intel, arm build

If you just want to install gnu emacs for macos and get going Emacs for MacOSX is the place to go.  

I did the builds on my early-2015 mbp with Big Sur 11.6.
  • read https://github.com/caldwell/build-emacs
  • download build scripts
 
I didn't install xcode.
xcode-select --install (installs command line tools)

install macports
sudo port install xz
./fetch-emacs-from-ftp -v ftp://ftp.gnu.org/gnu/emacs/
 
# port install xz
# if you need to convert xz to bz2
# xzcat -c emacs-27.2.tar.xz | bzip2 > emacs-27.2.tar.bz2

./build-emacs-from-tar -v emacs-27.2.tar.bz2 release 

Success:
Built Emacs-27.2-11.6-x86_64.tar.bz2, Emacs-27.2-11.6-x86_64-extra-source.tar

  • CODESIGN crash
Then I reproduced those same steps on an m1 mac mini with xcode13 installed and signed it:
  • ./combine-and-package -v --sign "Common Name" Emacs-27.2-11.6-arm64.tar.bz2 
    • replace "Common Name" with the name in the keychain access login cert.
  • see: code signing issue #103  
  • Success!  Thanks Emacs for MacOSX!
TODO:
Go back to the MBP and try the codesign step. 


 

 

 




 

Download Xcode 13 xip

Download Xcode 13 xip

I went on a search for Xcode which is on the App Store but also just downloadable:

 https://download.developer.apple.com/Developer_Tools/Xcode_13/Xcode_13.xip

Monday, September 20, 2021

Docker Alpine Linux on m1 Apple Silicon

Docker on m1 Apple Silicon

  • Get the Docker.dmg for the m1 (580 MB)
  •  Install Docker
  •  launch Docker (CLI button next to run)

Alpine Linux on Docker

  • pull down the official Alpine Linux image for Docker
  • in your docker shell cli (see above) type:
docker pull alpine 

Alpine Linux 








Tuesday, September 7, 2021

Building Audacity on m1 apple silicon

Building Audacity on m1 apple silicon

Don't bother with all the stuff below.  Audacity is now available as an arm64 m1 native binary.  The x86_64 version works great too!  Great work developers!

DONE  

Visit 1

 
  • install macports for Big Sur 11.5.2
  • sudo port install audacity
  • Success, kind of, version 2.2.2 popped out in glorious Apple Silicon binary but I couldn't get the current 3.0.4.
  • pull request BUILDING.md typo, correction:
 cmake -GXcode -T buildsystem=1 -Daudacity_use_mad="off" -Daudacity_use_id3tag=off ../audacity
 
git clone https://github.com/audacity/audacity
  •  sudo pip3 install conan   
  • activated venv using py-env
  • master v3.1.0 failed check out 3.0.4
git clone -b release-3.0.4 --single-branch https://github.com/audacity/audacity
  • cmake and Xcode

cmake -GXcode -T buildsystem=1 ../audacity 

open Audacity.xcodeproj

  • rm -rf build/*
  • run cmake again:
 cmake -GXcode -T buildsystem=1 -Daudacity_use_mad="off" -Daudacity_use_id3tag=off ../audacity
 

 

 DO

 Using python3 venv virtual environment:

 BLOCKED 

  • conan install failing(use py-env)
  • source blocked for m1 compile; 
  • downloaded branch beta 12.2 wxwidget not included
  • wxwidget build error
  • Xcode does not build master branch 3.1.0 or 3.0.4
  • 3.0.4 builds then crashes immediately (Intel)
 

First, doing anything on an external USB3 hard drive is painfully slow compared to the blisteringly fast internal ssd.  macports took over an hour to install.

I think macports is finally falling behind since most sites talk about brew (meh). Macports has been working great so far.

I wish m1 virtual machine time was 3cents/hr
 
 

Info 

 



 

Friday, August 13, 2021

Apple m1 Big Sur 11.5.2 update

macos Big Sur 11.5.2: Large update 

took longer than I thought it would

Updated my 2020 Apple m1 mac mini model A2348 with Big Sur 11.5.2
  • mystery update no release notes
  • see the excellent eclecticlight blog for more info
  • blaaaaarrgh whaaaaaaa: the update bar on reboot looked frozen. ugh. Five minutes later the text appeared with a time estimate, whew!
  • please can't some big brains at apple reduce the SIZE of these updates? How about 300MB?
  • RESULT: everything seems fine so far
  • Relocated Items folder: /etc/group trustd 282
  • Get rid of Other user on login screen; how to hide other users