Geant4,示例B1构建错误:没有规则来制作目标

时间:2014-05-28 16:54:34

标签: makefile cmake target

我正在尝试为Geant4-10.0.1编译B1示例。此链接提供说明 http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch03s02.html

我有两个独立的目录:B1和B1-build。直到

,一切正常

$ make -jN

我收到以下错误

$ make -j4
Scanning dependencies of target exampleB1
[ 12%] [ 37%] [ 37%] [ 50%] Building CXX object CMakeFiles/exampleB1.dir/src/B1Run.cc.o
Building CXX object CMakeFiles/exampleB1.dir/src/B1PrimaryGeneratorAction.cc.o
Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o
Building CXX object CMakeFiles/exampleB1.dir/src/B1EventAction.cc.o
[ 62%] Building CXX object CMakeFiles/exampleB1.dir/src/B1RunAction.cc.o
[ 75%] Building CXX object CMakeFiles/exampleB1.dir/src/B1DetectorConstruction.cc.o
[ 87%] Building CXX object CMakeFiles/exampleB1.dir/src/B1ActionInitialization.cc.o
[100%] make[2]: *** No rule to make target '/usr/lib64/libexpat.so', needed by 'exampleB1'.  Stop.
make[2]: *** Waiting for unfinished jobs....
Building CXX object CMakeFiles/exampleB1.dir/src/B1SteppingAction.cc.o
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/exampleB1.dir/all' failed
make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

有什么想法吗?感谢。

- 编辑 -

尝试后

$ make VERBOSE = 1

它以类似的错误消息结束:

.
.
.
[100%] Building CXX object CMakeFiles/exampleB1.dir/src/B1SteppingAction.cc.o
/usr/bin/c++   -DG4UI_USE -DG4UI_USE_TCSH -DG4VERBOSE -DG4VIS_USE -DG4_STORE_TRAJECTORY -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -std=c++98 -I/usr/local/geant4.10.00.p01-install/include/Geant4 -I/1/home/walterms/geant4builds/B1/include    -o CMakeFiles/exampleB1.dir/src/B1SteppingAction.cc.o -c /1/home/walterms/geant4builds/B1/src/B1SteppingAction.cc
make[2]: *** No rule to make target '/usr/lib64/libexpat.so', needed by 'exampleB1'.  Stop.
make[2]: Leaving directory '/1/home/walterms/geant4builds/B1-build'
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/exampleB1.dir/all' failed
make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2
make[1]: Leaving directory '/1/home/walterms/geant4builds/B1-build'
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

仍然输了。

1 个答案:

答案 0 :(得分:2)

我设法构建了安装库后引用的B1示例。

我提取了geant4.10.00.p01.tar.gz。

然后

mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=../geant4-install ../geant4.10.00.p01 && \
make -j8 && make install

然后我执行了

source ./geant4.sh

在geant4-install / bin。

我按如下方式构建B1样本:

cd geant4.10.00.p01/examples/basic/B1 && \
mkdir build && cd build && cmake ../ && make

这个构建的链接了这个例子。

再次..你安装了libexpat吗? /usr/lib64/libexpat.so指向一个有效的共享库?