conda-forge / psrchive-feedstock

A conda-smithy repository for psrchive.
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

psrchive --libs output #55

Open demorest opened 1 month ago

demorest commented 1 month ago

This is just to note that the output of psrchive --libs currently (as of v2024.07.25) contains some incorrect-looking stuff. On a linux system I get:

-L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -lpsrmore -lpsrbase -lpsrutil -lepsic -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -Wl,-rpath-link,/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -lfftw3f -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -lcfitsio -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/share/tempo2/lib -ltempo2pred -lm -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -lgsl -lgslcblas -lm -pthread -L/lustre/aoc/users/pdemores/miniforge3/envs/dspsr-dev/lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/12.4.0 -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/12.4.0/../../../../x86_64-conda-linux-gnu/lib/../lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/12.4.0/../../../../lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/lib/../lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/12.4.0/../../../../x86_64-conda-linux-gnu/lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/12.4.0/../../.. -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/lib -L/home/conda/feedstock_root/build_artifacts/psrchive_1721936716136/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib -lgfortran -lm -lquadmath

This contains references to build directories in -L arguments that have not been stripped out or transformed to the relevant install directories. At least for linux this does not seem to be causing major problems downstream (for example for dspsr builds).

On OSX I get:

-L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -lpsrmore -lpsrbase -lpsrutil -lepsic -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/Users/pdemores/miniforge3/envs/dspsr-dev/lib -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -lfftw3f -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -lcfitsio -L/Users/pdemores/miniforge3/envs/dspsr-dev/share/tempo2/lib -ltempo2pred -lm -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -lgsl -lgslcblas -D_THREAD_SAFE -L/Users/pdemores/miniforge3/envs/dspsr-dev/lib -L/Users/runner/miniforge3/conda-bld/psrchive_1722386942156/_build_env/lib/gcc/x86_64-apple-darwin13.4.0/12.3.0 -L/Users/runner/miniforge3/conda-bld/psrchive_1722386942156/_build_env/lib/gcc/x86_64-apple-darwin13.4.0/12.3.0/../../.. -lgfortran -lemutls_w -lquadmath -lm

This also has similar spurious directories. In this case, the -lemutls_w is also not being found when building packages that link to psrchive. In https://github.com/conda-forge/dspsr-feedstock/pull/21 I worked around this by processing the output to remove this library, which does not seem to be necessary for building dspsr.

If possible it would be good to clean all this up in a future build.

demorest commented 1 month ago

Also note that psrchive now also supplies pkg-config information, this applies to the directories and libraries listed in psrchive.pc as well.