Menu

#133 DSPSR compile error

version_1.0
closed-fixed
5
2026-03-06
2026-03-03
Ramesh
No

Hi Willem,

I have a similar problem to https://sourceforge.net/p/dspsr/bugs/132/, where dspsr build breaks. The first part was solved by fixing $PKG_CONFIG_PATH. Following this dspsr begins to build but breaks later at :

libtool: compile: g++ -std=c++14 -DHAVE_CONFIG_H -I. -I../../.. -I../../../local_include -I/home/psr/install/include/epsic -I/usr/local/include -fopenmp -g -O2 -MT FITSDigitizer.lo -MD -MP -MF .deps/FITSDigitizer.Tpo -c FITSDigitizer.C -o FITSDigitizer.o
libtool: compile: g++ -std=c++14 -DHAVE_CONFIG_H -I. -I../../.. -I../../../local_include -I/home/psr/install/include/epsic -I/usr/local/include -fopenmp -g -O2 -MT FITSOutputFile.lo -MD -MP -MF .deps/FITSOutputFile.Tpo -c FITSOutputFile.C -o FITSOutputFile.o

For some reason the psrchive include directory is not being passed to g++. I am attaching the output for pkg-config --debug psrchive. Could you please suggest a fix? Thanks!

Cheers,
Ramesh

1 Attachments

Discussion

  • Ramesh

    Ramesh - 2026-03-03

    Hi Willem,

    A quick follow up: I used a quick workaround of setting export CXXFLAGS=-I/home/psr/install/include, running configure again and got dspsr to compile. Thanks!

     

    Last edit: Ramesh 2026-03-03
  • Willem van Straten

    Hi Ramesh, that's quite strange because most of the DSPSR build depends on PSRCHIVE. It's also odd to see /home/psr/install/include/epsic on the compilation command line but not /home/psr/install/include ... Could you please also attach a copy of Kernel/Formats/fits/Makefile from your DSPSR build directory?

     
  • Ramesh

    Ramesh - 2026-03-04

    Hi Willem,

    Here is the Makefile.

    Cheers,
    Ramesh

     
  • Willem van Straten

    Thanks for that, Ramesh. Stranger still

    $ grep PSRCHIVE_.*= Makefile
    PSRCHIVE_ACLOCAL = /home/psr/install/share/aclocal
    PSRCHIVE_CFLAGS = -I/home/psr/install/include/epsic
    PSRCHIVE_INCLUDE = -I/home/psr/install/include/epsic
    PSRCHIVE_LIBS = <blah blah blah>
    

    shows that only the epsic headers folder is included in PSRCHIVE_CFLAGS ... what is returned when you run the following command?

    pkg-config --cflags-only-I psrchive
    
     
  • Ramesh

    Ramesh - 2026-03-05

    Hi Willem,

    I get:

    root@fcfc35493bb0:/home/psrtest/build/psrchive# pkg-config --cflags-only-I psrchive
    -I/home/psr/install/include/epsic 
    

    Cheers,
    Ramesh

     
  • Willem van Straten

    Thanks, Ramesh. Could you please check if the PKG_CONFIG_SYSTEM_INCLUDE_PATH environment variable is set on your system, and if it includes /home/psr/install/include?

    I did the following test on my laptop, which can reproduce the "stripping" of the first -I output

    e$ pkg-config --cflags-only-I psrchive
    -I/home/willem/Pulsar/include -I/home/willem/Pulsar/include/epsic
    $ echo $PKG_CONFIG_SYSTEM_INCLUDE_PATH
    
    $ export PKG_CONFIG_SYSTEM_INCLUDE_PATH=/home/willem/Pulsar/include
    $ pkg-config --cflags-only-I psrchive
    -I/home/willem/Pulsar/include/epsic
    

    If PKG_CONFIG_SYSTEM_INCLUDE_PATH is not defined, please try C_INCLUDE_PATH ... on my system, it has the same effect.

    $ pkg-config --cflags-only-I psrchive
    -I/home/willem/Pulsar/include -I/home/willem/Pulsar/include/epsic
    $ echo $C_INCLUDE_PATH
    
    $ export C_INCLUDE_PATH=/home/willem/Pulsar/include
    $ pkg-config --cflags-only-I psrchive
    -I/home/willem/Pulsar/include/epsic
    

    If PKG_CONFIG_SYSTEM_INCLUDE_PATH or C_INCLUDE_PATH (or CPATH?) is defined in your environment, I might be able to fix the dpsr configure script to disable pkg-config from stripping the paths.

     
  • Ramesh

    Ramesh - 2026-03-05

    Hi Willem,

    Yes, C_INCLUDE_PATH was set, as reporduced below:

    root@5b5776898130:~/build/dspsr# echo $PKG_CONFIG_SYSTEM_INCLUDE_PATH
    
    root@5b5776898130:~/build/dspsr# echo $C_INCLUDE_PATH                
    /home/psr/install/include
    

    BTW, I am building dspsr in a docker container (based on debian:bookworm) - is that something to watch out?

    Cheers,
    Ramesh

     
  • Willem van Straten

    Thanks, Ramesh!

    As an optimization, pkg-config is stripping /home/psr/install/include from the PSRCHIVE_CFLAGS that is passed to the dspsr build tools. However, the compiler appears to be ignoring C_INCLUDE_PATH and therefore this include path is getting missed.

    I've checked in a fix to the dspsr configure.ac file that should disable pkg-config from stripping system include header paths from its output, by defining PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 before calling AX_PKG_CHECK_MODULES

    # ensure that system include paths are not stripped by pkg-config
    export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
    
    AX_PKG_CHECK_MODULES([PSRCHIVE],[psrchive >= 2026-02-26],[])
    

    Could you please try out this fix on your end?

     

    Last edit: Willem van Straten 2026-03-05
  • Ramesh

    Ramesh - 2026-03-06

    Hi Willem,

    Awesome, after a fresh pull, the build goes through just fine. Thank you very much!

     
  • Willem van Straten

    • status: open --> closed-fixed
    • assigned_to: Willem van Straten
     
  • Willem van Straten

    Thank you for confirming!

     

Log in to post a comment.

MongoDB Logo MongoDB