install calcHEP on OS X 10.11

Asked by Teto

Hi,

I am trying to install calcHEP on OS X 10.11 , but when I launch make to compile the package, I get the following

./getFlags
C compiler detected
can not generate shared library
tring to add -fPIC option
.. it does not help
make: *** [flags] Error 1

I tried to change some of the flags in FlagsForSh following https://alexpearce.me/2012/08/installing-root-on-mountain-lion/

CFLAGS=-I/opt/X11/include
CXXFLAGS=-I/opt/X11/include
CPPFLAGS=-I/opt/X11/include

but this doesn't seem to help much. Any ideas about what should I do to fix this ?

Thanks a lot for your help

Question information

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

Here CalcHEP tries to create a shared library using c-source test.c with the following content

#include<stdlib.h>
double *Q=NULL;
void xxx(void)
{ int i;
  Q=(double*) realloc(Q,10*sizeof(double));
  for(i=0;i<10;i++) Q[i]=0;
}

The command

gcc -fPIC -shared -o test.so test.c

is finished with error code.

Just repeat it and see what compiler writes about it. May be you have some problem with selinux configuration.
Show me, please, error message

Best
      Alexander Pukhov

Revision history for this message
Teto (colucci) said :
#2

Hi,

let's see if I understood it correctly. I created a file test.c with those lines you wrote above as a content. Executed the gcc command you specified gives

test.c:1:19: fatal error: stdlib.h: No such file or directory
 #include<stdlib.h>
                   ^
compilation terminated.

I hope this helps.

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

Please, ask somebody to help you to install properly gcc on your computer.

Your should have file
 /usr/include/stdlib.h

Also gcc with -v flag

   gcc -v -shared -fPIC -o test.so test.c

should write

#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
 /usr/local/include
 /usr/include

So, either you have not file /usr/include/stdlib.h or /usr/include is absent on the search list.

I have not idea what could be a reason of it.

Best
    Alexander Pukhov

Revision history for this message
Teto (colucci) said :
#4

I fixed my compilers following http://clang.llvm.org/get_started.html , so installation of calcHEP was finally successful .

Cheers,

Stefano