Add support for macOS:
* bugfix(exprtk): Upgrade verison of exprtk to fix compile error in clang.
* refact: Remove `bits/stdc++.h` and move `src/codegen/cpp.cpp::replace_all` to `include/picker.hpp::str_replace_all`
* feat: Use `dlopen` for non-linux platform.
* fix: Add missing headers
* fix(nproc): Fix bug of missing `nproc` in MacOS
* refactor(python): Adapt python template to macOS
* refactor(mem_direct): Adapt mem_direct template to macOS
* refactor(lib_suffix): Add shared library suffix in code generator
* refactor(dut_base.cpp): Use code generator to set library suffix
* add(cpp): Add cpp support for macOS
* add(java): Add java support for macOS
* refactor(nproc): Set $NPROC to support macOS
* fix(parser/sv): Add missing header file `unordered_set`
* fix(python_macos): fix the wrong suffix of module-type library
* refactor(codegen/lib): generator template use absolute path
* fix(mem_direct): fix link error in macOS
* feat: Use LLVM Clang to compile instead of AppleClang
* feat(golang): Add golang support for macOS
* fix(rpath): fix CMAKE_BUILD_RPATH for macOS
* feat(lua): Add lua support for macOS
* fix(scala): Fix wrong use of static method in scala
* feat(scala): Add scala support for macOS
* refactor(cmake): Upgrade cmake version to 3.15
* feat(doc): Add doc about installing picker on macOS
Modify the selection logic for `CMD_VERILATOR_ROOT` in `verilator.cmake`.
When using a Verilator distribution that is not installed from a package manager or compiled from source, such as the one provided by [oss-cad-suite](https://github.com/YosysHQ/oss-cad-suite-build), the output of `verilator -V` can be as follows:
```bash
Summary of configuration:
Compiled in defaults if not in environment:
SYSTEMC =
SYSTEMC_ARCH =
SYSTEMC_INCLUDE =
SYSTEMC_LIBDIR =
VERILATOR_ROOT = /yosyshq/share/verilator
SystemC system-wide = 0
Environment:
MAKE =
PERL =
PYTHON3 =
SYSTEMC =
SYSTEMC_ARCH =
SYSTEMC_INCLUDE =
SYSTEMC_LIBDIR =
VERILATOR_BIN =
VERILATOR_ROOT = /opt/oss-cad-suite/share/verilator
```
This output provides two `VERILATOR_ROOT` paths. The one under the `Environment` section is the intended path for this setup.
The previous selection logic would incorrectly choose the first `VERILATOR_ROOT` it found, which was the incorrect one from the `Compiled in defaults` section.
This patch updates the logic to prioritize the `VERILATOR_ROOT` from the `Environment` section. It will only fall back to the `Compiled in defaults` path if the environment one is not available.
picker will find VERILATOR_ROOT by using Verilator 5.026 2024-06-15 rev v5.026
Copyright 2003-2024 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify the Verilator internals under the terms of
either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0.
See https://verilator.org for documentation
Summary of configuration:
Compiled in defaults if not in environment:
SYSTEMC =
SYSTEMC_ARCH =
SYSTEMC_INCLUDE =
SYSTEMC_LIBDIR =
VERILATOR_ROOT = /opt/verilator5/share/verilator
SystemC system-wide = 0
Environment:
MAKE =
PERL =
SYSTEMC =
SYSTEMC_ARCH =
SYSTEMC_INCLUDE =
SYSTEMC_LIBDIR =
VERILATOR_BIN =
VERILATOR_ROOT = /opt/verilator5/share/verilator
Supported features (compiled-in or forced by environment):
COROUTINES = 1
SYSTEMC = command