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

enable IDYNTREE_USES_OCTAVE in MacOS CI #677

Merged
merged 3 commits into from
Apr 22, 2020

Conversation

lrapetti
Copy link
Member

@lrapetti lrapetti commented Apr 21, 2020

Enabling IDYNTREE_USES_OCTAVE in MacOS CI will avoid regression such as #675

@lrapetti
Copy link
Member Author

lrapetti commented Apr 21, 2020

I should enable OCTAVE not MATLAB, I will update it

@lrapetti lrapetti changed the title enable IDYNTREE_USES_MATLAB in MacOS CI enable IDYNTREE_USES_OCTAVE in MacOS CI Apr 21, 2020
@traversaro
Copy link
Member

It seems that Octave installed by the Homebrew is correctly found (otherwise the version would not be the correct one), but apparently something is missing:

CMake Error at /usr/local/Cellar/cmake/3.17.0_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Octave (missing: OCTAVE_ROOT_DIR) (found version "5.2.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.0_1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindOctave.cmake:161 (find_package_handle_standard_args)
  bindings/matlab/CMakeLists.txt:133 (find_package)

Unfortunately I don't have access to macOS, but if you have and you can brew install octave locally, and open a terminal and execute octave-config -p PREFIX and tell me the output it would be great.

@lrapetti
Copy link
Member Author

Unfortunately I don't have access to macOS, but if you have and you can brew install octave locally, and open a terminal and execute octave-config -p PREFIX and tell me the output it would be great.

it seems to be empty

$ octave-config -p PREFIX

@traversaro
Copy link
Member

That is strange, can you also copy the output of octave-config -h , octave-config -v and octave-config --m-site-dir ?

@lrapetti
Copy link
Member Author

That is strange, can you also copy the output of octave-config -h , octave-config -v and octave-config --m-site-dir ?

$ octave-config -h
usage: octave-config [options]

Options:

  -h, -?, --help        Print this message.

  --m-site-dir          Print the name of the directory where Octave
                        expects to find locally installed .m files.

  --oct-site-dir        Print the name of the directory where Octave
                        expects to find locally installed .oct files.

  -p VAR, --print VAR   Print the value of the given configuration
                        variable VAR.  Recognized variables are:

                          API_VERSION            LOCALFCNFILEDIR
                          ARCHLIBDIR             LOCALOCTFILEDIR
                          BINDIR                 LOCALSTARTUPFILEDIR
                          CANONICAL_HOST_TYPE    LOCALVERARCHLIBDIR
                          DATADIR                LOCALVERFCNFILEDIR
                          DATAROOTDIR            LOCALVEROCTFILEDIR
                          DEFAULT_PAGER          MAN1DIR
                          EXEC_PREFIX            MAN1EXT
                          EXEEXT                 MANDIR
                          FCNFILEDIR             OCTAVE_EXEC_HOME
                          IMAGEDIR               OCTAVE_HOME
                          INCLUDEDIR             OCTDATADIR
                          INFODIR                OCTDOCDIR
                          INFOFILE               OCTFILEDIR
                          LIBDIR                 OCTFONTSDIR
                          LIBEXECDIR             OCTINCLUDEDIR
                          LOCALAPIARCHLIBDIR     OCTLIBDIR
                          LOCALAPIFCNFILEDIR     STARTUPFILEDIR
                          LOCALAPIOCTFILEDIR     VERSION
                          LOCALARCHLIBDIR

  -v, --version         Print the Octave version number.


$ octave-config -v
5.2.0


$ octave-config --m-site-dir
/usr/local/Cellar/octave/5.2.0_7/share/octave/5.2.0/site/m

@traversaro
Copy link
Member

For reference, this is the output of the octave-config -h on my Ubuntu 18.04, Octave 4.2.2 :

straversaro@IITICUBLAP102:~$ octave-config -h
usage: octave-config [options]

Options:

  -h, -?, --help        Print this message.

  --m-site-dir          Print the name of the directory where Octave
                        expects to find locally installed .m files.

  --oct-site-dir        Print the name of the directory where Octave
                        expects to find locally installed .oct files.

  -p VAR, --print VAR   Print the value of the given configuration
                        variable VAR.  Recognized variables are:

                          API_VERSION            LOCALARCHLIBDIR
                          ARCHLIBDIR             LOCALFCNFILEDIR
                          BINDIR                 LOCALOCTFILEDIR
                          CANONICAL_HOST_TYPE    LOCALSTARTUPFILEDIR
                          DATADIR                LOCALVERARCHLIBDIR
                          DATAROOTDIR            LOCALVERFCNFILEDIR
                          DEFAULT_PAGER          LOCALVEROCTFILEDIR
                          EXEC_PREFIX            MAN1DIR
                          EXEEXT                 MAN1EXT
                          FCNFILEDIR             MANDIR
                          IMAGEDIR               OCTDATADIR
                          INCLUDEDIR             OCTFILEDIR
                          INFODIR                OCTINCLUDEDIR
                          INFOFILE               OCTLIBDIR
                          LIBDIR                 PREFIX
                          LIBEXECDIR             STARTUPFILEDIR
                          LOCALAPIARCHLIBDIR     VERSION
                          LOCALAPIFCNFILEDIR
                          LOCALAPIOCTFILEDIR

  -v, --version         Print the Octave version number.

straversaro@IITICUBLAP102:~$ octave-config -v
4.2.2
straversaro@IITICUBLAP102:~$

So I guess that for some reason the PREFIX variable either has been remove in Octave 5, or it has been removed on macOS. In any case, the OCTAVE_ROOT_DIR is not actually used in any of our CMake scripts, so we can just remove the lines related to OCTAVE_ROOT_DIR from https://github.com/robotology/idyntree/blob/master/cmake/FindOctave.cmake (especially the fact that it is passed as "REQUIRED_VARS" to find_package_handle_standard_args , that is the thing that is actually making the find_package(Octave REQUIRED) fail, and everything should work fine.

@traversaro
Copy link
Member

Indeed, the support for the PREFIX variable was removed in NexMirror/Octave@533db70#diff-659cce8e2827126070ace2206360d607 .

@lrapetti
Copy link
Member Author

So I guess that for some reason the PREFIX variable either has been remove in Octave 5, or it has been removed on macOS. In any case, the OCTAVE_ROOT_DIR is not actually used in any of our CMake scripts, so we can just remove the lines related to OCTAVE_ROOT_DIR from https://github.com/robotology/idyntree/blob/master/cmake/FindOctave.cmake (especially the fact that it is passed as "REQUIRED_VARS" to find_package_handle_standard_args , that is the thing that is actually making the find_package(Octave REQUIRED) fail, and everything should work fine.

so you would completely remove it or make it somehow optional?

@traversaro
Copy link
Member

So I guess that for some reason the PREFIX variable either has been remove in Octave 5, or it has been removed on macOS. In any case, the OCTAVE_ROOT_DIR is not actually used in any of our CMake scripts, so we can just remove the lines related to OCTAVE_ROOT_DIR from https://github.com/robotology/idyntree/blob/master/cmake/FindOctave.cmake (especially the fact that it is passed as "REQUIRED_VARS" to find_package_handle_standard_args , that is the thing that is actually making the find_package(Octave REQUIRED) fail, and everything should work fine.

so you would completely remove it or make it somehow optional?

Let's completely remove, the FindOctave is just used in iDynTree and not installed, so we don't care.

@lrapetti
Copy link
Member Author

So I guess that for some reason the PREFIX variable either has been remove in Octave 5, or it has been removed on macOS. In any case, the OCTAVE_ROOT_DIR is not actually used in any of our CMake scripts, so we can just remove the lines related to OCTAVE_ROOT_DIR from https://github.com/robotology/idyntree/blob/master/cmake/FindOctave.cmake (especially the fact that it is passed as "REQUIRED_VARS" to find_package_handle_standard_args , that is the thing that is actually making the find_package(Octave REQUIRED) fail, and everything should work fine.

so you would completely remove it or make it somehow optional?

Let's completely remove, the FindOctave is just used in iDynTree and not installed, so we don't care.

I have removed it in 571744f, please @traversaro check if it sounds correct to you

@traversaro
Copy link
Member

Great, it is working fine, thanks!

@traversaro traversaro merged commit 6671f9d into robotology:devel Apr 22, 2020
traversaro added a commit to robotology/ycm-cmake-modules that referenced this pull request Apr 22, 2020
See the related discussions in: 
* robotology/idyntree#677
* https://discourse.cmake.org/t/findoctave-cmake-in-cmake-community-wiki-broken-for-octave-5/1079

As the support for obtaining the `PREFIX` variable (that in CMake was stored as `OCTAVE_ROOT_DIR`) was removed in Octave upstream.
I think it is easier and less error prone (fail early, fail fast) to just remove support for the variable, so in
the remote case that anyone relies on this variable, he will notice that automatically as soon as he updates
his YCM version, instead of getting a failure when someone compiles his project with Octave 5.
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