LHAPDF configuration error - 2020.01.02
Nah nah nah nah…
I don’t want to finish this blog anymore, cuz the problem is way beyond my skill set so far. Once I overcome it, I’ll revisit this blog then and post about what I do.
Thanks
1. What I was doing on this bloody night
Who knows!
- OS = Ubuntu 18
- gcc = 5.5.0
- g++ = 5.5.0
- LHAPDF = 6.2.3/6.2.1/6.1.6/6.1.5
1.1 Before I run into this error
别人都告诉我LHAPDF是比较容易装的,我记得我之前装LHAPDF的时候也不觉得难,直到我遇到了今天这台机器。
- LHAPDF-6.2.3
最开始的时候是LHAPDF-6.2.3的安装遇到了问题。老老实实按照LHAPDF installation instructions一步一步来,configure、make、make install都没有遇到什么大问题,但是在调用lhapdf的时候很明显可以看出来LHAPDF没有安装对。
lhapdf install CT14lo
Traceback (most recent call last):
File "/usr/local/bin/lhapdf", line 442, in <module>
for pdf in get_installed_list(options.PDFDIR):
File "/usr/local/bin/lhapdf", line 237, in get_installed_list
import lhapdf
ImportError: libLHAPDF.so: cannot open shared object file: No such file or directory
lhapdf list也会给出同样的错误,说明LHAPDF出了问题。然而lhapdf -h则可以给出LHAPDF的帮助文档,说明LHAPDF只是没有安好,而不是没有安装上。尝试良久,但找不到破解的方法。
一直关照我的小老师提醒了一下,LHAPDF installation instructions上说可以立c++的flag“-std=c++11”。但尝试后就会发现,./configure时并没有-std这个选项,进而改为
./configure CPPFLAGS=c++11 --prefix=/path/for/installation
但结果会变得更加恐怖
$ ./configure CPPFLAGS=c++11 --prefix=/usr/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for sw_vers... no
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/media/ms/Research/PDFit/LHAPDF/LHAPDF-6.2.1':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
最令人挠头的是我明明安装了gcc和g++,但终端却告诉我C++ compiler没在工作。至此,并不知道该怎么办。
- LHAPDF-6.2.1
小老师说,要不咱尝试一下别的版本,看看是不是LHAPDF-6.2.3太新了的缘故。
剩下的明天在写,谢谢!
- LHAPDF-6.1.6/6.1.5