Voila le script nwmac amélioré (à nommer "nwmac.sh" d'ailleurs, ça serait mieux), qui installe les choses un peu mieux, et qui s'arrête en cas d'erreur :
- Code: Select all
#!/bin/bash
set -e
if [[ $(command -v brew) == "" ]]; then
echo "Installing (native) Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Native Homebrew has been detected, make sure it's been updated recently!"
fi
if [[ ! -x "/usr/local/bin/brew" ]] && [[ $(uname -m) == "arm64" ]]; then
echo "Installing x86_64 Homebrew..."
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Installing build dependencies..."
brew install python-setuptools numworks/tap/epsilon-sdk libpng gmp mpfr mpfi
if [[ $(uname -m) == "arm64" ]]; then
arch -x86_64 /usr/local/bin/brew install libpng gmp mpfr mpfi
fi
echo "Cloning sources..."
cd /tmp
rm -rf epsilon
git clone --depth 1 https://github.com/parisseb/epsilon
cd epsilon
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/ext.tar.bz2
tar xfj ext.tar.bz2
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/nwsimu.tgz
tar xfz nwsimu.tgz
echo "Building..."
./mkmac
echo "Moving things into place..."
wget https://www-fourier.univ-grenoble-alpes.fr/~parisse/khi92.tar
mv khi92.tar ~/Documents/scripts.tar
mv output/release/simulator/macos/epsilon.app /Applications
echo "epsilon.app is now available in /Applications/"
open /Applications/epsilon.app
Et aussi, merci de rajouter
-j
ou au moins
-j4
aux appels de "make" dans "mkmac", parce que sinon ça prend vraiment trop de temps...
----
Ensuite, en fonction de son environnement, il peut y a des problèmes d'install / conflits, par exemple, et c'est sans doute ça qui peut tout faire foirer par la suite, donc ne pas hésiter à faire un peu de ménage auparavant... (perso, j'avais plusieurs installs de arm-none-eabi-gcc etc.)
Côté khicas, il y a pas mal de warnings de macros/defines re-définis qui encombrent le terminal, il faudrait sûrement corriger ça.
----
Bref, quand ça arrive au link, ça erreur de mon côté :
- Code: Select all
LD epsilon.bin
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ [... tous les fichiers .o ...] -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -mmacosx-version-min=10.10 -weak_framework Metal -weak_framework QuartzCore -framework CoreAudio -framework CoreVideo -framework Cocoa -framework IOKit -framework CoreFoundation -framework Carbon -framework ForceFeedback -framework AudioToolbox -rdynamic -o output/release/simulator/macos/arm64/epsilon.bin
Undefined symbols for architecture arm64:
"_c_det", referenced from:
_linalg_det in graphic.o
"_c_draw_arc", referenced from:
_graphic_draw_arc in graphic.o
"_c_draw_circle", referenced from:
_graphic_draw_circle in graphic.o
"_c_draw_filled_arc", referenced from:
_graphic_draw_filled_arc in graphic.o
"_c_draw_filled_circle", referenced from:
_graphic_draw_filled_circle in graphic.o
"_c_draw_filled_polygon", referenced from:
_graphic_draw_polygon_ in graphic.o
"_c_draw_line", referenced from:
_graphic_draw_line in graphic.o
"_c_draw_polygon", referenced from:
_graphic_draw_polygon_ in graphic.o
"_c_draw_rectangle", referenced from:
_graphic_draw_rectangle in graphic.o
"_c_draw_string", referenced from:
_graphic_draw_string in graphic.o
"_c_draw_string_medium", referenced from:
_graphic_draw_string in graphic.o
"_c_draw_string_small", referenced from:
_graphic_draw_string in graphic.o
"_c_egv", referenced from:
_linalg_egv in graphic.o
"_c_eig", referenced from:
_linalg_eig in graphic.o
"_c_fft", referenced from:
_linalg_fftifft in graphic.o
"_c_fill_rect", referenced from:
_graphic_clear_screen in graphic.o
_graphic_fill_rect in graphic.o
"_c_inv", referenced from:
_linalg_inv in graphic.o
"_c_pcoeff", referenced from:
_linalg_pcoeff in graphic.o
"_c_proot", referenced from:
_linalg_proot in graphic.o
"_c_rref", referenced from:
_linalg_rref in graphic.o
"_c_set_pixel", referenced from:
_graphic_set_pixel in graphic.o
"_caseval", referenced from:
_cas_caseval in graphic.o
_turtle_forward in graphic.o
_turtle_backward in graphic.o
_turtle_left in graphic.o
_turtle_pensize in graphic.o
_turtle_right in graphic.o
_turtle_reset in graphic.o
...
"_console_input", referenced from:
_mp_hal_input in port.o
"_console_output", referenced from:
_mp_hal_stdout_tx_strn_cooked in port.o
"_ext_main", referenced from:
Home::Controller::handleEvent(Ion::Events::Event) in controller.o
run_external_main() in external_apps.o
"_flash_filebrowser", referenced from:
_os_file_browser in port.o
"_flash_read", referenced from:
_filesize in port.o
_read_file in port.o
"_os_get_pixel", referenced from:
_graphic_get_pixel in graphic.o
"_sync_screen", referenced from:
_graphic_show_screen in graphic.o
"_turtle_freeze", referenced from:
_turtle_forward in graphic.o
_turtle_backward in graphic.o
_turtle_left in graphic.o
_turtle_pensize in graphic.o
_turtle_right in graphic.o
_turtle_reset in graphic.o
_turtle_dessine_tortue in graphic.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Pareil sur les 2 archs.
(Au passage, il y a aussi
was built for newer 'macOS' version (14.0) than being linked (10.10)
pour la libgiac, il faudrait surement passer le bon flag pour mettre la target a 10.10 (ou alors pas la mettre du tout, nulle part))