make compiler not working

Asked by Marco Merchand

Dear Experts

I was using micromegas for a long time and suddenly i get the following error message:
/Library/Developer/CommandLineTools/usr/bin/make -C CalcHEP_src MICROMEGAS=MICROMEGAS
./getFlags
C compiler detected
can not generate shared library
tring to add -fPIC option
.. it does not help
make[1]: *** [flags] Error 1
make: *** [all] Error 2
 when I hit:
 > make
on its directory

how can I fix this?

thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
CalcHEP Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Belyaev
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Pukhov (pukhov) said :
#1

Dear Marco, Thank a lot for your mail.

I do not know the answer because output is hidden (by me).

Directory CalcHEP_src  contains  BASH script   getFlags  which tests
compiler options.  Depending of operation system getFlags uses
gcc(Linux) of clang.  In partiqular is tries to compile shared library.
The following flag is used  to create  shared: -shared(Linux)  and
-dynamiclib(Darwin).  You can find this command at line 466

$CC $CFLAGS $SHARED -o test.$SO  test.c  1>/dev/null 2>/dev/null

Honestly this command never work on modern computers and one has to add
the -f Pic flag  that is done several lines below

  CFLAGS="$CFLAGS -fPIC"

  $CC $CFLAGS $SHARED -o test.$SO  test.c  1>/dev/null 2>/dev/null

I propose  to remove redirection in the end of command and keep

  $CC $CFLAGS $SHARED -o test.$SO  test.c

to see actuall command and error message.

Any C-compiler has to have an option to generate shared libraries. If
for some reason   your compiler requires non-standard flag to generate
shared library  you can add it via  definition of  CFLAGS in file
FlagsForSh. If this file exists, getFlags  reads it and checks compiler
option presented in this file.

I can try to think what happens if you send me details which you will
see removing redirection of output of $CC

Best

    Alexander Pukhov

On 26.01.2020 10:04, Marco Merchand wrote:
> New question #688254 on CalcHEP:
> https://answers.launchpad.net/calchep/+question/688254
>
> Dear Experts
>
> I was using micromegas for a long time and suddenly i get the following error message:
> /Library/Developer/CommandLineTools/usr/bin/make -C CalcHEP_src MICROMEGAS=MICROMEGAS
> ./getFlags
> C compiler detected
> can not generate shared library
> tring to add -fPIC option
> .. it does not help
> make[1]: *** [flags] Error 1
> make: *** [all] Error 2
> when I hit:
> > make
> on its directory
>
> how can I fix this?
>
> thanks in advance
>

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

Dear Marco,
did this solve your problem?
Alexander

Revision history for this message
Marco Merchand (mamerchandmedi) said :
#3

Thanks Alexander Belyaev, that solved my question.