ralna / CUTEst

The Constrained and Unconstrained Testing Environment with safe threads (CUTEst) for optimization software
Other
83 stars 18 forks source link

Update README.octave #32

Closed jezekr closed 1 year ago

jezekr commented 1 year ago

Added documentation for setup problems.

nimgould commented 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

nimgould commented 1 year ago

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?

nimgould commented 1 year ago

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?

jezekr commented 1 year ago

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.

nimgould commented 1 year ago

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