FFTW安装(Linux)

下载安装包FFTW Download Pageicon-default.png?t=N7T8http://fftw.org/download.html

解压

tar -xzvf fftw-3.3.10.tar.gz

安装(动态链接库 default double-precision (double).)

部分选项说明(具体参考Installation on Unix (FFTW 3.3.10)

安装目录可以通过--prefix指定(默认安装通常需要root权限)

--enable-shared :创建动态链接库

1、./configure --prefix=/home/***/fft/fftw-3.3.10/build  CFLAGS=-fPIC CXXFLAGS=-fPIC --enable-shared

2、make

3、make install

结果

一、常见问题:

动态库中调用静态库(libfftw3.a)


libfftw3.a(apiplan.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

二、原因分析:

Assuming you are generating a shared library, most probably what happens is that the variant of libfftw3.a you are using wasn't compiled with -fPIC. In linux, you can confirm this by extracting the object files from the static library and checking their relocations:

ar -x libfftw3.a  
readelf --relocs apiplan.o | egrep '(GOT|PLT|JU?MP_SLOT)'

If the output is empty, then the static library is not position-independent and cannot be used to generate a shared object.

Since the static library contains object code which was already compiled, providing the -fPIC flag won't help.

You need to get ahold of a version of  libfftw3.a compiled with -fPIC and use that one instead.

三、解决方案:

1、./configure --prefix=/home/***/fft/fftw-3.3.10/build  CFLAGS=-fPIC CXXFLAGS=-fPIC

2、make

3、make install

四、参考:

https://stackoverflow.com/questions/19768267/relocation-r-x86-64-32s-against-linking-error

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值