lhapdf6 installation problem

Asked by Sahabub Jahedi

Hi,

I am having some problem in installing lhapdf6 within Madgraph. I am getting the following error message;

configure: error: in `/tmp/tmpbq74l7fy/LHAPDF-6.5.4':
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LIBS environment variable.
  Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution. The exact name of this package varies among them.
  ============================================================================

See `config.log' for more details
 Compile LHAPDF6
make: *** No targets specified and no makefile found. Stop.
 Install LHAPDF6
make: *** No rule to make target 'install'. Stop.
copy index and conf file
cp: missing destination file operand after '/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/lhapdf6_py3//share/LHAPDF/'
Try 'cp --help' for more information.
cp: missing destination file operand after '/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/lhapdf6_py3//share/LHAPDF/'
Try 'cp --help' for more information.

Command "install lhapdf6" interrupted with error:
InvalidCmd : Installation of lhapdf6_py3 failed.

Any help would be highly appreciated.

Regards,
Sahabub

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Sahabub Jahedi
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

What is your OS?
This error was quite common on mac machine, but our installer is currently patching lhapdf6.x in order to include a patch that will be include in the next version of lhapdf.

So from here they are multiple road:
1) you are on mac but the patch is not enough (or not working)
2) you are on unix and would also need the patch
3) you are on unix but do not have the devel package for python installed (the command to run depends of your system)

In any case, it could be good to try to install it manually (so without any patch if you are on mac) to see if you can reproduce the error. In that case, it would be worth reporting to lhapdf author which can likely be more helpful than us.

Cheers,

Olivier

Revision history for this message
Sahabub Jahedi (sabuj27) said :
#2

Thank you so much for your quick reply.

I am using 18.04 Ubuntu as an operating system. I have tried installing lhapdf manually and then tried to configure it, but it didn't work out. Could you suggest another way to sort it out?

Regards,
Sahabub

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Did you check this link:
https://askubuntu.com/questions/1197683/how-do-i-install-python-3-8-in-lubuntu-18-04
How do I install Python 3.8 in Lubuntu 18.04?
askubuntu.com

Cheers,

Olivier

> On 10 Jun 2024, at 17:40, Sahabub Jahedi <email address hidden> wrote:
>
> Question #816211 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/816211
>
> Status: Answered => Open
>
> Sahabub Jahedi is still having a problem:
> Thank you so much for your quick reply.
>
> I am using 18.04 Ubuntu as an operating system. I have tried installing
> lhapdf manually and then tried to configure it, but it didn't work out.
> Could you suggest another way to sort it out?
>
> Regards,
> Sahabub
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Sahabub Jahedi (sabuj27) said :
#4

Hi,
     Thanks for the suggestion. It did solve the issue of downloading lhapdf6, and after that, I installed phythia8 as well. However, I could not install mg5amc_py8_interface. I get the following error:

MG5aMC_PY8_interface compilation output log:
b"g++ MG5aMC_PY8_interface.cc -o MG5aMC_PY8_interface -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/include -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//include -ldl -fPIC -lstdc++ -std=c++11 -O2 -DHEPMC2HACK -DGZIP -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/include -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/lib -lz -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib -lpythia8 -ldl -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/lib -lHepMC\n/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib/libpythia8.so: undefined reference to `pthread_create'\ncollect2: error: ld returned 1 exit status\nMakefile_mg5amc_py8_interface_static:8: recipe for target 'MG5aMC_PY8_interface' failed\nmake: *** [MG5aMC_PY8_interface] Error 1\n"
------------------------------------------------
Error during the compilation of MG5aMC_PY8_interface:
b"g++ MG5aMC_PY8_interface.cc -o MG5aMC_PY8_interface -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/include -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//include -ldl -fPIC -lstdc++ -std=c++11 -O2 -DHEPMC2HACK -DGZIP -I/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/include -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/zlib/lib -lz -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib -lpythia8 -ldl -L/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/lib -Wl,-rpath,/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/hepmc/lib -lHepMC\n/home/sahabub/Packages/MG5_aMC_v3_5_4/HEPTools/pythia8//lib/libpythia8.so: undefined reference to `pthread_create'\ncollect2: error: ld returned 1 exit status\nMakefile_mg5amc_py8_interface_static:8: recipe for target 'MG5aMC_PY8_interface' failed\nmake: *** [MG5aMC_PY8_interface] Error 1\n"

Please look into it.

Regards,
Sahabub

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

This is an error that has been reported three times recently, not sure if this is a change of policy of pythia8 or a change of policy of Ubuntu. (I guess that this is pythia8)

Here the link that I can provide is this one:

https://www.squash.io/how-to-fix-undefined-reference-to-pthread_create-in-linux/

that we did investigate in this (messy) thread:
https://answers.launchpad.net/mg5amcnlo/+question/816173

So in short:
 if the first command (sudo apt-get install libpthread-stubs0-dev)to install pthread of your system has no effect (or is not enough):
If that does not help, maybe you should edit the file
HepTools/MG5aMC_PY8_interface/Makefile_mg5amc_py8_interface_static
Then you should add the -ptrhead when compiling
and then recompile the directory with the command:
python compile.py ../pythia8/

Cheers,

Olivier

Revision history for this message
Sahabub Jahedi (sabuj27) said :
#6

Thank you so much. This did solve my issue.

Regards,
Sahabub

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#7

Just for my information (and to see if I can try to improve the situation)
Was
sudo apt-get install libpthread-stubs0-dev
enough?
or did you need to change the makefile?

Cheers,

olivier

Revision history for this message
Sahabub Jahedi (sabuj27) said :
#8

I have edited the make file. After that, I was able to install further files.

Regards,
Sahabub