[petsc-dev] exporting MPIUNI symbols using PETSC_EXTERN
Barry Smith
bsmith at mcs.anl.gov
Tue Jul 3 16:04:18 CDT 2012
Satish,
Well since you are duplicating other things for mpiuni please duplicate that and set it up to work for petsc-3.3 and petsc-dev
Getting .dll's working is a priority so we need to get all roadblocks out of the way as quickly as possible.
Thanks
Barry
On Jul 3, 2012, at 2:32 PM, Satish Balay wrote:
> On Tue, 3 Jul 2012, Chetan Jhurani wrote:
>
>> 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?
>
> Well mpiuni/mpi.h does not use petscsys.h so it can't use PETSC_EXTERN.
>
> It will have to use MPIUNI_EXTERN or eqivalent [with some of the
> relavent code dupcated from petscsys.h]
>
> Satish
More information about the petsc-dev
mailing list