| 查看: 2053 | 回復(fù): 12 | |||
[求助]
安裝fftw時bin文件不見了,求助
|
|
只要提出有幫助意見我就散金了。。 我在安裝fftw時,先安裝了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第一步就出問題。。。。 |
木蟲 (正式寫手)
|
這個裝好之后是庫文件, 應(yīng)該在lib文件里面, ~/usr/include/fftw3.h ~/usr/include/fftw3.f ~/usr/lib/libfftw3.a ~/usr/lib/libfftw3.la ~/usr/lib/libfftw3.so 看看這個鏈接吧 http://micro.stanford.edu/wiki/Install_FFTW3 |
木蟲 (正式寫手)
金蟲 (正式寫手)
|
樓上已經(jīng)說得蠻清楚了,你的安裝看起來沒有問題,自定義路徑以后,完成安裝以后,在那個路徑下面會有三個新文件夾,include, info, lib 后面調(diào)用的時候,只要知道include和lib的絕對路徑,就可以了。FFTW并不會生成一個可執(zhí)行命令,它只是一個庫而已。 再有問題,在這邊蓋樓提問。 |

|
今天重新搞了臺電腦,安裝了ubuntu系統(tǒng)。問題倚在。 其實我想用lmp_gentoo這個庫文件編譯cpp,這個庫文件沒有問題的。 mpic++ -Wall myCode.cpp -lfftw -llmp_gentoo -o myCode 這個是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的時候,是有l(wèi)ibfftw2.so,fftw3.so的,系統(tǒng)報: /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,那個fftw3我?guī)煹苷f會報錯的。糾結(jié)。 |
金蟲 (正式寫手)
|
因為你前面自定義了FFTW的安裝路徑,所以肯定就不能在系統(tǒng)的庫文件夾/usr/lib找到FFTW對應(yīng)的lib文件,比如你這里提到的libfftw.so 有兩個解決辦法: (1) 像你對mpi的操作那樣,在你的.bashrc文件里面加入其他的lib搜索路徑 (我假設(shè)你的fftw是按照你前面自定義的路徑,/usr/local/fftw2 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/fftw2/lib export LD_LIBRARY_PATH (2) 用這個命令來編譯你的程序 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 這個問題是不是你誰的lmp_gentoo的問題還是fftw的問題? |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 281求調(diào)劑(0805) +3 | 煙汐憶海 2026-03-16 | 9/450 |
|
|---|---|---|---|---|
|
[考博] 環(huán)境領(lǐng)域全國重點實驗室招收博士1-2名 +3 | QGZDSYS 2026-03-13 | 3/150 |
|
|
[考研] 326求調(diào)劑 +5 | 上岸的小葡 2026-03-15 | 6/300 |
|
|
[考研] 302求調(diào)劑 +9 | 負(fù)心者當(dāng)誅 2026-03-11 | 9/450 |
|
|
[考研] 085601求調(diào)劑 +4 | Du.11 2026-03-16 | 4/200 |
|
|
[考研] 求調(diào)劑,總分315,考的生物醫(yī)藥,一志愿湖南師范大學(xué)。調(diào)劑到任何專業(yè)都可以 +4 | 小丁想進(jìn)步 2026-03-11 | 5/250 |
|
|
[考研] 285化工學(xué)碩求調(diào)劑(081700) +9 | 柴郡貓_ 2026-03-12 | 9/450 |
|
|
[考研] 材料專碩274一志愿陜西師范大學(xué)求調(diào)劑 +5 | 薛云鵬 2026-03-13 | 5/250 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 機械專碩325,尋找調(diào)劑院校 +3 | y9999 2026-03-15 | 5/250 |
|
|
[基金申請]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考研] 中科院材料273求調(diào)劑 +4 | yzydy 2026-03-15 | 4/200 |
|
|
[考研] 0856專碩279求調(diào)劑 +5 | 加油加油!? 2026-03-15 | 5/250 |
|
|
[考研] 材料工程327求調(diào)劑 +3 | xiaohe12w 2026-03-11 | 3/150 |
|
|
[考研] 255求調(diào)劑 +3 | 李嘉慧, 2026-03-12 | 4/200 |
|
|
[考研] 331求調(diào)劑(0703有機化學(xué) +5 | ZY-05 2026-03-13 | 6/300 |
|
|
[考研] 333求調(diào)劑 +3 | 球球古力 2026-03-11 | 3/150 |
|
|
[考研] 【考研調(diào)劑求收留】 +3 | Ceciilia 2026-03-11 | 3/150 |
|
|
[考研] 0703化學(xué)求調(diào)劑 +7 | 綠豆芹菜湯 2026-03-12 | 7/350 |
|
|
[考研] 328化工專碩求調(diào)劑 +4 | 。,。,。,。i 2026-03-12 | 4/200 |
|