cc: warning 422: Unknown option "c" ignored. ld: DP-Relative Code in file <MEX-file name>.o - Shared Library must be Position-Independent.To determine if you have the bundled compiler, type the command
what `which cc`(note that the single quotes are backquotes). If the result says "HPC (Bundled) Compiler", then you have the bundled compiler.
There are two possible solutions. The recommended solution is to upgrade your C compiler by adding to it the C/ANSI C Developer's Toolkit, available from Hewlett Packard. This version of the C compiler supports position-independent code generation.
The second possible alternative is to use the GNU C compiler. We have not tested gcc extensively with cmex, but have found that we have been able to compile and run the standard MathWorks MEX-files such as yprime.c, etc. To compile with gcc, you need to either specify certain command line options, as follows:
cmex <MEX-file name>.c CC=gcc \ CFLAGS_REQUIRED="-fpic -DMATLAB_MEX_FILE"or, you can modify the cmex script as follows:
change line 495 from
CC = 'cc'to
CC = 'gcc'and change line 560 from
(c) Copyright 1994 by The MathWorks, Inc.