nt_maker how to???

Asked by ahh

HI CH Authers
i read the question by Angel , i followed the instructions by dr Niel but it gives me
gfortran -static -Iinclude -o ../../bin/nt_maker nt_maker_02.F readLHE.c -L/usr/CERN/2006b/x86_64-slc5-gcc34-opt/bin/ -lpacklib -lkernlib
/bin/ld: cannot find -lpacklib
/bin/ld: cannot find -lkernlib
/bin/ld: cannot find -lgfortran
/bin/ld: cannot find -lm
/bin/ld: cannot find -lquadmath
/bin/ld: cannot find -lm
/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: [../../bin/nt_maker] Error 1 (ignored)
iam using fedora 17 , and i got the cern lib installed when i type export it gives me
[root@localhost mix_events]# export
declare -x CERN="/cern"
declare -x CERN_ROOT="/usr/CERN/2006b/"
declare -x DISPLAY=":0"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="localhost.localdomain"
declare -x KDEDIRS="/usr"
declare -x KDE_IS_PRELINKED="1"
declare -x LANG="en_US.UTF-8"
declare -x LD_LIBRARY_PATH=":/usr/local/lib/:/usr/work/root/lib/:/usr/local/fastjet-3.0.4/lib/"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOADEDMODULES=""
declare -x LOGNAME="root"
is there any help???

Question information

English Edit question
CalcHEP Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Alexander Pukhov (pukhov) said :

Your path to CernLib has to be finished by /lib , not /bin

    Alexander Pukhov

Revision history for this message
ahh (ahh) said :

HI Dr Alexander
thans for reply
i have modified the path ,but still gives me
gfortran -static -Iinclude -o ../../bin/nt_maker nt_maker_02.F readLHE.c -L/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib/ -lpacklib -lkernlib
/bin/ld: cannot find -lgfortran
/bin/ld: cannot find -lm
/bin/ld: cannot find -lquadmath
/bin/ld: cannot find -lm
/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: [../../bin/nt_maker] Error 1 (ignored)

while i copied the content of lib from CERN library it be
cojets.dat libeurodec.a libjetset74.a libpacklib-shift.a
eurodec.dat libfritiof.a libkernlib.a libpawlib.a
flukaaf.dat libgeant321.a libkernlib_noshift.a libpdflib804.a
gxint321.f libgeant.a libkernlib-shift.a libphotos202.a
gxint.f libgraflib.a liblapack3.a libphtools.a
isajet.dat libgrafX11.a liblepto651.a libpythia6205.a
libariadne.a libherwig59.a libmathlib.a xsneut95.dat
libblas.a libherwig.a libpacklib.a
libcojets.a libisajet758.a libpacklib_noshift.a

Do you think the problem is in CERN lib version or something ???
Thamks alot

Revision history for this message
Alexander Pukhov (pukhov) said :

This mesage means that linker can not find standard system libraties which for sure exist.

Does your gfortran work on some simple example? If yes, try to remove -static.

Revision history for this message
Neil Christensen (neil-christensen-qft) said :

What do you get from "gfortran --version"?

Revision history for this message
ahh (ahh) said :

GNU Fortran (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
Copyright (C) 2012 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

Revision history for this message
ahh (ahh) said :

Hi CH Authors
i removed the static when i try to compile the make file it gives me sevral copies of errors like:
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(zpostm.o): In function `zpostm_':
ccn4yv7t.f:(.text+0x2d): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x37): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0x51): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x8d): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0xa1): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0xc2): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0xfe): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0x112): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0x133): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x150): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0x15a): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0x174): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x191): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0x19b): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0x1b5): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x1d2): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0x1dc): undefined reference to `e_wsfe'
ccn4yv7t.f:(.text+0x1f6): undefined reference to `s_wsfe'
ccn4yv7t.f:(.text+0x213): undefined reference to `do_fio'
ccn4yv7t.f:(.text+0x21d): undefined reference to `e_wsfe'
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(rzallo.o): In function `rzallo_':
cceYlrPq.f:(.text+0x1a4): undefined reference to `s_wsfe'
cceYlrPq.f:(.text+0x1bd): undefined reference to `do_fio'
cceYlrPq.f:(.text+0x1c7): undefined reference to `e_wsfe'
cceYlrPq.f:(.text+0x25d): undefined reference to `s_wsfe'
cceYlrPq.f:(.text+0x276): undefined reference to `do_fio'
cceYlrPq.f:(.text+0x28f): undefined reference to `do_fio'
cceYlrPq.f:(.text+0x299): undefined reference to `e_wsfe'
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(rzdelk.o): In function `rzdelk_':
ccXmqXqR.f:(.text+0x2325): undefined reference to `s_wsfe'
ccXmqXqR.f:(.text+0x232f): undefined reference to `e_wsfe'
ccXmqXqR.f:(.text+0x23c5): undefined reference to `s_wsfe'
ccXmqXqR.f:(.text+0x23cf): undefined reference to `e_wsfe'
ccXmqXqR.f:(.text+0x2483): undefined reference to `s_wsfe'
ccXmqXqR.f:(.text+0x248d): undefined reference to `e_wsfe'
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(rzfile.o): In function `rzfile_':
ccWiz8lc.f:(.text+0x2a3): undefined reference to `s_wsfe'
ccWiz8lc.f:(.text+0x2ad): undefined reference to `e_wsfe'
ccWiz8lc.f:(.text+0x30a): undefined reference to `s_wsfe'
ccWiz8lc.f:(.text+0x327): undefined reference to `do_fio'
ccWiz8lc.f:(.text+0x344): undefined reference to `do_fio'
ccWiz8lc.f:(.text+0x35b): undefined reference to `do_fio'
ccWiz8lc.f:(.text+0x365): undefined reference to `e_wsfe'
ccWiz8lc.f:(.text+0x3fc): undefined reference to `s_wsfe'
ccWiz8lc.f:(.text+0x406): undefined reference to `e_wsfe'
ccWiz8lc.f:(.text+0x555): undefined reference to `s_copy'
ccWiz8lc.f:(.text+0xb57): undefined reference to `s_copy'
ccWiz8lc.f:(.text+0xb80): undefined reference to `s_copy'
ccWiz8lc.f:(.text+0xcb0): undefined reference to `s_cat'
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(rzllok.o): In function `rzllok_':
cc8UUF18.f:(.text+0x20c): undefined reference to `s_wsfe'
cc8UUF18.f:(.text+0x216): undefined reference to `e_wsfe'
cc8UUF18.f:(.text+0x4bb): undefined reference to `s_wsfe'
cc8UUF18.f:(.text+0x4d8): undefined reference to `do_fio'
cc8UUF18.f:(.text+0x4f5): undefined reference to `do_fio'
cc8UUF18.f:(.text+0x512): undefined reference to `do_fio'
cc8UUF18.f:(.text+0x52b): undefined reference to `do_fio'
cc8UUF18.f:(.text+0x535): undefined reference to `e_wsfe'
/usr/CERN/2006b/x86_64-slc5-gcc34-opt/lib//libpacklib.a(rzlock.o): In function `rzlock_':
cc33ZpB9.f:(.text+0x300): undefined reference to `s_wsfe'
cc33ZpB9.f:(.text+0x30a): undefined reference to `e_wsfe'
cc33ZpB9.f:(.text+0x52a): undefined reference to `s_wsfe'
cc33ZpB9.f:(.text+0x547): undefined reference to `do_fio'
cc33ZpB9.f:(.text+0x551): undefined reference to `e_wsfe'
cc33ZpB9.f:(.text+0xa0e): undefined reference to `s_wsfe'
cc33ZpB9.f:(.text+0xa18): undefined reference to `e_wsfe'
cc33ZpB9.f:(.text+0xb4c): undefined reference to `s_wsfe'
cc33ZpB9.f:(.text+0xb56): undefined reference to `e_wsfe'
cc33ZpB9.f:(.text+0xb82): undefined reference to `s_wsfe'
cc33ZpB9.f:(.text+0xb8c): undefined reference to `e_wsfe'

Thanks alot

Revision history for this message
Neil Christensen (neil-christensen-qft) said :

By googling, I have found that some people have had similar trouble with gcc 4.7. The error:

/bin/ld: cannot find -lgfortran

does not look CalcHEP specific to me.

Revision history for this message
Alexander Pukhov (pukhov) said :

The reason is simple.
  e_wsfe and others are F77 fortran funtions. They are not the same as gfortran ones. They come from CernLib which was compiled by F77.

Possible solitions:
                               1) add -lg2c library which contains needed functions.
Its address should be something like /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libg2c.so
Check on your computer. gfortran by default should not know this path.

                                 2) use f77 instead of gfortran. In this case you more likely have to add -lgfortran.
                                       May be also path needs.
                                 3) find CernLib compiled by gFortran.
                                 4) recompile CalCHEP replacing gfortran on f77 and use f77 to collect nt_maker.

Revision history for this message
Alexander Belyaev (alexander.belyaev) said :

Dear Ahmed,

sorry for come late to you problem

1. could you type
echo $CERN
and let us know what it is

2. do you have g77 or f77 installed ?

3. Do you know WHICH CERN library do you have?
     Is it compiled using g77 or gfortran

4. I guess you are trying to link CERN libraries compiled with g77
    using gfortran

to solve the problem you should

a) goto $CALCHEP/c_source/mix_events

b) edit the Makefile


- $(FC) -static -Iinclude -o $@ $^ -L$(CERN) -lpacklib -lkernlib


- g77 -Iinclude -o $@ $^ -L$(CERN) -lpacklib -lkernlib

and making sure that

-- you have g77 complier
-- $CERN variable points to the lib directory
i.e. /cern/pro/2006b/lib/
for example

Please, let us know if this helps

    Sasha Belyaev

Revision history for this message
Alexander Belyaev (alexander.belyaev) said :

One you have edited Makefile,
in the same directory, i.e.

if no errors appear, then you should have
nt_maker created in $CALCHEP/bin directory

Revision history for this message
ahh (ahh) said :

HI CH Authors
i really dont know how to say that , iam very glad for your help ..
its compiled and the excutalble nt_maker apperars in bin directory .
but there is another question , i know that calchep doesnt make distr for decay process .
In GUI in Total width menu one can plot adister for parameter space , can i produce *nt file for this dister

Revision history for this message
Alexander Belyaev (alexander.belyaev) said :

You can use CalCHEP at HEPMDB
to plot distributions including particles in the final state after decay
or use LHE and .nt files locally

.nt or LHE files DO have all particles after their decays