Python 3 + ROOT 설치시 나오는 에러
글쓴이: parkon / 작성시간: 수, 2016/12/21 - 9:20오후
안녕하세요,
우분투에서 python 3 와 연동되어서 돌아가는 ROOT (ver. 6.08.02) 설치를 하려고 하는데
자꾸 에러가 뜨는군요.
cmake ../root_src -DCMAKE_INSTALL_PREFIX=/usr/local/root \ -DPYTHON_EXECUTABLE=$HOME/.pyenv/shims/python \ -DPYTHON_INCLUDE_DIR=$HOME/.pyenv/versions/3.5.2/include/python3.5m \ -DPYTHON_LIBRARY=$HOME/.pyenv/versions/3.5.2/lib/libpython3.5.so \ -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
하고 (이건 어디 매뉴얼에 나와 있는 내용),
cmake --build . (혹은 make)하면
잘 나가다가,
... [ 96%] Built target pq2 [ 96%] Built target Html [ 96%] Built target VMC Scanning dependencies of target EGPythia8 [ 96%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/G__Pythia8.cxx.o [ 96%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o [ 96%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o [ 96%] Linking CXX shared library ../../lib/libEGPythia8.so CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `TPythia8Decayer::TPythia8Decayer()': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8Decayer.cxx:40: undefined reference to `Pythia8::Pythia::readString(std::string, bool)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::TPythia8()': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:102: undefined reference to `Pythia8::Pythia::Pythia(std::string, bool)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::TPythia8(char const*)': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:119: undefined reference to `Pythia8::Pythia::Pythia(std::string, bool)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::ReadString(char const*) const': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:301: undefined reference to `Pythia8::Pythia::readString(std::string, bool)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::ReadConfigFile(char const*) const': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:309: undefined reference to `Pythia8::Pythia::readFile(std::string, bool, int)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::Settings::listAll(std::ostream&)': /usr/include/Pythia8/Pythia8/Settings.h:203: undefined reference to `Pythia8::Settings::list(bool, bool, std::string, std::ostream&)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::Settings::listChanged(std::ostream&)': /usr/include/Pythia8/Pythia8/Settings.h:205: undefined reference to `Pythia8::Settings::list(bool, bool, std::string, std::ostream&)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::Initialize(int, int, double)': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:151: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:152: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:153: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:154: undefined reference to `Pythia8::Settings::parm(std::string, double)' CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::Initialize(int, int, double, double)': /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:169: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:170: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:171: undefined reference to `Pythia8::Settings::mode(std::string, int)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:172: undefined reference to `Pythia8::Settings::parm(std::string, double)' /home/myid/src/src-root/root-6.08.02-src/montecarlo/pythia8/src/TPythia8.cxx:173: undefined reference to `Pythia8::Settings::parm(std::string, double)' collect2: error: ld returned 1 exit status montecarlo/pythia8/CMakeFiles/EGPythia8.dir/build.make:177: recipe for target 'lib/libEGPythia8.so' failed make[2]: *** [lib/libEGPythia8.so] Error 1 CMakeFiles/Makefile2:20600: recipe for target 'montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all' failed make[1]: *** [montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2
이런 식의 에러를 내면서 죽습니다.
Makefile에서 저 부분에 해당되는 부분은
#============================================================================= # Target rules for targets named G__Pythia8 # Build rule for target. G__Pythia8: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 G__Pythia8 .PHONY : G__Pythia8 # fast build rule for target. G__Pythia8/fast: $(MAKE) -f montecarlo/pythia8/CMakeFiles/G__Pythia8.dir/build.make montecarlo/pythia8/CMakeFiles/G__Pythia8.dir/build .PHONY : G__Pythia8/fast #============================================================================= # Target rules for targets named EGPythia8 # Build rule for target. EGPythia8: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 EGPythia8 .PHONY : EGPythia8 # fast build rule for target. EGPythia8/fast: $(MAKE) -f montecarlo/pythia8/CMakeFiles/EGPythia8.dir/build.make montecarlo/pythia8/CMakeFiles/EGPythia8.dir/build .PHONY : EGPythia8/fast
로 되어 있고요,
nm montecarlo/pythia8/CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o | grep " U "
해보면 역시 저 파일들이 undefined 함수를 잔뜩 가지고 있다는 것을, 즉 제대로 컴파일 되지 못했음을 알 수 있습니다.
잘은 모릅니다만 저 파일들을 컴파일할때 LIBRARY_PATH 등을 제대로 해 주지 못해서 생긴 문제인것 같은데요,
cmake도 안 익숙하고, python도 안 익숙하고, 암튼 잘 모르겠네요.
어떻게 해야 할까요 ?
힌트라도 주시면 감사하겠습니다.
아, gcc version은
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
입니다.
Forums:
댓글 달기