Hi All,
I am trying to build OpenSim 4.0 from the source cose from a OSX, and I am following this instructions: https://github.com/opensim-org/opensim- ... sing-xcode
However I get the following error when I build the JAVA wrapping:
Therefore when I run the test I get this output:
MATLAB is installed on my Mac but in /Application. Do I need to run this code (https://github.com/opensim-org/opensim- ... tlab.cmake ) to fix the problem?
Many thanks.
Dario
Building from the source code - Matlab Not found - Java wrapping
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: Building from the source code - Matlab Not found - Java wrapping
What version of Matlab do you have? The issue is usually that your version is more recent than FindMatlab.cmake knows about.
You can probably install and the Matlab bindings will still work fine.
You can probably install and the Matlab bindings will still work fine.
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Building from the source code - Matlab Not found - Java wrapping
Dario,
Before you even look into Matlab, make sure the Java bindings build and that the java tests pass. Check for compilation errors of Java bindings, likely due to using wrong version of SWIG and/or JDK (Java 1.8 expected 9 unsupported).
-Ayman
Before you even look into Matlab, make sure the Java bindings build and that the java tests pass. Check for compilation errors of Java bindings, likely due to using wrong version of SWIG and/or JDK (Java 1.8 expected 9 unsupported).
-Ayman
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
Re: Building from the source code - Matlab Not found - Java wrapping
@Chris: Thanks! Yep, I have installed Matlab 2019a.
@Ayman: Thanks! I think you're right. I got 8 errors and 4 warnings.
I have used Home-brew to install swing (currently version 4.0.1) and Java (version SE 13.0.2 ):
brew install cmake swig
brew cask install java
Does this look OK?
Thanks a lot.
Dario
PS: I have copied the errors here below:
make[2]: *** [Bindings/Java/src/org-opensim-modeling.jar] Error 1
make[1]: *** [Bindings/Java/CMakeFiles/JavaBindings.dir/all] Error 2
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:57: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:66: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:82: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:85: error: incompatible types: Iterator cannot be converted to SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator
removeUnchecked(itr);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:96: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = begin();
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:97: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
final Iterator end = end();
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:98: error: incompatible types: Iterator cannot be converted to SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator
while (itr.isNot(end)) {
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:121: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
itr = itr.getNextUnchecked();
@Ayman: Thanks! I think you're right. I got 8 errors and 4 warnings.
I have used Home-brew to install swing (currently version 4.0.1) and Java (version SE 13.0.2 ):
brew install cmake swig
brew cask install java
Does this look OK?
Thanks a lot.
Dario
PS: I have copied the errors here below:
make[2]: *** [Bindings/Java/src/org-opensim-modeling.jar] Error 1
make[1]: *** [Bindings/Java/CMakeFiles/JavaBindings.dir/all] Error 2
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:57: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:66: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:82: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = find((String) key);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:85: error: incompatible types: Iterator cannot be converted to SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator
removeUnchecked(itr);
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:96: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
Iterator itr = begin();
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:97: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
final Iterator end = end();
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:98: error: incompatible types: Iterator cannot be converted to SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator
while (itr.isNot(end)) {
^
org/opensim/modeling/StdMapStringTimeSeriesTableVec3.java:121: error: incompatible types: SWIGTYPE_p_std__mapT_std__string_std__shared_ptrT_OpenSim__TimeSeriesTable_T_SimTK__Vec3_t_t_std__lessT_std__string_t_t__iterator cannot be converted to Iterator
itr = itr.getNextUnchecked();
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Building from the source code - Matlab Not found - Java wrapping
Hi Dario,
Swig version 4.0 is not supported yet (we saw similar errors to what you got when we tried it out of the box), we're working on it but as of now please use SWIG 3.0.9 if you can and let us know if it solves your build issues.
Best regards,
-Ayman
Swig version 4.0 is not supported yet (we saw similar errors to what you got when we tried it out of the box), we're working on it but as of now please use SWIG 3.0.9 if you can and let us know if it solves your build issues.
Best regards,
-Ayman
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
Re: Building from the source code - Matlab Not found - Java wrapping
Hi Ayman,
Thanks for the great tip.
I can confirm that SWIG 3.0.9 works well: I have downloaded SWIG 3.0.9 and followed this installation instructions:
1) Make sure you have installed pcre (Perl-Compatible Regular Expression) first to successfully compile SWIG.
2) Open a terminal window.
3) Make your working directory the folder: SWIG.
4) Type ./configure.
5) Type make.
6) Type sudo make install and input your administrator password upon prompt.
7) Make sure that the folder that contains the swig executable (the version to use is specified in Requirements to build the Integration yourself:) is in the Xcode PATH variable. The default location is /usr/local/bin.
Then I run again the following:
cd opensim_build
cmake ../opensim-core \
-DCMAKE_INSTALL_PREFIX="~/opensim_install" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_PYTHON_WRAPPING=ON \
-DBUILD_JAVA_WRAPPING=ON \
-DOPENSIM_DEPENDENCIES_DIR="~/opensim_dependencies_install" \
-DWITH_BTK=ON
make -j8
ctest -j8
make -j8 install
Hope it helps.
Dario
Thanks for the great tip.
I can confirm that SWIG 3.0.9 works well: I have downloaded SWIG 3.0.9 and followed this installation instructions:
1) Make sure you have installed pcre (Perl-Compatible Regular Expression) first to successfully compile SWIG.
2) Open a terminal window.
3) Make your working directory the folder: SWIG.
4) Type ./configure.
5) Type make.
6) Type sudo make install and input your administrator password upon prompt.
7) Make sure that the folder that contains the swig executable (the version to use is specified in Requirements to build the Integration yourself:) is in the Xcode PATH variable. The default location is /usr/local/bin.
Then I run again the following:
cd opensim_build
cmake ../opensim-core \
-DCMAKE_INSTALL_PREFIX="~/opensim_install" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_PYTHON_WRAPPING=ON \
-DBUILD_JAVA_WRAPPING=ON \
-DOPENSIM_DEPENDENCIES_DIR="~/opensim_dependencies_install" \
-DWITH_BTK=ON
make -j8
ctest -j8
make -j8 install
Hope it helps.
Dario