Octave 从源代码构建八度音阶-ATLAS是否正确包含在八度音阶中。/configure script?
我从源代码中构建八度音阶,以便包含ATLAS库。我把它们包括进去了吗?我不知道该从Octave配置脚本中得到什么。我发现“-llapack”的通用性令人怀疑Octave 从源代码构建八度音阶-ATLAS是否正确包含在八度音阶中。/configure script?,octave,configure,atlas,Octave,Configure,Atlas,我从源代码中构建八度音阶,以便包含ATLAS库。我把它们包括进去了吗?我不知道该从Octave配置脚本中得到什么。我发现“-llapack”的通用性令人怀疑 /configure--with-lapack=/usr/local/atlas Source directory: . Installation prefix: /usr/local C compiler: gcc -Wall -W -Wshadow
/configure--with-lapack=/usr/local/atlas
Source directory: .
Installation prefix: /usr/local
C compiler: gcc -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
C++ compiler: g++ -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
Fortran compiler: gfortran -O
Fortran libraries: -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lgfortran -lm -lquadmath
Lex libraries:
LIBS: -lutil -lm
...
HDF5 libraries: -lhdf5
Java home: /usr/lib/jvm/java-7-openjdk-amd64
Java JVM path: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
Java CPPFLAGS: -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux
Java libraries:
LAPACK libraries: -llapack
LLVM CPPFLAGS:
LLVM LDFLAGS:
LLVM libraries:
Magick++ CPPFLAGS: -I/usr/include/GraphicsMagick
Magick++ LDFLAGS:
Magick++ libraries: -lGraphicsMagick++ -lGraphicsMagick
...
allusers@vbubuntu:~/Downloads/octave-3.8.1$ll-R/usr/local/atlas/
/usr/local/atlas/:
total 16
drwxr-xr-x 4 root root 4096 May 25 23:01 ./
drwxr-xr-x 13 root root 4096 May 25 23:01 ../
drwxr-xr-x 3 root root 4096 May 25 23:01 include/
drwxr-xr-x 2 root root 4096 May 25 23:01 lib/
/usr/local/atlas/include:
total 60
drwxr-xr-x 3 root root 4096 May 25 23:01 ./
drwxr-xr-x 4 root root 4096 May 25 23:01 ../
drwxr-xr-x 2 root root 4096 May 25 23:01 atlas/
-rw-r--r-- 1 root root 33962 May 25 23:06 cblas.h
-rw-r--r-- 1 root root 9708 May 25 23:06 clapack.h
/usr/local/atlas/include/atlas:
total 604
drwxr-xr-x 2 root root 4096 May 25 23:01 ./
drwxr-xr-x 3 root root 4096 May 25 23:01 ../
-rw-r--r-- 1 root root 2089 May 25 23:06 atlas_buildinfo.h
-rw-r--r-- 1 root root 90 May 25 23:06 atlas_cacheedge.h
...
-rw-r--r-- 1 root root 2716 May 25 23:06 zmm.h
-rw-r--r-- 1 root root 552 May 25 23:06 zXover.h
/usr/local/atlas/lib:
total 26548
drwxr-xr-x 2 root root 4096 May 25 23:01 ./
drwxr-xr-x 4 root root 4096 May 25 23:01 ../
-rw-r--r-- 1 root root 14165306 May 25 23:06 libatlas.a
-rw-r--r-- 1 root root 455844 May 25 23:06 libcblas.a
-rw-r--r-- 1 root root 572392 May 25 23:06 libf77blas.a
-rw-r--r-- 1 root root 10942494 May 25 23:06 liblapack.a
-rw-r--r-- 1 root root 456426 May 25 23:06 libptcblas.a
-rw-r--r-- 1 root root 572788 May 25 23:06 libptf77blas.a
allusers@vbubuntu:~/Downloads/octave-3.8.1$
其他信息: 在配置文件中滥发echo语句后,我注意到以下几点: 这一行:
$as_echo "$as_me:${as_lineno-$LINENO}: checking for $cheev in $LAPACK_LIBS" >&5
包含正确的$LAPACK_LIBS变量(我传入的那个)。这一行似乎是在我所讲的lapack库中找到某些东西的第一次失败:
if ac_fn_c_try_link "$LINENO"; then :
就在这一行之前,我看到配置文件定义了一些c代码,我相信它正在运行这些代码,以确定库中是否找到了任何“cheeve”
checking for cheev_ in /usr/local/atlas/lib/... no
checking for cheev_... no
checking for cheev_ in -llapack... yes
配置脚本
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $cheev ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
return $cheev ();
;
return 0;
}
_ACEOF
cat confdefs.h-好吧,我想我是在马拉松式的调试之后解决的
Octave似乎无法识别atlas库,除非它们采用共享格式(.so文件不是默认生成的.a文件)
当我使用添加的--shared
选项构建ATLAS并引用ATLAS生成的.so文件时,Octave配置脚本接受它们。注意:如果需要多线程库,请确保使用libtatlas.so,而不是libsatlas.so
checking for cheev_ in /usr/local/atlas/lib/... no
checking for cheev_... no
checking for cheev_ in -llapack... yes
参考资料:
ATLAS./configure参数:
../configure --shared -b 64 -D c -DPentiumCPS=3000 --with-netlib-lapack-tarfile=/home/allusers/Downloads/lapack-3.5.0.tgz
./configure --with-lapack=/usr/local/atlas/lib/libtatlas.so --with-blas=/usr/local/atlas/lib/libtatlas.so
倍频程./配置参数:
../configure --shared -b 64 -D c -DPentiumCPS=3000 --with-netlib-lapack-tarfile=/home/allusers/Downloads/lapack-3.5.0.tgz
./configure --with-lapack=/usr/local/atlas/lib/libtatlas.so --with-blas=/usr/local/atlas/lib/libtatlas.so
预期倍频程/configure
输出:
...
BLAS libraries: /usr/local/atlas/lib/libtatlas.so
...
LAPACK libraries: /usr/local/atlas/lib/libtatlas.so
...
...
BLAS libraries: -lblas
...
LAPACK libraries: -llapack
...
不正确的倍频程/configure
输出:
...
BLAS libraries: /usr/local/atlas/lib/libtatlas.so
...
LAPACK libraries: /usr/local/atlas/lib/libtatlas.so
...
...
BLAS libraries: -lblas
...
LAPACK libraries: -llapack
...
ATLAS和Octave的完整构建过程:
ATLAS setup:
bunzip2 -c atlas3.10.x.tar.bz2 | tar xfm -
mv ATLAS atlas3.10.1
cd atlas3.10.1
mkdir build_vbubuntu
cd build_vbubuntu
sudo apt-get install gfortran f2c libcnf-dev # ???
../configure --shared -b 64 -D c -DPentiumCPS=3000 --with-netlib-lapack-tarfile=/home/allusers/Downloads/lapack-3.5.0.tgz
make build
make check # test serial routines
make ptcheck # check parallel routines
make time
sudo make install
Octave setup:
sudo apt-get build-dep octave
./configure --with-lapack=/usr/local/atlas/lib/libtatlas.so --with-blas=/usr/local/atlas/lib/libtatlas.so
sudo make install
充分披露:虽然我写了这个答案,因为我得到了八度音阶,承认atlas库存在(我不想忘记以后再写),但最终结果仍然不起作用,大规模矩阵乘法不使用多核。因此,如果问题的原因与此相关,我可能会在将来重新编辑此答案。我成功尝试在CENTOS上编译倍频程(3.8.2),包括atlas:
(确保移除blas-devel和lapack-devel,以防万一)
建造它,看看是否一切顺利。您可以看到至少启用了-llapack
。我构建了它,但我认为它使用默认的lapack库(例如单线程),因为当我执行大型矩阵乘法运算时,我仍然只看到一个线程工作。我甚至不知道如何验证它使用的是ATLAS库还是它找到的其他库。我之前在Ubuntu软件包管理器中安装了octave,因此我认为默认的标准库也可以在系统的某个地方使用。Grep构建日志以查看是否可以在某个地方找到/usr/local/atlas
。我对这个过程不够熟悉,无法找到“构建日志”,你能告诉我我在找什么吗?我使用的是Ubuntu系统。在我运行make&configure的目录中没有看到任何内容,在/var/logs中也没有看到明显的内容。是由configure
生成的,还是由确保生成的。首先运行makeclean
,然后运行make2>&1 | tee build.log
。这将生成文件build.log
,供您grep“atlas”。