Building UMFPACK with VS 2015

20 views
Skip to first unread message

Bill Greene

unread,
Apr 19, 2017, 11:18:06 AM4/19/17
to dea...@googlegroups.com
I am continuing to try to use DEAL with Visual Studio.

I have had some success but ran into a problem when I tried to include
the bundled
umfpack via the Cmake directive
-D DEAL_II_WITH_UMFPACK=ON

Deal II seemed to build without problems but when I tried to build
example step-56,
I got unsatisfied externals: amd_malloc, amd_free, etc.

After some investigation it appears that those functions are being defined as:
nm -g amd_global.obj
0000000000000000 B ?amd_calloc@@3P6APEAX_K0@ZEA
0000000000000008 B ?amd_free@@3P6AXPEAX@ZEA
0000000000000018 B ?amd_malloc@@3P6APEAX_K@ZEA
0000000000000000 D ?amd_printf@@3P6AHPEBDZZEA
0000000000000010 B ?amd_realloc@@3P6APEAXPEAX_K@ZEA

but referenced as, for example:
$ nm -g umf_malloc.obj
0000000000000000 T ?umf_i_malloc@@YAPEAXH_K@Z
U amd_malloc

I don't know if this is a fix or simply a work-around, but I added an
extern"C" to the definitions
of those functions in amd_global.cc as follows:

#ifdef __cplusplus
extern "C" {
#endif
/* standard ANSI-C: */
void *(*amd_malloc) (size_t) = malloc ;
void (*amd_free) (void *) = free ;
void *(*amd_realloc) (void *, size_t) = realloc ;
void *(*amd_calloc) (size_t, size_t) = calloc ;
#ifdef __cplusplus
}

Seems to have solved the problem for me.

Bill

Wolfgang Bangerth

unread,
Apr 19, 2017, 12:56:32 PM4/19/17
to dea...@googlegroups.com
Bill -- it turns out that this was fixed just yesterday in essentially
the way you suggest:
https://github.com/dealii/dealii/pull/4266

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Reply all
Reply to author
Forward
0 new messages