[petsc-dev] exporting MPIUNI symbols using PETSC_EXTERN
Chetan Jhurani
chetan.jhurani at gmail.com
Tue Jul 3 14:18:12 CDT 2012
Hi,
I'm trying to build a Petsc DLL on Windows by making very small
tweaks to the standard way of configuring/building as far as
possible. It is working and I can run some user code using the DLL.
The problem (which I can avoid locally) is due to non-exported
petsc MPIUNI global symbols. For example, functions like the one
below are not exported because instead of using the macro
PETSC_EXTERN they use extern. And PETSC_EXTERN can be expanded to
__declspec(dllexport) via compile time macros.
#define MPI_Comm_size Petsc_MPI_Comm_size
extern int MPI_Comm_size(MPI_Comm,int*);
Since these are called in the user code, they need to be exported.
One way is to change mpi.h, and the other way is to use a module
definition file while creating the DLL, which adds the required
MPIUNI symbols separately.
Can petsc's default mpi.h be changed to use PETSC_EXTERN instead of
extern for symbols supposed to be exported?
Thanks,
Chetan
More information about the petsc-dev
mailing list