lacker / seticore

A high-performance implementation of some core SETI algorithms that can be included in other programs.
MIT License
3 stars 7 forks source link

* meson.build dependencies PIC, seticor lib and dep definitions #20

Closed radonnachie closed 2 years ago

radonnachie commented 2 years ago

This allows seticore to easily be included as a meson subproject.

radonnachie commented 2 years ago

With these changes I can submodule and compile seticore into BLADE.

lacker commented 2 years ago

Cool. Can you just verify that the unit tests run after this change? Run ‘unit_tests.sh’

eli-schwartz commented 2 years ago

For fmt, at least, I would actually suggest:

radonnachie commented 2 years ago
radonn@cosmic-gpu-0:/home/cosmic/dev/blade/subprojects/seticore$ ./unit_tests.sh 
unit testing...
===============================================================================
All tests passed (22 assertions in 6 test cases)

downloading h5 data for regression testing...
--2022-10-13 18:28:52--  https://bldata.berkeley.edu/pipeline/AGBT21B_999_31/blc17_blp17/blc17_guppi_59544_62191_HIP99317_0059.rawspec.0000.h5
Resolving bldata.berkeley.edu (bldata.berkeley.edu)... 208.68.240.101
Connecting to bldata.berkeley.edu (bldata.berkeley.edu)|208.68.240.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3230416399 (3.0G) [application/octet-stream]
Saving to: ‘data/blc17_guppi_59544_62191_HIP99317_0059.rawspec.0000.h5’

blc17_guppi_59544_62191_HIP99317_0059.rawspec.0000.h5           100%[======================================================================================================================================================>]   3.01G  4.02MB/s    in 18m 26s 

2022-10-13 18:47:19 (2.78 MB/s) - ‘data/blc17_guppi_59544_62191_HIP99317_0059.rawspec.0000.h5’ saved [3230416399/3230416399]

regression testing...
welcome to seticore, version 0.2.10
running in dedoppler mode.
loading input from data/blc17_guppi_59544_62191_HIP99317_0059.rawspec.0000.h5
dedoppler parameters: max_drift=0.40 min_drift=0.0000 snr=10.00
writing output to data/testout.hits
hit: coarse channel = 23, index = 566231, snr = 10.06962, drift rate = -0.00000 (0 bins)
hit: coarse channel = 30, index = 384478, snr = 215.74893, drift rate = -0.00000 (0 bins)
hit: coarse channel = 30, index = 388533, snr = 10.81678, drift rate = -0.10204 (10 bins)
hit: coarse channel = 60, index = 418095, snr = 37.85838, drift rate = 0.08163 (-8 bins)
hit: coarse channel = 60, index = 436060, snr = 16.08596, drift rate = 0.02041 (-2 bins)
hit: coarse channel = 60, index = 438649, snr = 10.71509, drift rate = -0.05102 (5 bins)
hit: coarse channel = 60, index = 440394, snr = 23.78380, drift rate = -0.21429 (21 bins)
dedoppler elapsed time: 9s
diffing against expected output.
output matches. regression test looks good
radonn@cosmic-gpu-0:/home/cosmic/dev/blade/subprojects/seticore$ git show
commit c978e515f10b874eec9d3342676039da9a71442b (HEAD, mydonsol/as_subproject, as_subproject)
Author: RocketRoss <code@radonn.co.za>
.
.
.
lacker commented 2 years ago

Looks good to me, thanks!

lacker commented 2 years ago

I had to revert this change, more or less, in https://github.com/lacker/seticore/commit/829f32cbf0c2159e1bdfc6c746eeaa2a3e41174c - it's breaking meerkat production because the built binary, when copied to a different location during the deployment process, is now failing with

error while loading shared libraries: libfmt.so: cannot open shared object file: No such file or directory

To double-check you can just ensure the built binary continues to work when copied to a different location. I think this is probably related to the wrap stuff that Eli suggested rather than the library stuff, but it wasn't clear to me how to have one without the other.

eli-schwartz commented 2 years ago

CMake is defaulting to build a static fmt, probably. Because BUILD_SHARED_LIBS (global setting) defaults to off.

You can trivially do that with Meson too, simply configure Meson with -Dfmt:default_library=static, or more likely (so that you don't have to manually pass arguments to the build), pass default_options: ['default_library=static'] as a kwarg to the fmt dependency subproject lookup.

Either approach causes the fmt subproject to build its libraries as static archives instead of a DSO -- hence, fmt becomes included in the binary rather than requiring to load some *.so file.

(It is still worth using dependency('fmt') instead of subproject('fmt').get_variable('fmt_dep'), because you can avoid building fmt if you already have one.)

lacker commented 2 years ago

I took another look at using this meson wrap but with default_options: ['default_library=static'] I get the same error. I tried both on the subproject lookup and on the overall project default_options.