| 查看: 2052 | 回復(fù): 12 | ||
[求助]
安裝fftw時(shí)bin文件不見了,求助
|
|
只要提出有幫助意見我就散金了。。 我在安裝fftw時(shí),先安裝了fftw3,方法如下: $ cd /usr/local/src $ sudo tar xzvf ~/Downloads/fftw-3.3.3.tar.gz $ cd fftw-3.3.3 $ sudo ./configure --prefix=/usr/local/fftw3 --enable-float $ sudo make $ sudo make install 后來發(fā)現(xiàn)fftw3有些問題,就有按照上述方法安裝了fftw2.1.5 安裝fftw2 $ cd /usr/local/src $ sudo tar xzvf ~/Downloads/fftw-2.1.5.tar.gz $ cd fftw-2.1.5 $ sudo ./configure --prefix=/usr/local/fftw2 --enable-float $ sudo make $ sudo make install 但是裝完后,發(fā)現(xiàn)在/usr/local/fftw3/里面有bin 但是在/usr/local/fftw2/下面沒有bin 然后參考網(wǎng)上方法,刪除了fftw2、fftw3文件夾,重新安裝了fftw2,還是沒有bin 求助!怎么回事~~ 新手裝lammps第一步就出問題。。。。 |
木蟲 (正式寫手)
|
這個(gè)裝好之后是庫文件, 應(yīng)該在lib文件里面, ~/usr/include/fftw3.h ~/usr/include/fftw3.f ~/usr/lib/libfftw3.a ~/usr/lib/libfftw3.la ~/usr/lib/libfftw3.so 看看這個(gè)鏈接吧 http://micro.stanford.edu/wiki/Install_FFTW3 |
木蟲 (正式寫手)
金蟲 (正式寫手)
|
樓上已經(jīng)說得蠻清楚了,你的安裝看起來沒有問題,自定義路徑以后,完成安裝以后,在那個(gè)路徑下面會有三個(gè)新文件夾,include, info, lib 后面調(diào)用的時(shí)候,只要知道include和lib的絕對路徑,就可以了。FFTW并不會生成一個(gè)可執(zhí)行命令,它只是一個(gè)庫而已。 再有問題,在這邊蓋樓提問。 |

|
今天重新搞了臺電腦,安裝了ubuntu系統(tǒng)。問題倚在。 其實(shí)我想用lmp_gentoo這個(gè)庫文件編譯cpp,這個(gè)庫文件沒有問題的。 mpic++ -Wall myCode.cpp -lfftw -llmp_gentoo -o myCode 這個(gè)是mpic++命令編譯cpp文件的命令。 編譯后,出現(xiàn)的出錯誤是: /usr/bin/ld: cannot find -lfftw 查找網(wǎng)上關(guān)于解決這類問題的辦法,應(yīng)該是在文件夾: /usr/lib下面沒有l(wèi)ibfftw.so文件。 然后我檢查了一下,果然在我的ubuntu下沒有l(wèi)ibfftw.so 最早我安裝fftw2,fftw3的時(shí)候,是有l(wèi)ibfftw2.so,fftw3.so的,系統(tǒng)報(bào): /usr/bin/ld: cannot find -lfftw /usr/bin/ld: cannot find -lmpii錯誤, 通過將mpi的環(huán)境變量放入.bashrc之后,/usr/bin/ld: cannot find -lmpi沒有了,所以我認(rèn)為是fftw沒有放入環(huán)境變量。 現(xiàn)在麻煩大了,連libfftw.so都找不到了。哎~ |
|
說:/usr/bin/ld: cannot find -lfftw可以通過apt-get install libfftw-dev來重新安裝http://blog.sina.com.cn/s/blog_4156950c0100sfzz.html 我看了一下,按tab鍵,apt-get會給出fftw3-dev。不敢裝fftw3,那個(gè)fftw3我?guī)煹苷f會報(bào)錯的。糾結(jié)。 |
金蟲 (正式寫手)
|
因?yàn)槟闱懊孀远x了FFTW的安裝路徑,所以肯定就不能在系統(tǒng)的庫文件夾/usr/lib找到FFTW對應(yīng)的lib文件,比如你這里提到的libfftw.so 有兩個(gè)解決辦法: (1) 像你對mpi的操作那樣,在你的.bashrc文件里面加入其他的lib搜索路徑 (我假設(shè)你的fftw是按照你前面自定義的路徑,/usr/local/fftw2 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/fftw2/lib export LD_LIBRARY_PATH (2) 用這個(gè)命令來編譯你的程序 mpic++ -Wall myCode.cpp -L/usr/local/fftw2/lib -lfftw -llmp_gentoo -o myCode 加入”-L/usr/local/fftw2/lib“的目的是讓mpic++知道去哪里找對應(yīng)的fftw庫文件。 如果你的lmp_gentoo也有類似的問題,請對照著處理。 有啥問題,繼續(xù)蓋樓。 |

|
.bashrc 最后面加入: export PATH=/usr/local/openmpi/bin:$PATH # 將新路徑添加到現(xiàn)有的$PATH中 然后 $ mpic++ -Wall cnt_correlation_t200.cpp -L/usr/local/fftw2/lib -lfftw -llmp_gentoo -o myCode 反饋如下: cnt_correlation_t200.cpp: 在函數(shù)‘int main(int, char**)’中: cnt_correlation_t200.cpp:258:52: 警告: 格式字符串尾有可疑的‘%’ [-Wformat] cnt_correlation_t200.cpp:266:52: 警告: 格式字符串尾有可疑的‘%’ [-Wformat] cnt_correlation_t200.cpp:274:52: 警告: 格式字符串尾有可疑的‘%’ [-Wformat] cnt_correlation_t200.cpp:282:52: 警告: 格式字符串尾有可疑的‘%’ [-Wformat] cnt_correlation_t200.cpp:290:52: 警告: 格式字符串尾有可疑的‘%’ [-Wformat] cnt_correlation_t200.cpp:130:18: 警告: 未使用的變量‘n’ [-Wunused-variable] /lib/../lib/liblmp_gentoo.a(fft3d.o): In function `fft_1d_only(fftw_complex*, int, int, fft_plan_3d*)': fft3d.cpp:(.text+0x215): undefined reference to `fftw' fft3d.cpp:(.text+0x25c): undefined reference to `fftw' fft3d.cpp:(.text+0x2a5): undefined reference to `fftw' fft3d.cpp:(.text+0x4f4): undefined reference to `fftw' fft3d.cpp:(.text+0x53b): undefined reference to `fftw' /lib/../lib/liblmp_gentoo.a(fft3d.o):fft3d.cpp:(.text+0x584): more undefined references to `fftw' follow /lib/../lib/liblmp_gentoo.a(fft3d.o): In function `fft_3d_destroy_plan(fft_plan_3d*)': fft3d.cpp:(.text+0x836): undefined reference to `fftw_destroy_plan' fft3d.cpp:(.text+0x841): undefined reference to `fftw_destroy_plan' fft3d.cpp:(.text+0x853): undefined reference to `fftw_destroy_plan' fft3d.cpp:(.text+0x85e): undefined reference to `fftw_destroy_plan' fft3d.cpp:(.text+0x869): undefined reference to `fftw_destroy_plan' /lib/../lib/liblmp_gentoo.a(fft3d.o):fft3d.cpp:(.text+0x874): more undefined references to `fftw_destroy_plan' follow /lib/../lib/liblmp_gentoo.a(fft3d.o): In function `fft_3d(fftw_complex*, fftw_complex*, int, fft_plan_3d*)': fft3d.cpp:(.text+0x916): undefined reference to `fftw' fft3d.cpp:(.text+0x98b): undefined reference to `fftw' fft3d.cpp:(.text+0xa00): undefined reference to `fftw' fft3d.cpp:(.text+0xc62): undefined reference to `fftw' fft3d.cpp:(.text+0xcaa): undefined reference to `fftw' /lib/../lib/liblmp_gentoo.a(fft3d.o):fft3d.cpp:(.text+0xcf2): more undefined references to `fftw' follow /lib/../lib/liblmp_gentoo.a(fft3d.o): In function `fft_3d_create_plan(ompi_communicator_t*, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int*)': fft3d.cpp:(.text+0x1540): undefined reference to `fftw_create_plan' fft3d.cpp:(.text+0x1561): undefined reference to `fftw_create_plan' fft3d.cpp:(.text+0x15b3): undefined reference to `fftw_create_plan' fft3d.cpp:(.text+0x15d4): undefined reference to `fftw_create_plan' fft3d.cpp:(.text+0x1707): undefined reference to `fftw_create_plan' /lib/../lib/liblmp_gentoo.a(fft3d.o):fft3d.cpp:(.text+0x1728): more undefined references to `fftw_create_plan' follow collect2: ld 返回 1 這個(gè)問題是不是你誰的lmp_gentoo的問題還是fftw的問題? |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 268求調(diào)劑 +7 | 好運(yùn)連綿不絕 2026-03-12 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 070300化學(xué)319求調(diào)劑 +4 | 錦鯉0909 2026-03-17 | 4/200 |
|
|
[考研] 304求調(diào)劑 +8 | 小熊joy 2026-03-14 | 8/400 |
|
|
[考研] 274求調(diào)劑0856材料化工 +13 | z2839474511 2026-03-11 | 14/700 |
|
|
[考研] 材料工程專碩274一志愿211求調(diào)劑 +6 | 薛云鵬 2026-03-15 | 6/300 |
|
|
[考研] 一志愿南京大學(xué),080500材料科學(xué)與工程,調(diào)劑 +4 | Jy? 2026-03-16 | 4/200 |
|
|
[考研] 275求調(diào)劑 +4 | 太陽花天天開心 2026-03-16 | 4/200 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 085600材料與化工 求調(diào)劑 +13 | enenenhui 2026-03-13 | 14/700 |
|
|
[考研] 0703化學(xué)調(diào)劑 290分有科研經(jīng)歷,論文在投 +7 | 膩膩gk 2026-03-14 | 7/350 |
|
|
[考研] 265求調(diào)劑 +4 | 威化餅07 2026-03-12 | 4/200 |
|
|
[考研] 復(fù)試調(diào)劑 +4 | z1z2z3879 2026-03-14 | 5/250 |
|
|
[考研] 材料工程調(diào)劑 +9 | 咪咪空空 2026-03-12 | 9/450 |
|
|
[考研] 304求調(diào)劑 +7 | 7712b 2026-03-13 | 7/350 |
|
|
[考研] 工科,求調(diào)劑 +3 | 我887 2026-03-11 | 3/150 |
|
|
[考研] 281求調(diào)劑 +9 | Koxui 2026-03-12 | 11/550 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-13 | 3/150 |
|
|
[考研] 290求調(diào)劑 +7 | ADT 2026-03-12 | 7/350 |
|
|
[考研] 270求調(diào)劑 085600材料與化工專碩 +3 | YXCT 2026-03-11 | 3/150 |
|
|
[考博] 26讀博 +4 | Rui135246 2026-03-12 | 10/500 |
|