- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我想在 IBM BlueGene/Q 安装的 JUQUEEN super 计算机上编译 Chroma 物理模拟套件。前端在 RedHat Linux 6 上运行。架构在前端和计算节点上都是 PowerPC 7。它们使用的 CPU 不同,前端有 IBM Power 740,计算节点是 IBM Power A2 芯片。使用 mpigcc
和 mpig++
等编译器自动为计算节点交叉编译。
可以使用 module
将程序的现代版本加载到路径中。存在对其他两个必须编译的库的依赖性。我现在已经完成了 qmp
。 qdpxx
也依赖于 libxml2
,这就是我卡住的地方:
chroma --- qdpxx --- qmp
\-- libxml2
在我的 Fedora 24 工作站上,我可以使用 libxml2
的系统范围安装来编译 qdpxx
。我刚刚安装了 RPM 包 libxml2
和 libxml2-devel
并且不必为 指定任何
。-with-libxml2=DIR
参数>qdpxx/配置
在 super 计算机前端,我得到这个:
+ ./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 "edwards@jlab.org"
| #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 `_dl_addr_range@GLIBC_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 "edwards@jlab.org"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2207: error: in `/homec/hbn28/hbn28e/qdpxx':
configure:2210: error: C++ compiler cannot create executables
似乎我刚刚丢弃了库可以驻留的所有其他路径,因此不再构建任何内容。
尝试创建从 /usr/lib/libxml2.so.2
到 $HOME/libxml2.so
的符号链接(symbolic link)并添加 -L$HOME
也没有用。
在这一点上,我停止追求系统范围的安装,并尝试从 Git 存储库安装 libxml2
。所以我克隆了存储库并输入了 ./autogen.sh
。这个失败的说法:
Checking zlib
./configure: line 12546: syntax error near unexpected token `Z,zlib,'
./configure: line 12546: ` PKG_CHECK_MODULES(Z,zlib,'
那里的 autotools 声称是 2.69 版。这是安装在大学集群上的相同版本(它也失败了)。在我的 Fedora 24 工作站上安装了相同的版本,但 ./autogen.sh
只是运行并创建了一个 Makefile
。
我现在有点迷茫。 libxml2
的构建脚本是否在 ppc64
RedHat 和 amd64
Debian 大学集群上失败但不是我的x86_64
Fedora 笔记本电脑?
如何让 qdpxx
的 configure
脚本使用 libxml2
的系统范围安装?它确实已经使用 xml2-config
提取了正确的标志:
configure: libxml2 compile flags: -I/usr/include/libxml2
configure: libxml2 libraries flags: -lxml2 -lz -lm
如何进一步编译我的程序?
最佳答案
在源目录中运行 ln -fs/usr/share/aclocal/pkg.m4 .
使 configure
找到 PKG_PROG_PKG_CONFIG
。但是,仍然存在语法错误。重新运行 autoreconf
创建了一个 configure
文件,现在不再有任何语法错误。
关于c++ - 系统范围的 libxml2 不工作,从源代码编译在配置中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40598669/
是否有任何库或框架旨在促进从另一种成熟的编程语言中构建项目? 在 C++、java 等编程语言中指定逻辑、集合和复杂规则非常容易,但在 Makefile 中完成这些事情似乎是一场艰苦的战斗。我还没有深
我有这段代码可以用 clang 编译得很好(即使使用 -Weverything),但是 gcc 会发出错误。 #include #include #include using namespace
我有以下 block 头文件 BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *
我在我的一个项目中遇到了一个奇怪的问题。我的代码库依赖于一个外部库,其中包含一个名为 Dataset 的类. Dataset类私有(private)继承自 std::vector (其中 Sample
当使用 gcc、g++ 或 make 在终端中编译一个小型 C 或 C++ 项目时,我收到以下错误: /tmp/ccG1caGi.o: In function `main': main.c:(.tex
我正在尝试从 CVS 为 Windows 上的 Emacs 23.1.50 编译 CEDET,但在“第 6 步:打开 EDE...”时出现错误:“defvar:作为变量的符号值是无效的:cedet-m
我正在(重新)学习编程,我从 C 开始。我的 IDE(如果我可以这么说)是 Windows7 上的 cygwin(32 位)和 Visual-Studio 2010。我总是编译我用 gcc (cygw
我喜欢在模板类中使用本地类来执行类似“static if”的构造。但是我遇到了 gcc 4.8 不想编译我的代码的问题。但是 4.7 可以。 这个例子: #include #include #in
我有一个项目,必须仅使用 java 1.4 进行编译。但我计划使用mockito 编写一些单元测试。我想要一种在 pom 中指定的方法,以便 src/main/java 使用 jdk 1.4 编译,但
我想了解 PHP 编译过程是如何工作的。 假设我有一个名为funcs.php 的文件并且这个文件有三个函数,如果我include 或require 它,所有的在文件加载期间编译三个函数?或者源代码会被
编译工具链 我们写程序的时候用的都是集成开发环境 (IDE: Integrated Development Environment),集成开发环境可以极大地方便我们程序员编写程序,但是配置起来
当我编写一些 Scala 代码时,在尝试编译代码时收到一条奇怪的错误消息。我将代码分解为一个更简单的代码(从语义的角度来看这完全没有意义,但仍然显示了错误)。 scala> :paste // Ent
我正在编译一个 SCSS 文件,它似乎删除了我的评论。我可以使用什么命令来保留所有评论? >SASS input.scss output.css 我在 SCSS 中看到两种类型的注释。 // Comm
这是我的代码: #include typedef struct { const char *description; float value; int age; } swag
当您编译 grails war 时,我知道 .groovy 代码被编译为字节码类文件,但我不明白容器(例如 tomcat)如何在请求 GSP 时知道如何编译它们。容器了解 GSP 吗?安装在服务器上的
我正在努力将多个文件编译成一个通用程序。我收到一个错误: undefined reference to 'pi' 这是我的代码和 Makefile 的框架。我做错了什么?谢谢! 文件:calcPi.c
我尝试使用 LD_PRELOAD 来 Hook sprintf function ,所以我将打印到缓冲区的结果: #define _GNU_SOURCE #include #include int
我正在寻找最简单的方法来自动将 CoffeeScript 重新编译为 JS。 阅读documentation但仍然很难得到我想要的东西。 我需要它来监视文件夹 src/ 中的任何 *.coffee 文
我想使用定制waveformjs 。我发现this on SO但是,我不知道如何编译/安装波形来开始。我从 GitHub 克隆它并进行了更改,但是我不知道如何将其转换为 .js 文件。 最佳答案 为了
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我是一名优秀的程序员,十分优秀!