installing LHAPDF-6.1.6

Asked by Burhani Taher Saifuddin

Hello,

I am trying to install LHAPDF-6.1.6 but don't know how to do it.

I am following the tutorial as given on https://lhapdf.hepforge.org/install.html but don't quite know how to do the second step. That is the ./configure here what path should I give?

Also, I gave a path to HEPTOOLS later and went to step 2 which is make. But this is the error I get.

Making all in src
make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
Making all in yamlcpp
make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src/yamlcpp'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src/yamlcpp'
make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
Making all in include
make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
Making all in LHAPDF
make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
make all-am
make[3]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
make[3]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
Making all in wrappers
make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers'
Making all in python
make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers/python'
CC=gcc CXX=g++ /usr/bin/python setup.py install --install-lib=build/ --force
running install
running build
running build_ext
building 'lhapdf' extension
gcc -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -ffile-prefix-map=/build/python2.7-W40Ff2/python2.7-2.7.18=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/taherburhani/madgraph2.9.5/LHAPDF-6.1.6/include -I/home/taherburhani/madgraph2.9.5/LHAPDF-6.1.6/include -I/usr/include/python2.7 -c lhapdf.cpp -o build/temp.linux-x86_64-2.7/lhapdf.o -I/home/tb/local/include
lhapdf.cpp:4:10: fatal error: Python.h: No such file or directory
    4 | #include "Python.h"
      | ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
make[2]: *** [Makefile:483: all-local] Error 1
make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers/python'
make[1]: *** [Makefile:374: all-recursive] Error 1
make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers'
make: *** [Makefile:549: all-recursive] Error 1

Thanks

Question information

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

Looks like your python version does not have the developper header needed by lhapdf to be able to link to python.

Given that you use python2, this might be difficult to fix.

Cheers,

Olivier

> On 24 Mar 2023, at 19:20, Burhani Taher Saifuddin <email address hidden> wrote:
>
> New question #705937 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/705937
>
> Hello,
>
> I am trying to install LHAPDF-6.1.6 but don't know how to do it.
>
> I am following the tutorial as given on https://lhapdf.hepforge.org/install.html but don't quite know how to do the second step. That is the ./configure here what path should I give?
>
> Also, I gave a path to HEPTOOLS later and went to step 2 which is make. But this is the error I get.
>
> Making all in src
> make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
> Making all in yamlcpp
> make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src/yamlcpp'
> make[2]: Nothing to be done for 'all'.
> make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src/yamlcpp'
> make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
> make[2]: Nothing to be done for 'all-am'.
> make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
> make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/src'
> Making all in include
> make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
> Making all in LHAPDF
> make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
> make all-am
> make[3]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
> make[3]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
> make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include/LHAPDF'
> make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
> make[2]: Nothing to be done for 'all-am'.
> make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
> make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/include'
> Making all in wrappers
> make[1]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers'
> Making all in python
> make[2]: Entering directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers/python'
> CC=gcc CXX=g++ /usr/bin/python setup.py install --install-lib=build/ --force
> running install
> running build
> running build_ext
> building 'lhapdf' extension
> gcc -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -ffile-prefix-map=/build/python2.7-W40Ff2/python2.7-2.7.18=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/taherburhani/madgraph2.9.5/LHAPDF-6.1.6/include -I/home/taherburhani/madgraph2.9.5/LHAPDF-6.1.6/include -I/usr/include/python2.7 -c lhapdf.cpp -o build/temp.linux-x86_64-2.7/lhapdf.o -I/home/tb/local/include
> lhapdf.cpp:4:10: fatal error: Python.h: No such file or directory
> 4 | #include "Python.h"
> | ^~~~~~~~~~
> compilation terminated.
> error: command 'gcc' failed with exit status 1
> make[2]: *** [Makefile:483: all-local] Error 1
> make[2]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers/python'
> make[1]: *** [Makefile:374: all-recursive] Error 1
> make[1]: Leaving directory '/home/tb/madgraph2.9.5/LHAPDF-6.1.6/wrappers'
> make: *** [Makefile:549: all-recursive] Error 1
>
> Thanks
>
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Burhani Taher Saifuddin (taher64786) said :
#2

I use python3

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

But why are trying to compile lhapdf for python2 then?
That's maybe what you have to fix.
If you need help on that, you might need to read the INSTALL file (or the manual of lhapdf6)
or ask lhapdf6 authors

Cheers,

Olivier

> On 24 Mar 2023, at 21:55, Burhani Taher Saifuddin <email address hidden> wrote:
>
> Question #705937 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705937
>
> Status: Answered => Open
>
> Burhani Taher Saifuddin is still having a problem:
> I use python3
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Burhani Taher Saifuddin (taher64786) said :
#4

Hello,

I was able to install LHAPDF successfully and have done all that was said on the INSTALL file. However, when I run a madgraph process, it tells me that it isn't able to link python with lhapdf.

When I do python2 on my command line, and do import lhapdf it works perfectly.

Python 2.7.18 (default, Jul 1 2022, 10:30:50)
[GCC 11.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lhapdf

Also this works on my terminal too

lhapdf-config --help and lhapdf list

I am using this lhapdf

# CT14LO
      lhapdf = pdlabel ! PDF set
      13205 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number

in my run_card.dat file.

This is the error I get when I run a madgraph job

Failed to access python version of LHAPDF: If the python interface to LHAPDF is available on your system, try adding its location to the PYTHONPATH environment variable and theLHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).The required LD_LIBRARY_PATH is /home/taherburhani/madgraph2.9.5/lhapdf6.1.6/lhapdf6/lib

Can you help? What can I do more?

Thanks!

Revision history for this message
Burhani Taher Saifuddin (taher64786) said :
#5

Hello,

I was able to install LHAPDF successfully and have done all that was said on the INSTALL file. However, when I run a madgraph process, it tells me that it isn't able to link python with lhapdf.

When I do python2 on my command line, and do import lhapdf it works perfectly.

Python 2.7.18 (default, Jul 1 2022, 10:30:50)
[GCC 11.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lhapdf

Also this works on my terminal too

lhapdf-config --help and lhapdf list

I am using this lhapdf

# CT14LO
      lhapdf = pdlabel ! PDF set
      13205 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number

in my run_card.dat file.

This is the error I get when I run a madgraph job

Failed to access python version of LHAPDF: If the python interface to LHAPDF is available on your system, try adding its location to the PYTHONPATH environment variable and theLHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).The required LD_LIBRARY_PATH is /home/taherburhani/madgraph2.9.5/lhapdf6.1.6/lhapdf6/lib

Can you help? What can I do more?

Thanks!

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

You have compile lhapdf for python2 linking and not for python3 linking and therefore you can not use lhapdf from python3.

Cheers,

Olivier

Revision history for this message
Burhani Taher Saifuddin (taher64786) said :
#7

Any idea how I can link it to python3?

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

Did you check the option of the configure script? They are likely one option to specify the version of python to use.

Cheers,

Olivier

> On 26 Mar 2023, at 15:50, Burhani Taher Saifuddin <email address hidden> wrote:
>
> Question #705937 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/705937
>
> Status: Answered => Open
>
> Burhani Taher Saifuddin is still having a problem:
> Any idea how I can link it to python3?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

Provide an answer of your own, or ask Burhani Taher Saifuddin for more information if necessary.

To post a message you must log in.