type
Post
status
Published
date
Feb 18, 2025
slug
example-11
summary
简洁版
tags
软件
category
射电
icon
password
📝 准备工作
u盘安装 ubuntu,完成后重启,更新系统,更换源。
点击展开
1.备份源文件,打开终端,输入
2.编辑sources.list.文件,在终端输入
3.将sources.list里的文件内容替换成下面的即可
4.更新,在终端分别输入
5.更新完成后即下载源设置成功
6.阿里云下载源备份
设置环境变量
在~/.bashrc 中添加(路径记得修改)
安装依赖关系
确保全部安装成功
安装 FFTW
安装 CFITSIO
安装 pgplot5
请务必确保以上依赖全部安装成功
下载相关软件至/home/pl/soft/pulsar_software
- psrcat(保持更新追踪)
- 该软件包包含“psrcat”的源代码和公共目录(psrcat.db),截至v2.6.1,已更新到3838颗脉冲星。
- tempo
- tempo2
- psrchive
- 其它
正式安装流程
没有权限就赋予
安装 psrcat
安装TEMPO
安装TEMPO2
安装PSRCHIVE (with python interface)
有一个文件EPSIC可能下载不了,需要自己复制编译,如果网络没有问题就不用管它,它会自动进行编译处理。(Enhanced Pulsar Signal In Cell),个人感觉解决网络问题就解决99%的问题了。
If you make use of PSRCHIVE, please cite Hotan, van Straten & Manchester (2004)
http://www.publish.csiro.au/?paper=AS04022
安装SIGPROC (Mike Keith's version)
安装DSPSR
要选择要编译的后端支持,请创建一个文本名为“backends.list”的文件,包含例如:
Continue the build:
安装pgplot(ubuntu系统可以跳过)
第二步 安装pgplot
1.本次教程以
Ubuntu18 为例。下载源码 pgplot5.2.tar.gz ,拷贝到/home/pl/soft/pulsar_software/pgplot5.2/src 目录下(当然任意目录都可以)并解压。2.进入解压后的目录,修改
drivers.list 文件。3.把如下几行前面的!去掉就可以了.
4.新建安装目录/home/pl/soft/pulsar_software/pgplot5.2/pgplot,并把
drivers.list 拷贝到该目录下。5.在 /home/pl/soft/pulsar_software/pgplot5.2/pgplot 目录中执行下述命令,创建makefile文件。
6.进入src,编辑makefile,将文件中
FCOMPL=g77用 FCOMPL=gfortran 来代替。此外:将FFLAGD=-fno-backslash 改为:FFLAGD=-fno-backslash -fPIC
将FFLAGC=-Wall -O 改为:FFLAGC=-Wall -O -fPIC
将CFLAGC=-DPG_PPU -O2 -I. 改为:CFLAGC=-DPG_PPU -O2 -I. -fPIC
7.编译源文件,执行下述命令。
出现下图所示则编译成功
8.配置环境变量。
9.添加如下代码
安装PRESTO v5 (latest version + python enabled)
官网:
presto
scottransom • Updated May 21, 2026
目前v5还未安装成功,以下是v4安装流程
本体安装:
编辑makefile:添加
Continue the build:
Now for the python:
anaconda创建独立环境
如果你想使用所有的python例程,你需要 Python >= 版本 3.7,以及 NumPy 和 SciPy
或通过setup.py文件安装的方法,就是PRESTO目录下执行
v5的一些尝试(对centos很不友好)
tips
- 作者有设计一个封装容器,据说那更加的简单,不过我还没去尝试。
- 至此,ubuntu20.04上安装流程完成。因为我习惯了这个版本,ubuntu18.04很不适应。
CentOS 7 安装要麻烦很多
建议使用conda的独立pythhon环境,流程默认折叠
.bashrc
删除不兼容的 libpng-devel 并安装 libpng12:
FFTW
从FFTW官网下载FFTW3.3.10
a) 单精度(对于 Psrchive)
b) 双精度(对于 Tempo2)
CFITSIO
cfitsio
heasarc • Updated May 28, 2026
倘若make shared时提示'aclocal-1.17' is missing on your system.:
PSRCAT
PGPLOT
在 pgplot-{version} 目录旁边创建一个空目录 (pgplot_build)。
将
pgplot-{version}/drivers.list 复制到 pgplot_build 目录,需要去掉注释的如下TEMPO
同上
TEMPO2
Open MPI: Version 4.1 (可选)
psrchive
或者:
SIGPROC
sigproc
SixByNine • Updated May 26, 2026
dspsr
presto
编辑makefile
Add '-lm' flag to CFLAGS
Add '-g -fPIC' to FFLAGS
realfft.c: 在函数‘main’中:
realfft.c:70:5: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
for (int fi = 0 ; fi < numfiles ; fi++) {
^
realfft.c:70:5: 附注:使用 -std=c99 或 -std=gnu99 来编译您的代码
make: *** [realfft.o] 错误 1
realfft.c:7:21: 致命错误:clk_tck.h:没有那个文件或目录
致命错误:fitsio.h:没有那个文件或目录
ModuleNotFoundError: No module named 'distutils.msvccompiler’
与FFT相关的内核爆炸
tempo: error while loading shared libraries: libgslcblas.so.0: cannot open shared object file: No such file or directory
问题
cpgplot.h: No such file or directory
一个简单的办法是,看是哪一步报错,建立软连接到对于文件夹,便可以正确识别
或
export CPLUS_INCLUDE_PATH=$PSRSOFT_DIR/include:$CPLUS_INCLUDE_PATH
psrchive中低版本的gcc:
提示:
编译添加选项:
高版本的问题:
../../Util/epsic/src/util/true_math.h:33:14: error: expected unqualified-id before 'sizeof'
inline int signbit (float x) { return true_signbit_float(x); }
在编译过程中,
true_math.h 中定义的 signbit 函数与系统头文件中的 signbit 宏或函数发生冲突。由于某些数学库(如 math.h 或 cmath)可能将 signbit 定义为宏,导致编译器在处理函数定义时错误地展开宏,引发语法错误。
修改true_math.h:防止重复的signbit 定义
或添加(不推荐)到true_math.h:
psrchive提示./psrchive.i:94: Error: Syntax error in input(1).
由于
swig3 与 swig-2.0.10 冲突,最直接的办法是 先卸载旧版本,再安装 swig3:No module named 'numpy.distutils'
PSRCHIVE installation not found.
./configure --prefix=$PSRSOFT_DIR F77=gfortran CFLAGS=-fPIC FFLAGS=-fPIC
其中会改变某个文件的权限,但没用权限更改,所以报错
使用sudo,会找不到psrchive的路径依赖。。。。。。
sudo su进入root用户发现tempo也无法使用
解决办法:将.bashrc里关于软件的环境变量全部export一些,然后就没报错了
加速搜寻没能成功生成.cand0文件
可能是内存溢出
Note: If the following fails, edit $PRESTO/Makefile and follow the instructions about the CFLAGS USE_FFTW_MALLOC option
Note: If the following fails, edit $PRESTO/Makefile and follow
the instructions about the CFLAGS USE_FFTW_MALLOC option
undefined reference to `__exp_finite'
dspsr:
以及CFITSIO不匹配的问题:
ERROR: Mismatch in the CFITSIO_SONAME value in the fitsio.h include file
that was used to build the CFITSIO library, and the value in the include file
that was used when compiling the application program:
Version used to build the CFITSIO library = 8
Version included by the application program = 5
这个问题主要是先安装了heasoft之后,再安装presto出现的。heasoft自带10版本的最新的cfitsio,容易误链接。
参考
- Author:彭龙
- URL:http://plxray.cn/%E5%B0%84%E7%94%B5/example-11
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts







