Closed jaredmagnusson closed 4 months ago
Ehi @jaredmagnusson. Had you the chance to look at this: https://github.com/mutationpp/Mutationpp/blob/master/docs/coupling.md?
Yes, so I was able to compile the cwrapper.cpp as a separate library (libmutation++_c.so), and add cwrapper.h to the include dir. but linking to that is the issue, I get undefined symbol errors for mpp_initialize
, not sure if the name mangling is happening in the same way as it would with Fortran
Nevermind I figured it out. There is a trailing underscore on the mppinitialize(), to account for the Fortran naming. Adding that I got it to work
I think cwrapper.h may be missing an #include <stdbool.h>
for the has_electrons
function
@jaredmagnusson you are correct on the missing #include <stdbool.h>
. I'll make a PR to fix that, which will close this issue.
Yes, so I was able to compile the cwrapper.cpp as a separate library (libmutation++_c.so), and add cwrapper.h to the include dir. but linking to that is the issue, I get undefined symbol errors for
mpp_initialize
, not sure if the name mangling is happening in the same way as it would with Fortran
How did you compile it to c library. Could you please share the CMake file for that.. Thanks!
Hello, I'm looking to couple Mutation++ to an existing C-program. I see that you've already implemented a cwrapper.h/cpp for your Fortran interface. would I be able to simply link to the resulting shared library directly for coupling?