全系統的libxml2
我要編譯的色度套房物理模擬對JUQUEEN的超級計算機是IBM的藍色基因/ Q的安裝。前端運行在RedHat Linux 6上。架構是前端和計算節點上的PowerPC 7。他們使用的CPU不同,前端具有IBM Power 740,計算節點是IBM Power A2芯片。使用編譯器如mpigcc
和mpig++
會自動爲計算節點進行交叉編譯。系統廣泛的libxml2不能正常使用,編譯來源failes在配置
現代版本的程序可以使用module
加載到路徑中。還有其他兩個庫需要編譯。現在我已完成qmp
。 qdpxx
還取決於libxml2
而這正是我堅持:
chroma --- qdpxx --- qmp
\-- libxml2
在我的Fedora 24的工作站,我可以就好使用該系統廣泛安裝的libxml2
編譯qdpxx
。我剛剛安裝了RPM軟件包libxml2
和libxml2-devel
,並且不必指定qdpxx/configure
的任何-with-libxml2=DIR
參數。
在超級計算機的前端,我得到這個:
+ ./configure --prefix=/homec/hbn28/hbn28e/local/ --host=powerpc64-bgq-linux --build=powerpc64-unknown-linux-gnu --enable-bgq-thread-binding --enable-openmp --enable-parallel-arch=parscalar --enable-precision=double --enable-parallel-io --enable-qdp-alignment=128 --with-qmp=/homec/hbn28/hbn28e/local/ 'CFLAGS=-O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c99 -fopenmp --std=gnu99' 'CXXFLAGS=-O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c++11 -fopenmp' LDFLAGS= LIBS= CC=/bgsys/local/gcc/4.9.3/bin/mpigcc CXX=/bgsys/local/gcc/4.9.3/bin/mpig++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /bgsys/local/gcc/4.9.3/bin/mpig++ accepts -g... yes
checking for powerpc64-bgq-linux-ranlib... no
checking for ranlib... ranlib
configure: WARNING: using cross tools not prefixed with host triplet
checking for powerpc64-bgq-linux-ar... no
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for powerpc64-bgq-linux-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of /bgsys/local/gcc/4.9.3/bin/mpig++... gcc3
configure: Configuring QDP++ for Nd = 4
configure: Configuring QDP++ for Nc = 3
configure: Configuring QDP++ for Ns = 4
configure: Configuring QDP++ Alignment size=16
configure: Fallback to generic C routines if needed: yes
configure: Enabling BGQ Thread Binding
configure: Configuring for double precision
configure: Configuring QDP++ with cb2 layout
configure: Parscalar build! Checking for QMP
checking for qmp-config... /homec/hbn28/hbn28e/local//bin/qmp-config
configure: Found QMP configuration program /homec/hbn28/hbn28e/local//bin/qmp-config
configure: QMP compile flags: -I/homec/hbn28/hbn28e/local/include
configure: QMP linking flags: -L/homec/hbn28/hbn28e/local/lib
configure: QMP libraries flags: -lqmp
checking if we can compile/link of a simple QMP C++ program... yes
Value of with_libxml2 is XX
checking for xml2-config... /usr/bin/xml2-config
configure: Found libxml2 configuration program
configure: libxml2 compile flags: -I/usr/include/libxml2
configure: libxml2 libraries flags: -lxml2 -lz -lm
checking if we can compile/link a simple libxml2 program... no
configure: error: Cannot compile/link a program with libxml2.
Use --with-libxml2=<dir> to select a working version.
在qdpxx/config.log
,相關部分是這樣的位置:
configure:4321: checking for xml2-config
configure:4339: found /usr/bin/xml2-config
configure:4351: result: /usr/bin/xml2-config
configure:4370: Found libxml2 configuration program
configure:4374: libxml2 compile flags: -I/usr/include/libxml2
configure:4378: libxml2 libraries flags: -lxml2 -lz -lm
configure:4386: checking if we can compile/link a simple libxml2 program
configure:4434: /bgsys/local/gcc/4.9.3/bin/mpig++ -o conftest -O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c++11 -fopenmp -I/usr/include/libxml2 conftest.cpp -lxml2 -lz -lm >&5
conftest.cpp: In function 'int main()':
conftest.cpp:30:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
char *docname="foo";
^
conftest.cpp:28:13: warning: unused variable 'argc' [-Wunused-variable]
int argc ; char **argv ;
^
conftest.cpp:28:27: warning: unused variable 'argv' [-Wunused-variable]
int argc ; char **argv ;
^
conftest.cpp:29:19: warning: variable 'doc' set but not used [-Wunused-but-set-variable]
xmlDocPtr doc;
^
/usr/local/bg_soft/gcc/4.9.3/bin/../lib/gcc/powerpc64-bgq-linux/4.9.3/../../../../powerpc64-bgq-linux/bin/ld: cannot find -lxml2
/usr/local/bg_soft/gcc/4.9.3/bin/../lib/gcc/powerpc64-bgq-linux/4.9.3/../../../../powerpc64-bgq-linux/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
configure:4441: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "qdp++"
| #define PACKAGE_TARNAME "qdp--"
| #define PACKAGE_VERSION "1.44.0"
| #define PACKAGE_STRING "qdp++ 1.44.0"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE "qdp--"
| #define VERSION "1.44.0"
| #define QDP_ND 4
| #define QDP_NC 3
| #define QDP_NS 4
| #define QDP_AC_ALIGNMENT_SIZE 16
| #define QDP_USE_GENERIC_OPTS 1
| #define QDP_USE_BLUEGENEL 1
| #define BASE_PRECISION 64
| #define QDP_USE_CB2_LAYOUT 1
| #define ARCH_PARSCALAR 1
| #define QDP_USE_LIBXML2 1
| /* end confdefs.h. */
|
| #include <libxml/xmlmemory.h>
| #include <libxml/parser.h>
|
| int
| main()
| {
|
| int argc ; char **argv ;
| xmlDocPtr doc;
| char *docname="foo";
| doc = xmlParseFile(docname);
| ;
| ;
|
| ;
| return 0;
| }
configure:4483: result: no
configure:4486: error: Cannot compile/link a program with libxml2.
Use --with-libxml2=<dir> to select a working version.
的cannot find -lxml2
聽起來像沒有/usr/lib/libxml2.so
。事實上,那裏沒有。運行locate libxml
提供了以下有趣的臺詞:
/usr/include/libxml2/libxml/xpath.h
...
/usr/include/libxml2/libxml/xpointer.h
/usr/lib/libxml2.so.2
/usr/lib/libxml2.so.2.7.6
/usr/lib64/libxml2.so
/usr/lib64/libxml2.so.2
/usr/lib64/libxml2.so.2.7.6
顯然,32位版本有一個奇怪的所謂的名稱,只有64位版本有一個普通的所謂的名稱。試圖添加-L/usr/lib64
橫空出世,打破其他事情:
+ ./configure --prefix=/homec/hbn28/hbn28e/local/ --host=powerpc64-bgq-linux --build=powerpc64-unknown-linux-gnu --enable-bgq-thread-binding --enable-openmp --enable-parallel-arch=parscalar --enable-precision=double --enable-parallel-io --enable-qdp-alignment=128 --with-qmp=/homec/hbn28/hbn28e/local/ 'CFLAGS=-O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c99 -fopenmp --std=gnu99' 'CXXFLAGS=-O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c++11 -fopenmp' LDFLAGS=-L/usr/lib64/ LIBS= CC=/bgsys/local/gcc/4.9.3/bin/mpigcc CXX=/bgsys/local/gcc/4.9.3/bin/mpig++
checking for C++ compiler default output file name...
configure: error: in `/homec/hbn28/hbn28e/qdpxx':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
在日誌文件中,它說以下內容:
configure:2159: /bgsys/local/gcc/4.9.3/bin/mpig++ -O2 -finline-limit=50000 -I/usr/local/bg_soft/mpich3/include -Wall -Wpedantic -fdiagnostics-color=auto --std=c++11 -fopenmp -L/usr/lib64/ conftest.cpp >&5
/usr/local/bg_soft/gcc/4.9.3/bin/../lib/gcc/powerpc64-bgq-linux/4.9.3/../../../../powerpc64-bgq-linux/lib/crt1.o: In function `_start_no_magic':
(.text+0x58): undefined reference to `__libc_no_magic_start_main'
/bgsys/local/gcc/4.9.3/powerpc64-bgq-linux/lib/libdl.so.2: undefined reference to `[email protected]_PRIVATE'
collect2: error: ld returned 1 exit status
configure:2163: $? = 1
configure:2201: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "qdp++"
| #define PACKAGE_TARNAME "qdp--"
| #define PACKAGE_VERSION "1.44.0"
| #define PACKAGE_STRING "qdp++ 1.44.0"
| #define PACKAGE_BUGREPORT "[email protected]"
| /* end confdefs.h. */
|
| int
| main()
| {
|
| ;
| return 0;
| }
configure:2207: error: in `/homec/hbn28/hbn28e/qdpxx':
configure:2210: error: C++ compiler cannot create executables
看來我剛纔junked所有其他路徑,其中庫可以駐留在這樣的沒有任何東西可以再建立。
試圖創建從/usr/lib/libxml2.so.2
到$HOME/libxml2.so
和addling -L$HOME
的符號鏈接也沒有工作。
試圖從Git的
編譯libxml2的在這一點上我停下追求全系統的安裝,並試圖從Git倉庫安裝libxml2
。所以我已經克隆了版本庫並輸入了./autogen.sh
。這失敗的說法:
Checking zlib
./configure: line 12546: syntax error near unexpected token `Z,zlib,'
./configure: line 12546: ` PKG_CHECK_MODULES(Z,zlib,'
自動工具聲稱是版本2.69。這是安裝在大學集羣上的相同版本(它也失敗了)。在我的Fedora 24工作站上安裝了相同的版本,但是./autogen.sh
只是運行並創建了一個Makefile
。
我現在有點迷路了。如果在ppc64
RedHat和amd64
Debian大學羣集上出現故障,但在libxml2
的構建腳本中出現故障,但是我的x86_64
Fedora筆記本電腦出現故障,則是否存在bug?
我怎樣才能得到configure
腳本qdpxx
使用系統範圍的安裝libxml2
?它使用xml2-config
已經提取適當的標誌:
configure: libxml2 compile flags: -I/usr/include/libxml2
configure: libxml2 libraries flags: -lxml2 -lz -lm
我能做些什麼讓我的計劃進一步編譯?
嘗試將目標設置爲'ppc64'或'powerpc64'。這應該會自動將您的代碼構建爲64位二進制文件。 – alvits
非版本化共享庫通常由'* -devel'包提供。這些只是版本庫的鏈接。這意味着只安裝了'libxml2-devel。* 64'。未安裝32位版本。 – alvits
要解決'PKG_CHECK_MODULES'錯誤,只需安裝'pkg-config'。您還可以下載官方libxml2版本的tarball,該版本隨附預配置配置腳本。但是我真的試圖通過系統的libxml2開始工作。如果@alvits建議不起作用,那麼手動創建符號鏈接怎麼辦? – nwellnhof