Installation of PyHarm with pip#
On Linux (x86_64), macOS (x86_64, ARM64) and Windows (x86_64), install PyHarm using the command:
pip install pyharm
This will install PyHarm and all the dependencies, most notably the C library CHarm, which is internally called by PyHarm.
The CHarm binaries were compiled using the following settings.
gcccompiler on Linux,clangon macOS andMSVCon Windows.--enable-double-precisionto compile in double precision.--enable-openmpto enable parallelization among CPU cores.On x86_64 CPUs,
--enable-avxto enable SIMD parallelism using the AVX instruction sets of x86_64 CPUs. AVX has been with us for more than 10 years now, so the binaries should run on any reasonably old CPU. Should you get an error likeIllegal instruction, this means your CPU does not support AVX. In that case, you have to build PyHarm from source and avoid using any set of AVX instructions (see Building from source).On 64-bit ARM CPUs,
--enable-neonto enable SIMD parallelization using the NEON instruction set. NEON instructions should be supported by all ARM64-based MacBooks.-O3 -ffast-math -Wall -Wpedanticcompiler flags on Linux and macOS and/O2 /fp:fast /FS /GLon Windows to optimize the library for best performance. Importantly, you should be aware that-ffast-mathand/fp:fastrelax some rules on floating point arithmetics in favour of gaining some additional computing speed. As a result, the accuracy may be slightly worse than when not using these flags. Normally, however, one does not need to bother by this. Should you need compliance with the IEEE specifications, compile the library on your own without these flags.--enable-mpfrto enable spatially restricted spectral gravity forward modelling.--enable-pythonto build the PyHarm wrapper.
Tip
All this information is also available directly from PyHarm by calling:
>>> import pyharm as ph >>> ph.misc.print_info()
This will print some useful compilation details about your particular PyHarm build.