Closed jezekr closed 1 year ago
If I cast ir = (mwIndex *)mxGetIr(vector); (etc), the warning vanish.
However, I still get the prob = cutest_setup() error: /home/nimg/problems/sif/mcutest.mex: failed to load: /home/nimg/problems/sif/mcutest.mex: undefined symbol: cutestudimsh
when I look at the shared library mcutest.mex using nm, I see a large number of undefined symbols including U cutestudimsh , and thus it does seem to be loading it. I don't know how octave builds its libraries to know how to cure this. The equivalent matlab build puts all of these correctly in its mcutest.mexa64 library
Looking further into the runcutest script, I see that the Matlab build links -lcutest and all the other required libraries, but the octave one doesn't seem to. How did you get this to work without these libraries?
OK, if I add in -lcutest ${ALT_LIB_PATH[@]} ${BLAS} ${LAPACK} ${PACKLIBS} I can now see the cutest functions in the shared library, and the octave call prob = cutest_setup() works as expected. Is that what you would expect?
The command should be command="${MEXFORTRAN} --mex -I${CUTEST}/include --output ${outputName} ${CUTEST}/objects/${ARCH}/${PRECISION}/mcutest.o ELFUN.o GROUP.o RANGE.o -L${LIBDIR} -lcutest ${ALT_LIB_PATH[@]} ${BLAS} ${LAPACK} ${PACKLIBS} -lgfortran -g" It seems I have not updated it. Sorry but I am new to github and I have problems to manage the versions.
I wonder about the -lgfortran flag, the linking worked fine without it here, and it wouldn't seem to be relevant for non GNU installs
Added documentation for setup problems.