Description
After getting a nice new M1 mac this Christmas it was time to install my favorite pieces of software which includes the Xictools circuit simulator toolkit. I'm installing on a Mac so the first step was to install the gtk bundle from macports. This step worked fine out of the box, /usr/local/gtk2-bundle-X11/bin is filled with POSIX scritpt executables and arm64 binaries that all seem to work, hurray! Now for the issues, when you run make all in the xictools project the following things happen,
-
Weird shell script #! issue: The build is configured you see a lot of: ../../../vl/version:1:2: error: invalid preprocessing directive
#! /bin/sh
^
errors followed by numerous cascading errors. Somehow gcc is seeing a shell script command and attempting to parse it. Not sure how this crept up or in which file(s) its occurring. -
To arm or not to arm: The arch for darwin is hard coded as x86_64 in the config.in which is no longer a good assumption. In fact unless you changed your system arch to x86_64 when you made the gtk bundle you will be linking x86_64 against arm64 which won't work. I had to manually set the arch to arm64 to clear this set of errors. The config.in file should be updated to ask a Darwin user if they want to compile for x86 or arm.
-
Related to 2, code that relies on intel SSE intrinsics won't work: In FastHenry we get a lot of /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
errors. Since FastHenry is a standalone program (which I don't need actually) it could be compiled as x86_64 and then run via Rosetta. Not sure how baked in the SSE intrinsics are to FastHenry and if they can switched over to a metal implementation for mac.