This is the python wrapper around trm-subs and some other trm c++ software.
This is the update to many of the repositories found here. This code provides drop in replacements for the python codes. The following four main libraries are available:
- trm_py.subs
- trm_py.roche
- trm_py.doppler
- trm_py.observing
In addition direct access to the python bindings to the cpp code is available:
- trm_py._cpp._cpp_subs
- trm_py._cpp._cpp_roche
- trm_py._cpp.cpp_doppler
This code will be installable via pip install trm-py
from PyPi (and potentially via Conda). This code will not require additional C++ library installations separate from the python build system.
Until further notice this is a WIP and should not be considered usable for scientific use.
Get the main repo
git clone [email protected]:trm-astro/trm-py.git
Then get all the submodules
git submodule update --init --recursive
Install cibuildwheel
pip3 install cibuildwheel
If you need to install/start docker
Install Docker yum/brew docker (or however you like, note it must be REAL docker not podman ) for ubuntu/debian:
curl -sSL https://get.docker.com/ | sudo sh
Start Docker Deamon sudo systemctl start docker
Make sure docker works (on my vm, vagrant, I did), ymmv
sudo groupadd docker sudo usermod -aG docker $USER reboot
cibuildwheel
By necessity the CPP subdirectorys are included to build the python wheel against. This makes this the a convenient place to do a full CPP build for those looking to access trm-subs and associated libs via cpp code. To build (and install) all the TRM cpp libs directly:
TODO: Test this on multiplatform builds:
- Decide on your PLPLOT install method (see cmake_common/plplot_install.cmake)
- If PLPLOT is installed then
0
and set path (recommended for linux) - Build from source during the install select
1
,2
, or3
depending on desired build location and set path if required - Use homebrew install
4
(recommended for mac) (brew install plplot
)
- If PLPLOT is installed then
- Install/activate the python envronment using poetry (required for conan)
cd src
, Move to the source directoryconan install . --build=missing
, Install PCRE2, llvm-openmp, and SOFA from conanconan profile detect --force
, Set the conan build profilecmake --preset conan-release -DPLPLOT_BUILD_TYPE='0,1,2,3,or 4' -DPLPLOT_USE_PATH='path/to/plplot/install'
, use the PLPLOT build choice and use the PLPLOT path if neededcmake --build --preset conan-release
OPTIONAL: Install to system, else programs are in src/build/release
<sudo> cmake --install build/Release
- (Optional): use
otool -l <exe or lib> | grep RPATH -A2
to ensure that the programs and libraries have linked correctly
My cpp libs (conan) wont install correctly:
cd py_subs
rm -r build
(potentially not required)conan install . --build=missing
cd ..
poetry build
Conan is complaining about profiles
which conan
ensure this finds conan (and where you expect it to be)conan profile detect
Make sure the output matches your system configuration
Conan wont find fttw3
This seems to be a (temporary?) issue with the new conan2 repo not having the build for mac We can install from the old remote by adding it
conan remote add old-conan https://center.conan.io
conan install . -r old-conan --build=missing
Now its built and cached you should have no issues
CMake 3.5 issues
The latest CMake >4.00 deprecated anything with cmake_minimum_required(3.5) Install CMake 3.31