Investigate x86_64h architecture for Intel builds

changes to the build

Run cmake with the following additional setting:

-DCMAKE_OSX_ARCHITECTURES=x86_64h
original text These are build optimizations specific to the macOS architecture on genuine Apple hardware.

Obtain the Inkscape repository and configure for building type Release on macOS. Notice configuration flag for CMAKE_OSX_ARCHITECTURES is intentionally left blank.

Determine system architecture by executing machine from a terminal window prompt. Record return value (on my mid-2015 MacBook Pro) of % machine: Gives type x86_64h

NPJ@Nathans-MacBook-Pro ~ % machine x86_64h

Read entry on % man arch and note Apple hardware architectures, to wit:

"The arch_name argument must be one of the currently supported architectures: i386 32-bit intel x86_64 64-bit intel x86_64h 64-bit intel (haswell) arm64 64-bit arm arm64e 64-bit arm (Apple Silicon) If the binary does not contain code for arch_name, the arch command may try to select a close match. If arm64 is specified and not found, arm64e will be tried next. If this happens, the order the architectures will be tried is not guaranteed."

When configuring as Unix Makefile, set the CMAKE_OSX_ARCHITECTURES equal to: "x86_64;x86_64h" for Intel based builds or "arm64;arm64e" for Silicon builds. Initally pass to cmake with the flag -DCMAKE_OSX_ARCHITECTURES="(arch_name)"

Also pass initially or set and verify the following entries: CMAKE_BUILD_TYPE=Release MAKE_OSX_DEPLOYMENT_TARGET=12.6 WITH_OPENMP=ON CMAKE_CXX_FLAGS_RELEASE=-Ofast -DNDEBUG -march=native -ffast-math -finline-functions CMAKE_C_FLAGS_RELEASE=-Ofast -DNDEBUG -march=native -ffast-math -finline-functions

Verify that OpenMP values are set based on compiler (should populate if dependencies met): OpenMP_CXX_FLAGS=-Xclang -fopenmp OpenMP_CXX_INCLUDE_DIR="/opt/local/include" (will be based on library location, this is using MacPorts) OpenMP_CXX_LIB_NAMES=libomp OpenMP_C_FLAGS=-Xclang -fopenmp OpenMP_C_INCLUDE_DIR=/opt/local/include (ibid.) OpenMP_C_LIB_NAMES=libomp OpenMP_libomp_LIBRARY=/opt/local/lib/libomp.dylib (ibid.)

Correct for any errors or provide for missing dependencies. Configure. Generate.

Build in this order for first time using basic (and slightly redundant) sequence: % nice -n 0 /usr/bin/arch -64 -x86_64h make -Bik -j2 % nice -n 0 /usr/bin/arch -64 -x86_64h make tests % nice -n 0 /usr/bin/arch -64 -x86_64h make install % nice -n 0 /usr/bin/arch -64 -x86_64h make check

Thereafter, issue 'git pull' from source repository; 'cd' to build directory, and: % nice -n 0 /usr/bin/arch -64 -x86_64h make-j2 % nice -n 0 /usr/bin/arch -64 -x86_64h make tests % nice -n 0 /usr/bin/arch -64 -x86_64h make install % nice -n 0 /usr/bin/arch -64 -x86_64h make check

Verify installation: % which inkscape /usr/local/bin/inkscape

Verify version: % inkscape --version Inkscape 1.3-alpha (inkscape@1a95b517, 2023-04-02)

Create target using low level debugger to verify architecture: % lldb inkscape (lldb) target create "inkscape" Current executable set to 'inkscape' (x86_64h).

If successful, the target architecture will be reported as (x86_64h) on Intel-based machines. Otherwise, if it reports (x86_64) this indicates the instance is valid for the architecture, but has not been not optimized for running on genuine Intel-based Apple hardware as described.

Launch executable by typing letter 'r' and pressing <enter/return> key, and >>> wait:

  1. (lldb) r <enter/return>

Process 46655 launched: '/usr/local/bin/inkscape' (x86_64h) 2023-04-02 09:54:06.828167-0600 inkscape[46655:305208] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=46655 2023-04-02 09:54:06.828288-0600 inkscape[46655:305208] SecTaskCopyDebugDescription: inkscape[46655]/0#-1 LF=0

While that starts, open a new Terminal window or tab to monitor the running Process ID (pid) of Inkscape:

  1. Adjust window to fit the maximum screen width and place at bottom, top, or where desired for visibility.
  2. Adjust font size for p: press (command) + (+) to make larger or (command) + (-) to make smaller
  3. Use the PID assigned by the kernel when launched by lldb (above) to run a top command with nice
  4. From the Terminal window prompt, start monitoring with the command: % nice top -u -pid 46655 -c n

Allow access to requested volumes, folders, etc. as may be prompted by the operating system.

  1. Pause until Welcome Screen for Inkscape is presented on screen.
  2. Select "Quick Setup" tab > make any desired adjustments > press "Save" button in lower right.
  3. Press "Thanks!" button in lower right corner of "Supported by You" tab.
  4. Select preferred "Time to Draw" template or file, then press "Open" or "New Document" to proceed.

Allow access to requested volumes, folders, etc. as may be prompted by the operating system.

  1. Wait for Inkscape GUI to be presented on screen.
  2. Click "inkscape" or "Inkscape" from top menu bar to immediate right of the Apple Icon in upper left.
  3. Select menu option to display "About inkscape" or "About Inkscape" and wait for About Screen to load.

Press button at bottom of About Screen giving tooltip: "Click to copy the version number to the clipboard".

  1. Compare and validate that value matches what was returned from command-line "% inkscape --version"
  2. To wit: "Inkscape 1.3-alpha (inkscape@1a95b517, 2023-04-02)"

Press red bug icon at far right bottom of About Screen giving tooltip: "Click to copy debug information to clipboard".

  1. Paste into new Issue as asked, and proceed to create new issue on GitLab, or just leave on clipboard.
  2. To wit, contents copied to clipboard by pressing bug button for report are given when pasted as text:

Inkscape 1.3-alpha (inkscape@1a95b517, 2023-04-02)

GLib version:     2.70.5
GTK version:      3.24.34
glibmm version:   2.62.0
gtkmm version:    3.24.2
libxml2 version:  2.10.3
libxslt version:  1.1.37
Cairo version:    1.17.6
Pango version:    1.50.7
HarfBuzz version: 6.0.0

OS version:       macOS

Close About Screen window. If using local/self-produced build, window will close.

  1. If using signed DMG build downloaded from Inkscape web site, About Screen window will NOT close.
  2. Make new report(s) or open new issue as instructed or discovered ...

Click "inkscape" or "Inkscape" from top menu bar to right of Apple Icon ... Wait for floating dialog window to open, with Preferences tab selected by default.

  1. From left pane of Preferences window, select next to last option at bottom: "Rendering"

  2. Set Number of Threads to use default value of 0, or increment to maximum (32 on mine)

  3. Set Rendering Cache size to default value of 512, or increment to maximum (4096 on mine)

  4. Set "Gaussian blur quality for display" to "Best" or "Better" or leave at default "Average"

  5. Set "Filter Effects quality for display" to "Best" or leave at default of "Better"

  6. Optionally, check "Developer mode" box to "Enable Developer Mode" or leave at default unchecked

  7. From left pane of Preferences window, select fourth option up from bottom: "System"

  8. Press "Reset Preferences" if this is a newer version replacing an older version.

  9. Check settings and paths - make additions to include path to any "Custom Font directories"

  10. Make any additional desired adjustments from options in Preferences window ...

  11. Configure options in "Interface" > "Theming" like: "Use dark theme" ...

  12. Configure options in "Interface" > "Windows" like: "Show Welcome dialog" ...

  13. Continue to configure options in Preferences window as desired, and close tab: Preferences.

testing

Examine the rendering performance of Inkscape by opening and exporting this 11.3MB SVG file:

  1. Open the attached SVG file (or use the provided URL to download a copy separately)
  2. Use the Inkscape GUI, and choose File > Export dialog to export it as a 96dpi PNG.
  3. Watch the output of top to see if multiple-threads/multiple-cores are being used?
  4. Take note of the memory, disk I/O, and CPU time to produce the resulting PNG file
  5. Open the exported PNG file using "inkview" (provided with "inkscape") and scroll.

Examine the performance by exporting the SVG to a PNG using only the command line interface.

pictures are in here Inky-1.3-alpha_macOS-x86_64

HTTP URL: [ http://npj.com/opensource/inkscape/1.3alpha/RdH-inky/ ]

LightHouse-D03_Inky13-alpha-x86_64.svg link removed as it produces massive lag

test protocol

Artifacts have been created from what has been released as 1.3alpha0 for macOS (inkscape@95f74fbf).

hw sw arch cmd real user sys
MBP 15 Mid-2015 4870HQ on battery 10.13 x86_64 time inkscape -o ~/export.png -C -w 1920 -h 1080 ~/lighthouse.svg 17m51.914s 33m43.820s 0m16.273s
x86_64 18m20.717s 34m16.336s 0m16.401s
x86_64 17m49.763s 33m46.377s 0m18.523s
x86_64h 19m11.349s 35m41.790s 0m17.267s
x86_64h 19m14.809s 35m46.385s 0m17.707s
x86_64h 19m40.166s 38m33.793s 0m24.921s
Edited by René de Hesselle