Error using LHAPDF in MadGraph version 2.4.1.beta

Bug #1572586 reported by Mamutjan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Invalid
Undecided
marco zaro

Bug Description

Dear experts,

I had this error while running MadGraph version 2.4.1.beta with LHAPDF6.1.6.

I used the following commands:
generate p p > e+ e-
output
launch

set pdlabel lhapdf
set lhaid 244600

Then I got the attached error messages.

I also tried the same commands using MG5_aMC_v2_3_3 and got the correct result.

Regards
Mamut

Revision history for this message
Mamutjan (mamutjan) wrote :
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1572586] [NEW] Error using LHAPDF in MadGraph version 2.4.1.beta

Thanks a lot for reporting this,
Can you indicate which operating system are you using?

Cheers,

Olivier
> On Apr 20, 2016, at 15:54, Mamutjan <mamutjan@126.com> wrote:
>
> Public bug reported:
>
> Dear experts,
>
> I had this error while running MadGraph version 2.4.1.beta with
> LHAPDF6.1.6.
>
> I used the following commands:
> generate p p > e+ e-
> output
> launch
>
> set pdlabel lhapdf
> set lhaid 244600
>
> Then I got the attached error messages.
>
> I also tried the same commands using MG5_aMC_v2_3_3 and got the correct
> result.
>
> Regards
> Mamut
>
> ** Affects: mg5amcnlo
> Importance: Undecided
> Status: New
>
> ** Attachment added: "ME5_debug"
> https://bugs.launchpad.net/bugs/1572586/+attachment/4640741/+files/ME5_debug
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1572586
>
> Title:
> Error using LHAPDF in MadGraph version 2.4.1.beta
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Dear experts,
>
> I had this error while running MadGraph version 2.4.1.beta with
> LHAPDF6.1.6.
>
> I used the following commands:
> generate p p > e+ e-
> output
> launch
>
> set pdlabel lhapdf
> set lhaid 244600
>
> Then I got the attached error messages.
>
> I also tried the same commands using MG5_aMC_v2_3_3 and got the
> correct result.
>
> Regards
> Mamut
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1572586/+subscriptions

Changed in mg5amcnlo:
assignee: nobody → marco zaro (marco-zaro)
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Marco,

Is it possible that this is linked to the new way that you use to link to lhapdf6?

Cheers,

Olivier

Revision history for this message
Mamutjan (mamutjan) wrote :

Hi

The OS that I am using is 14.04.1-Ubuntu x64.

Regards
Mamut

Revision history for this message
marco zaro (marco-zaro) wrote :

Hi mamut
what do you have for the LDFLAGS inside Source/make_opts?
it should be lstdc++ (set around line 40, inside an ifdef statament)

Otherwise, can you try to set if outside the ifdef statament
LDFLAGS=lstdc++

Let us know...
Cheers,

MArco

Revision history for this message
Mamutjan (mamutjan) wrote : Re:[Bug 1572586] Re: Error using LHAPDF in MadGraph version 2.4.1.beta

Hi Marco

Thank you for your reply.
The LDFLAGS is set to lstdc++ inside ifeq statement in line48.
Here is the content of make_opts:
-------------------------------------------------begin-----------------------------------------------------------
DEFAULT_F2PY_COMPILER=f2py
DEFAULT_F_COMPILER=gfortran
MACFLAG=
DEFAULT_CPP_COMPILER=g++
STDLIB=-lstdc++
STDLIB_FLAG=
#end_of_make_opts_variables
# Rest of the makefile

ifeq ($(origin FFLAGS),undefined)
FFLAGS= -O -w -fbounds-check -fPIC
#FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall
endif

# REMOVE MACFLAG IF NOT ON MAC OR FOR F2PY
UNAME := $(shell uname -s)
ifdef f2pymode
MACFLAG=
else
ifneq ($(UNAME), Darwin)
MACFLAG=
endif
endif

ifeq ($(origin CXXFLAGS),undefined)
CXXFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
endif

ifeq ($(origin CFLAGS),undefined)
CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
endif

# Increase the number of allowed charcters in a Fortran line
FFLAGS+= -ffixed-line-length-132

# Set FC unless it's defined by an environment variable
ifeq ($(origin FC),default)
FC=gfortran
endif
ifeq ($(origin F2PY), undefined)
F2PY=f2py
endif

UNAME := $(shell uname -s)
ifeq ($(origin LDFLAGS), undefined)
LDFLAGS=$(STDLIB) $(MACFLAG) #<<<<<<<<<here
endif

# Options: dynamic, lhapdf
# Option dynamic

ifeq ($(UNAME), Darwin)
dylibext=dylib
else
dylibext=so
endif

ifdef dynamic
ifeq ($(UNAME), Darwin)
libext=dylib
FFLAGS+= -fno-common
LDFLAGS += -bundle
define CREATELIB
$(FC) -dynamiclib -undefined dynamic_lookup -o $(1) $(2)
endef
else
libext=so
FFLAGS+= -fPIC
LDFLAGS += -shared
define CREATELIB
$(FC) $(FFLAGS) $(LDFLAGS) -o $(1) $(2)
endef
endif
else
libext=a
define CREATELIB
$(AR) cru $(1) $(2)
ranlib $(1)
endef
endif

# Option lhapdf

ifdef lhapdf
CXXFLAGS += $(shell $(lhapdf) --cppflags)
alfas_functions=alfas_functions_lhapdf
llhapdf+= -lLHAPDF
else
alfas_functions=alfas_functions
llhapdf=
endif

---------------------------------------------------------end------------------------------------

Could you tell me more specifically where to put that line?
Thank you.

Regards
Mamut

At 2016-04-21 19:43:29, "marco zaro" <email address hidden> wrote:
>Hi mamut
>what do you have for the LDFLAGS inside Source/make_opts?
>it should be lstdc++ (set around line 40, inside an ifdef statament)
>
>Otherwise, can you try to set if outside the ifdef statament
>LDFLAGS=lstdc++
>
>Let us know...
>Cheers,
>
>MArco
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1572586
>
>Title:
> Error using LHAPDF in MadGraph version 2.4.1.beta
>
>Status in MadGraph5_aMC@NLO:
> New
>
>Bug description:
> Dear experts,
>
> I had this error while running MadGraph version 2.4.1.beta with
> LHAPDF6.1.6.
>
> I used the following commands:
> generate p p > e+ e-
> output
> launch
>
> set pdlabel lhapdf
> set lhaid 244600
>
> Then I got the attached error messages.
>
> I also tried the same commands using MG5_aMC_v2_3_3 and got the
> correct result.
>
> Regards
> Mamut
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/mg5amcnlo/+bug/1572586/+subscriptions

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Dear Mamut,

Marco is currently offline for a little while, so he ask me to replace him on this thread.

The problem seems to be a bad linking to lhapdf.
Could you try the following:

1) run
lhapdf-config --libs
(I guess that lhapdf-config is not in your path so you need to specify the path that you specify in madgraph)

2) then replace the line llhapdf+= -lLHAPDF (In Source/make_opts)
by
llhapdf+= ANSWER_TO_THE_PREVIOUS_COMMAND

for example in my case:
[~]$ lhapdf-config --libs
-L/usr/local/lib -lLHAPDF

so I set
llhapdf+= -L/usr/local/lib -lLHAPDF

If it works, then i will automate such changes.

Cheers,

Olivier

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Mamut,

I also found this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14001
which seems to indicate that the problem can related to a bug in gcc/g++

I quote them:
"""the problem is enable-version-specific-runtime-libs is broken for 3.4.0
and 3.5.0."""
Those are quite old version, so this is unlikely that you have one of the those versions, but can you check?
If that's the problem please update to a more recent version of gcc.

Cheers,

Olivier

Changed in mg5amcnlo:
status: New → Incomplete
Revision history for this message
Tao Xu (taoxu) wrote :

Hi Olivier

I was using LHAPDF6.1.6 installed with Homebrew and errors occurred when compiling Source Directory.

At first, I thought it was because Homebrew compiled LHAPDF with its own compiler so I tried to compile LHAPDF with gcc-4.9. After recompiling it, I could link the external PDFs to MadGraph version 2.3.3, though some of the cross-section results are anomalously large.

However, I still can't use MadGraph version 2.4.0 with external PDFs. I tried, as you have mentioned above, to set "llhapdf+" in Source/make_opts, but it didn't work in my case.

I don't know the exact difference between version 2.3.3 and 2.4.0 in linking LHAPDF. Could you help me with this?

Thanks a lot!

Regards,

Tao

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Tao,

Sure I can help you.
What is the compilation error that you face?

Cheers,

Olivier

Revision history for this message
Tao Xu (taoxu) wrote :

Hi Olivier,

Thanks.
I have attached the debug_log file.
I'm now using mac OS X 10.11 EI Capitan. I'm not sure whether the problem is related to the OS. LHAPDF installation with homebrew works well on OS X 10.9 and 10.10, but my colleague met the same problem as mine on 10.11.

Regards,
Tao

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1572586] Error using LHAPDF in MadGraph version 2.4.1.beta

Hi Tao,

The problem is likely due to the standard library routine.
Your compilation file seems to link to -lstdc++ which is the standard library routine provided by gcc.
By experience lhapdf compile with -lc++ which is the standard library of clang++ (the mac equivalent of gcc).
Now I have no idea if home-brew compile lhapdf with -lc++ or with -lstdc++.

I’m actually also using mac OS X 10.11 with 2.4.0 and in my case just rely on clang and therefore everything is compiled with -lc++
and everything is fine. My guess is that you have install (via home-brew?) the gcc program and made it default. (is it the case?)

Consequently, one way to fix the problem is to force to use clang.
by first running inside the madgraph shell
set cpp_compiler clang

Cheers,

Olivier

> On Jun 8, 2016, at 06:07, Tao Xu <email address hidden> wrote:
>
> Hi Olivier,
>
> Thanks.
> I have attached the debug_log file.
> I'm now using mac OS X 10.11 EI Capitan. I'm not sure whether the problem is related to the OS. LHAPDF installation with homebrew works well on OS X 10.9 and 10.10, but my colleague met the same problem as mine on 10.11.
>
> Regards,
> Tao
>
> ** Attachment added: "compilation error in version_2_4_0"
> https://bugs.launchpad.net/mg5amcnlo/+bug/1572586/+attachment/4679421/+files/run_02_tag_1_debug.log
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1572586
>
> Title:
> Error using LHAPDF in MadGraph version 2.4.1.beta
>
> Status in MadGraph5_aMC@NLO:
> Incomplete
>
> Bug description:
> Dear experts,
>
> I had this error while running MadGraph version 2.4.1.beta with
> LHAPDF6.1.6.
>
> I used the following commands:
> generate p p > e+ e-
> output
> launch
>
> set pdlabel lhapdf
> set lhaid 244600
>
> Then I got the attached error messages.
>
> I also tried the same commands using MG5_aMC_v2_3_3 and got the
> correct result.
>
> Regards
> Mamut
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1572586/+subscriptions

Revision history for this message
Tao Xu (taoxu) wrote :

Hi Olivier,

You're right. The problem seems to be with gcc. I installed my local gcc and again used brew for a different version. So there're several versions of gcc on my laptop.

Anyway, I have recompiled lhapdf with clang and set cpp_compiler to clang in MG5, the problem is solved after that in both versions.

Thanks a lot!

Regards,
Tao

Changed in mg5amcnlo:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.