The value for lhapdf in the current configuration does not correspond to a valid executable.

Asked by amir

Dear MadGraph developers

I've installed MG5_aMC_v2_5_2 and after installation I tried to connect lhapdf to MG5 but after compilation I've got :
The value for lhapdf in the current configuration does not correspond to a valid executable.
I'm sure there is an executable lhapdf-config file but yet I have problem with that:
save configuration file to /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt
INFO: The value for lhapdf in the current configuration does not correspond to a valid executable.
Please set it correctly either in input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" and regenrate the process.
To avoid regeneration, edit the /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt file.
Note that you can still compile and run aMC@NLO with the built-in PDFs.
so can you help me in this?

Best
Amir

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

Hi,

Did you set the path to the lhapdf-config file or to the directory that contains it?
You should do the first and not the second.

Cheers,

Olivier
> On 18 Jan 2017, at 18:13, amir <email address hidden> wrote:
>
> New question #443813 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/443813
>
> Dear MadGraph developers
>
> I've installed MG5_aMC_v2_5_2 and after installation I tried to connect lhapdf to MG5 but after compilation I've got :
> The value for lhapdf in the current configuration does not correspond to a valid executable.
> I'm sure there is an executable lhapdf-config file but yet I have problem with that:
> save configuration file to /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt
> INFO: The value for lhapdf in the current configuration does not correspond to a valid executable.
> Please set it correctly either in input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" and regenrate the process.
> To avoid regeneration, edit the /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt file.
> Note that you can still compile and run aMC@NLO with the built-in PDFs.
> so can you help me in this?
>
> Best
> Amir
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

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

Hi,

Did you set the path to the lhapdf-config file or to the directory that contains it?
You should do the first and not the second.

Cheers,

Olivier
> On 18 Jan 2017, at 18:13, amir <email address hidden> wrote:
>
> New question #443813 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/443813
>
> Dear MadGraph developers
>
> I've installed MG5_aMC_v2_5_2 and after installation I tried to connect lhapdf to MG5 but after compilation I've got :
> The value for lhapdf in the current configuration does not correspond to a valid executable.
> I'm sure there is an executable lhapdf-config file but yet I have problem with that:
> save configuration file to /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt
> INFO: The value for lhapdf in the current configuration does not correspond to a valid executable.
> Please set it correctly either in input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" and regenrate the process.
> To avoid regeneration, edit the /home/joachim/Desktop/MG5_aMC_v2_5_2/bin/an/Cards/amcatnlo_configuration.txt file.
> Note that you can still compile and run aMC@NLO with the built-in PDFs.
> so can you help me in this?
>
> Best
> Amir
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
amir (amir-shabanpoor92) said :
#3

Hi olivier

I set the path exactly to lhapdf-config file. the path works fine in MG5 v2_3_2_2. I even tried the lhapdf installation with mg5 either but the outcome was same.

Cheers,
Amir

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

Ok,

Can you look at the file input/mg5_configuration.txt and check that it contains the path that you expect?
You can force it there if this is is not set to the correct one.

Cheers,

Olivier
> On 18 Jan 2017, at 20:58, amir <email address hidden> wrote:
>
> Question #443813 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/443813
>
> Status: Answered => Open
>
> amir is still having a problem:
> Hi olivier
>
> I set the path exactly to lhapdf-config file. the path works fine in MG5
> v2_3_2_2. I even tried the lhapdf installation with mg5 either but the
> outcome was same.
>
> Cheers,
> Amir
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
amir (amir-shabanpoor92) said :
#5

Hello

Really sorry for the late answer. I've checked the mg5_configuration.txt and path to lhapdf is also correct

#! lhapdf-config
#! If None: try to find one available on the system
lhapdf = /Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config #

Cheers,
Amir

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

Dear Amir,

What happens when you run the following command?
/Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config --version

We run that command and looks like that it returns an error. Can you check?

Cheers,

Olivier

Revision history for this message
amir (amir-shabanpoor92) said :
#7

Dear Olivier

The output is
Amirs-MacBook-Pro:bin Joachim$ lhapdf-config --version
6.1.6

Cheers,
Amir

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

you type
lhapdf-config --version
and not
/Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config --version

Can you check the second (just to be 100% sure)

Cheers,

Olivier

Revision history for this message
amir (amir-shabanpoor92) said :
#9

Amirs-MacBook-Pro:~ Joachim$ /Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config --version
6.1.6

I've checked this and I've got the version

Cheers,
Amir

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

Hi,

Ok, clearly when called by madgraph this command fails.
I can see multiple reason
1) a problem related with the SIP of Mac which prevent lhapdf-config to find some of the required library
2) MG5 do not use that path for lhapdf

If you run
./bin/mg5_aMC
Then type “display options” did you get the correct path for lhapdf?

For a check of the first(and second)
You can modify the file
madgraph/iolibs/export_fks.py

Around line 733
You should have
        devnull = os.open(os.devnull, os.O_RDWR)
        try:
            res = misc.call([self.options['lhapdf'], '--version'], \
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except Exception:
            res = 1
        if res != 0:
            logger.info<http://logger.info>('The value for lhapdf in the current configuration does not ' + \
                        'correspond to a valid executable.\nPlease set it correctly either in ' + \
                        'input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" ' + \
                        'and regenrate the process. \nTo avoid regeneration, edit the ' + \
                        ('%s/Cards/amcatnlo_configuration.txt file.\n' % self.dir_path ) + \
                        'Note that you can still compile and run aMC@NLO with the built-in PDFs\n’)

You can replace this by
        devnull = os.open(os.devnull, os.O_RDWR)
        Logger.info<http://Logger.info>("LHAPDF_CONFIG call via %s —version :",self.options['lhapdf'] )
        try:
            res = misc.call([self.options['lhapdf'], '--version'])
        except Exception, error:
    print "PYTHON error", str(error)
            res = 1
        if res != 0:
            logger.info<http://logger.info>('The value for lhapdf in the current configuration does not ' + \
                        'correspond to a valid executable.\nPlease set it correctly either in ' + \
                        'input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" ' + \
                        'and regenrate the process. \nTo avoid regeneration, edit the ' + \
                        ('%s/Cards/amcatnlo_configuration.txt file.\n' % self.dir_path ) + \
                        'Note that you can still compile and run aMC@NLO with the built-in PDFs\n')

This should provide you more information about what the problem is.

Cheers,

Olivier

On 20 Mar 2017, at 10:43, amir <<email address hidden><mailto:<email address hidden>>> wrote:

Question #443813 on MadGraph5_aMC@NLO changed:
https://answers.launchpad.net/mg5amcnlo/+question/443813

amir posted a new comment:
Amirs-MacBook-Pro:~ Joachim$ /Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config --version
6.1.6

I've checked this and I've got the version

Cheers,
Amir

--
You received this question notification because you are an answer
contact for MadGraph5_aMC@NLO.

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

Hi,

Ok, clearly when called by madgraph this command fails.
I can see multiple reason
1) a problem related with the SIP of Mac which prevent lhapdf-config to find some of the required library
2) MG5 do not use that path for lhapdf

If you run
./bin/mg5_aMC
Then type “display options” did you get the correct path for lhapdf?

For a check of the first(and second)
You can modify the file
madgraph/iolibs/export_fks.py

Around line 733
You should have
        devnull = os.open(os.devnull, os.O_RDWR)
        try:
            res = misc.call([self.options['lhapdf'], '--version'], \
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except Exception:
            res = 1
        if res != 0:
            logger.info<http://logger.info/>('The value for lhapdf in the current configuration does not ' + \
                        'correspond to a valid executable.\nPlease set it correctly either in ' + \
                        'input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" ' + \
                        'and regenrate the process. \nTo avoid regeneration, edit the ' + \
                        ('%s/Cards/amcatnlo_configuration.txt file.\n' % self.dir_path ) + \
                        'Note that you can still compile and run aMC@NLO with the built-in PDFs\n’)

You can replace this by
        devnull = os.open(os.devnull, os.O_RDWR)
        Logger.info<http://logger.info/>("LHAPDF_CONFIG call via %s —version :",self.options['lhapdf'] )
        try:
            res = misc.call([self.options['lhapdf'], '--version'])
        except Exception, error:
    print "PYTHON error", str(error)
            res = 1
        if res != 0:
            logger.info<http://logger.info/>('The value for lhapdf in the current configuration does not ' + \
                        'correspond to a valid executable.\nPlease set it correctly either in ' + \
                        'input/mg5_configuration or with "set lhapdf /path/to/lhapdf-config" ' + \
                        'and regenrate the process. \nTo avoid regeneration, edit the ' + \
                        ('%s/Cards/amcatnlo_configuration.txt file.\n' % self.dir_path ) + \
                        'Note that you can still compile and run aMC@NLO with the built-in PDFs\n')

This should provide you more information about what the problem is.

Cheers,

Olivier

On 20 Mar 2017, at 10:43, amir <<email address hidden><mailto:<email address hidden>>> wrote:

Question #443813 on MadGraph5_aMC@NLO changed:
https://answers.launchpad.net/mg5amcnlo/+question/443813

amir posted a new comment:
Amirs-MacBook-Pro:~ Joachim$ /Users/Joachim/Desktop/deps/lhapdf/bin/lhapdf-config --version
6.1.6

I've checked this and I've got the version

Cheers,
Amir

--
You received this question notification because you are an answer
contact for MadGraph5_aMC@NLO.

Revision history for this message
amir (amir-shabanpoor92) said :
#12

Dear Olivier

I've checked export_fks.py and in line 734 you should change self.option to mg5option. cause of this line we have the error just like
AttributeError : 'ProcessOptimizedExporterFortranFKS' object has no attribute 'options'
so after determine the changes the problem solved

Cheers,
Amir

Can you help with this problem?

Provide an answer of your own, or ask amir for more information if necessary.

To post a message you must log in.