Skip to content

Use compilertools for building shared libraries

Simon Perkins requested to merge g-simonperkins/ducc:compilertools into ducc0

@mtr I saw your comment !15 (comment 59008), but decided to create a new merge request based on the ducc0 branch.

This MR uses compilertools to build multiple shared objects. The following shows the contents of an install in a python 3.7 virtual environment:

$ tree /tmp/ducc/lib/python3.7/site-packages/ducc0
/tmp/ducc/lib/python3.7/site-packages/ducc0
├── ext.avx2.cpython-37m-x86_64-linux-gnu.so
├── ext.avx512.cpython-37m-x86_64-linux-gnu.so
├── ext.avx.cpython-37m-x86_64-linux-gnu.so
├── ext.cpython-37m-x86_64-linux-gnu.so
├── __init__.py
└── __pycache__
    └── __init__.cpython-37.pyc

1 directory, 6 files

Note that the main __init__.py contains the following:

try:
    import compilertools
except ImportError:
    pass

from ducc0.ext import fft
from ducc0.ext import healpix
from ducc0.ext import misc
from ducc0.ext import sht
from ducc0.ext import totalconvolve
from ducc0.ext import wgridder

I haven't been able to verify which shared object is loaded, but the imports do work.

/cc @g-landmanbester

Edited by Simon Perkins

Merge request reports