# Call SUBROUTINE GET_ME(P, ALPHAS, NHEL ,ANS) in C++

Dear experts,

I generate fortran code to calculate matrix elements via "output standalone ..." and I know how to create a python library and to call the get_me function in python (https:/

I found out, that I can compile the fortran code into a library matrix.o with "make check". If I compile a test (hello world) script using "g++ -L../../lib/ -ldhelas -lmodel -lgfortran matrix.o test.cc", I get some undefined reference errors.

matrix.o: In function `matrix_':

matrix.

matrix.

matrix.

matrix.

matrix.o: In function `get_me_':

matrix.

matrix.o: In function `initialise_':

matrix.

collect2: error: ld returned 1 exit status

Any help is welcome. Thanks in advance.

The second question would be then how to distinguish multiple subprocess directories, that all contain the same function with the same name (GET_ME), but maybe I will figure out a way to do it...

Best regards,

Thomas

## Question information

- Language:
- English Edit question

- Status:
- Answered

- Assignee:
- No assignee Edit question

- Last query:
- 2017-11-03

- Last reply:
- 2017-11-03

Hi Thomas,

For C++, the simple to my point of view is to ask Madgraph to write the code in C++ and not use any wrapping.

you have the output “standalone_cpp” (describe in the link that you follow) which does just that.

For having a single library, this is also possible with fortran/python as described in the link that you provide:

https:/

(you need to use 2.6.0 for that)

Otherwise, Valentin Hirschi has written a dedicated plugin to have a more flexible cpp standalone output. This is not public but you can contact him, and he will provide it to you (if you kindly ask)

Cheers,

Olivier

> On Nov 3, 2017, at 11:53, Thomas Müller <email address hidden> wrote:

>

> New question #660295 on MadGraph5_aMC@NLO:

> https:/

>

> Dear experts,

>

> I generate fortran code to calculate matrix elements via "output standalone ..." and I know how to create a python library and to call the get_me function in python (https:/

>

> I found out, that I can compile the fortran code into a library matrix.o with "make check". If I compile a test (hello world) script using "g++ -L../../lib/ -ldhelas -lmodel -lgfortran matrix.o test.cc", I get some undefined reference errors.

>

> matrix.o: In function `matrix_':

> matrix.

> matrix.

> matrix.

> matrix.

> matrix.o: In function `get_me_':

> matrix.

> matrix.o: In function `initialise_':

> matrix.

> collect2: error: ld returned 1 exit status

>

> Any help is welcome. Thanks in advance.

>

> The second question would be then how to distinguish multiple subprocess directories, that all contain the same function with the same name (GET_ME), but maybe I will figure out a way to do it...

>

> Best regards,

> Thomas

>

> --

> You received this question notification because you are an answer

> contact for MadGraph5_aMC@NLO.

## Can you help with this problem?

Provide an answer of your own, or ask Thomas Müller for more information if necessary.