Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test running SINGE inside Octave Docker container #13

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

agitter
Copy link
Member

@agitter agitter commented Mar 15, 2019

This is an attempt to run SCINGE on Travis CI inside an Octave Docker container (#4). It initially uses https://hub.docker.com/r/openmicroscopy/octave and examples from https://github.com/openmicroscopy/octave-docker.

@agitter
Copy link
Member Author

agitter commented Mar 15, 2019

https://serverfault.com/questions/594281/how-can-i-override-cmd-when-running-a-docker-image had useful information on the order of docker run commands when changing the entrypoint.

@agitter
Copy link
Member Author

agitter commented Mar 15, 2019

There is still work to do, but this testing direction seems promising. There will be some compatibility issues. One example is:

error: 'verLessThan' undefined near line 95 column 4
error: called from
    GLG_Instance>isfilecomp at line 95 column 1

We can work around those if we want. The biggest issue is that the Octave errors are not propagating to Docker. Octave can stop running the code when it encounters an error but still return an exit code of 0 to Docker so the Travis CI build passes. The problem is likely with Octave because if I force bash to exit with code 1, Docker recognizes that (c880cb6).

@agitter
Copy link
Member Author

agitter commented Mar 15, 2019

This is possibly related to https://savannah.gnu.org/patch/?9633

@agitter
Copy link
Member Author

agitter commented Mar 15, 2019

The Docker container has Octave 4.2.2 and the post linked above claims the exit status was broken in that version.

@agitter
Copy link
Member Author

agitter commented Mar 15, 2019

This container builds the current development version of Octave and could be useful https://hub.docker.com/r/mtmiller/octave-snapshot I tried it in 03dc7ae and now the build correctly fails if Octave encounters an error, which is a huge improvement.

If we want to use this as a base, we may need to use it as a starting point for our own container. It seems like this project is only intended to provide the current snapshot, and we don't want the underlying version of Octave to keep changing as we work to maintain our code.

@agitter
Copy link
Member Author

agitter commented Mar 19, 2019

The current Docker container has gfortran so it should be possible to compile new mex files for Octave inside the container. I am using this mex reference even though our version of Octave is much newer.

The Glmnex Linux 64 instructions don't provide the command line mex call so I am initially adapting it from the Windows 32 instructions. We'll need to debug the call.

The initial plan is to run ./install_glmnet_docker.sh inside the Docker container to download and compile Glmnet. If this works, we could pre-configure it inside our own Docker container.

@agitter
Copy link
Member Author

agitter commented Mar 19, 2019

0c9d42c had the error

glmnetMex.F:1:0: fatal error: fintrf.h: No such file or directory
 #include "fintrf.h"
 ^
compilation terminated.

which was resolved by downloading the header from https://github.com/SheffieldML/GPmat/blob/master/kern/mex/fintrf.h

There are still many warnings like

glmnetMex.F:132.33:
         call getinteger(temp_pr,task,1)                                
                                 1
Warning: Rank mismatch in argument 'x' at (1) (rank-1 and scalar)

These do not appear to be fatal because glmnetMex.mex is written.

@agitter
Copy link
Member Author

agitter commented Apr 3, 2019

@atuldeshpande can you please explore this warning in the latest build:

warning: function name 'dropZeroSamples' does not agree with function filename '/SCINGE/code/dropSamples.m'

There is also an error related to the mex file

error: glmnetControl: /SCINGE/glmnet_matlab/glmnetMex.mex: failed to load: /SCINGE/glmnet_matlab/glmnetMex.mex: undefined symbol: mxcopyreal8toptr_

This MATLAB help page explains the function https://www.mathworks.com/help/matlab/apiref/mxcopyreal8toptr.html. It seems related to the fintrf.h file. That file is also available from Intel.

This third party project discussed this function with Octave: http://lasp.colorado.edu/cism/CISM_DX/code/CISM_DX-0.50/required_packages/octave-forge/extra/mex/

@agitter
Copy link
Member Author

agitter commented Apr 4, 2019

The octave-snapshots image has been deprecated, but now I found containers for stable releases. This example shows how to run a test in multiple versions of Octave.

@agitter
Copy link
Member Author

agitter commented Apr 9, 2019

@atuldeshpande can you please move these GLG_Instance.m and parseParams.m changes to a new branch? It is likely that we will not be able to resolve the Fortran-Octave mex interface issues and will not merge this pull request. It's okay to keep these changes in this branch because they will help our future testing if we attempt to get this to work.

@agitter
Copy link
Member Author

agitter commented Apr 16, 2019

I received help from an Octave developer regarding this mex error. Octave does not implement the MATLAB Fortran mex interface, meaning mx* functions from MATLAB like mxCopyPtrToReal8 and mxCopyReal8ToPtr are not available. We would need to write a translation layer in C or C++.

In 2007, there was an initial attempt to create this translation layer, but was not completed. See #15 for an update from the author.

agitter added a commit that referenced this pull request May 3, 2019
@agitter agitter mentioned this pull request May 3, 2019
atuldeshpande pushed a commit that referenced this pull request Jun 14, 2019
@agitter agitter changed the title Test running SCINGE inside Octave Docker container Test running SINGE inside Octave Docker container Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants