Skip to content

Commit

Permalink
Get rid of Modular in interface names
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn authored and vigsterkr committed Jun 30, 2017
1 parent 5a56a77 commit e7a32e6
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 62 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Expand Up @@ -25,48 +25,48 @@ matrix:
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DPythonModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DPython=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DRubyModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DRuby=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DJavaModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DJava=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DCSharpModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DCSharp=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DLuaModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DLua=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
- compiler: gcc
services: docker
env:
- CMAKE_OPTIONS="-DOctaveModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- OCTAVE_MODULAR=true
- CMAKE_OPTIONS="-DOctave=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- OCTAVE=true
- compiler: clang
services: docker
env:
- CMAKE_OPTIONS="-DRModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CMAKE_OPTIONS="-DR=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
- CC=clang
- CXX=clang++
# - compiler: clang
# services: docker
# env:
# - CMAKE_OPTIONS="-DScalaModular=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
# - CMAKE_OPTIONS="-DScala=ON -DTRAVIS_DISABLE_UNIT_TESTS=ON -DTRAVIS_DISABLE_LIBSHOGUN_TESTS=ON"
# - CC=clang
# - CXX=clang++
before_install:
Expand All @@ -77,7 +77,7 @@ before_script:
- docker exec -t devenv /bin/sh -c "cd /opt/shogun/build; cmake -DCMAKE_INSTALL_PREFIX=$HOME/shogun-build -DENABLE_TESTING=ON $CMAKE_OPTIONS .."
script:
- |
if [ $CC == "gcc" ] && [ -z $OCTAVE_MODULAR ]; then
if [ $CC == "gcc" ] && [ -z $OCTAVE ]; then
docker exec -t devenv /bin/sh -c "cd /opt/shogun/; if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then ./scripts/check_format.sh "$TRAVIS_PULL_REQUEST_BRANCH" "$TRAVIS_BRANCH"; fi"
fi
- docker exec -t devenv /bin/sh -c "cd /opt/shogun/build; make -j2"
Expand Down
66 changes: 33 additions & 33 deletions CMakeLists.txt
Expand Up @@ -87,24 +87,24 @@ SET(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party)
SET(LIBSHOGUN_SRC_DIR ${CMAKE_SOURCE_DIR}/src/shogun)
SET(COMMON_MODULAR_SRC_DIR ${CMAKE_SOURCE_DIR}/src/interfaces/modular/)

SET(AVAILABLE_INTERFACES PythonModular;OctaveModular;JavaModular;PerlModular;RubyModular;CSharpModular;RModular;LuaModular;ScalaModular)
SET(PythonModularDescription "Python")
SET(OctaveModularDescription "Octave")
SET(JavaModularDescription "Java")
SET(PerlModularDescription "Perl")
SET(RubyModularDescription "Ruby")
SET(CSharpModularDescription "C#")
SET(RModularDescription "R")
SET(LuaModularDescription "Lua")
SET(ScalaModularDescription "Scala")
SET(AVAILABLE_INTERFACES Python;Octave;Java;Perl;Ruby;CSharp;R;Lua;Scala)
SET(PythonDescription "Python")
SET(OctaveDescription "Octave")
SET(JavaDescription "Java")
SET(PerlDescription "Perl")
SET(RubyDescription "Ruby")
SET(CSharpDescription "C#")
SET(RDescription "R")
SET(LuaDescription "Lua")
SET(ScalaDescription "Scala")
SET(LIBSHOGUN ON CACHE BOOL "Compile shogun library")

IsAnyTrue("${AVAILABLE_INTERFACES}" ANY_INTERFACE_ENABLED)
IF (${ANY_INTERFACE_ENABLED})
# SWIG3 is the minimum requirement because of C++11 support
SET(SWIG_VERSION_MINIMUM 3.0.0)

IF(CSharpModular)
IF(CSharp)
# We require SWIG 3.0.7 to support functions with a few SGVector or
# SGMatrix arguments. The required SWIG feature is called
# "Support for special variable expansion in typemap attributes."
Expand All @@ -115,7 +115,7 @@ IF (${ANY_INTERFACE_ENABLED})
# typemapping created for earlier versions of SWIG.
# see: http://www.swig.org/Doc3.0/CSharp.html#CSharp_introduction_swig2_compatibility
LIST(APPEND CMAKE_SWIG_FLAGS "-DSWIG2_CSHARP")
ELSEIF(PythonModular)
ELSEIF(Python)
# SWIG was broken for combining -builtin and -modernargs
# from v3.0.0 and until 3.0.4. This bug was fixed in
# v3.0.5. Make CMake emit an error and fail to configure.
Expand Down Expand Up @@ -408,7 +408,7 @@ ForEach(SwigFlag "-w473" "-w454" "-w312" "-w325" "-fvirtual")
LIST(APPEND CMAKE_SWIG_FLAGS ${SwigFlag})
EndForEach()

OPTION(SWIG_SINGLE_THREADED "Build modular interfaces single-threaded to reduce memory usage" OFF)
OPTION(SWIG_SINGLE_THREADED "Build interfaces single-threaded to reduce memory usage" OFF)

OPTION(USE_SWIG_DIRECTORS "Enable SWIG director classes" ON)

Expand All @@ -429,67 +429,67 @@ IF(REDUCE_SWIG_DEBUG)
SET(SWIG_CXX_COMPILER_FLAGS "${SWIG_CXX_COMPILER_FLAGS} -g1")
ENDIF(REDUCE_SWIG_DEBUG)

# python modular
IF (PythonModular)
# python
IF (Python)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/python_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/python_modular)
ENDIF()
ENDIF()

# lua modular
IF (LuaModular)
# lua
IF (Lua)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/lua_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/lua_modular)
ENDIF()
ENDIF()

# scala modular
IF (ScalaModular)
# scala
IF (Scala)
# Java needed because Scala extends Java Classes and uses the executable generated from Java example for Integration testing
set(JavaModular "ON")
set(Java "ON")
FIND_PACKAGE(Scala REQUIRED)
IF(NOT JavaModular)
IF(NOT Java)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/java_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/java_modular)
ENDIF()
ENDIF()
ENDIF()

# java modular
IF (JavaModular)
# java
IF (Java)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/java_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/java_modular)
ENDIF()
ENDIF()

# ruby modular
IF (RubyModular)
# ruby
IF (Ruby)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/ruby_modular)
ENDIF()

# octave modular
IF (OctaveModular)
# octave
IF (Octave)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/octave_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/octave_modular)
ENDIF()
ENDIF()

# csharp modular
IF (CSharpModular)
# csharp
IF (CSharp)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/csharp_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/csharp_modular)
ENDIF()
ENDIF()

# r modular
IF (RModular)
# R
IF (R)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/r_modular)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/interfaces/r_modular)
ENDIF()
ENDIF()

# perl modular
IF (PerlModular)
# perl
IF (Perl)
FIND_PACKAGE(FindPerlLibs REQUIRED)
UNSET(TARGET_SWIGFLAGS)
IF(EXISTS ${CMAKE_SOURCE_DIR}/src/interfaces/perl_modular)
Expand Down
14 changes: 5 additions & 9 deletions doc/readme/INSTALL.md
Expand Up @@ -175,10 +175,10 @@ In both cases, it is necessary to set a number of system libraries for using Sho

## Interfaces <a name="manual-interfaces"></a>
The native C++ interface is always included.
The cmake options for building interfaces are `-DPythonModular -DOctaveModular -DRModular -DJavaModular -DRubyModular -DLuaModular -DCSharpModular` etc.
The cmake options for building interfaces are `-DPython -DOctave -DR -DJava -DRuby -DLua -DCSharp` etc.
For example, replace the cmake step above by
```
cmake -DPythonModular=ON [potentially more options] ..
cmake -DPython=ON [potentially more options] ..
```

The required packages (here debian/Ubuntu package names) for each interface are
Expand Down Expand Up @@ -225,10 +225,6 @@ Make sure to read the [docs](https://cmake.org/documentation/) and [CMake_Useful
Make sure to understand the concept of [out of source builds](https://cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees).
Here are some tips on common options that are useful

Getting a list of possible interfaces to enable:

grep -E "OPTION.*(Modular)" CMakeLists.txt

Specify a different swig executable:

cmake -DSWIG_EXECUTABLE=/usr/bin/swig_custom
Expand All @@ -253,16 +249,16 @@ For that, you need to do something similar to

For example, for `brew` installed Python under MacOS, use something like:

cmake -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Headers -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPythonModular=ON ..
cmake -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Headers -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPython=ON ..

Under Linux, where you want to use Python 3, which is not the system's default:

cmake -DPYTHON_INCLUDE_DIR=/usr/include/python3.3 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_PACKAGES_PATH=/usr/local/lib/python3.3/dist-packages -DPythonModular=ON ..
cmake -DPYTHON_INCLUDE_DIR=/usr/include/python3.3 -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_PACKAGES_PATH=/usr/local/lib/python3.3/dist-packages -DPython=ON ..

On a Linux cluster without root access, using [Anaconda](https://www.continuum.io/downloads) (note you will need to activate your environment everytime you want to run Shogun):

source path/to/anaconda/bin/activate
cmake -DCMAKE_INSTALL_PREFIX=path/to/shogun/install/dir -DPYTHON_INCLUDE_DIR=path/to/anaconda/include/python2.7/ -DPYTHON_LIBRARY=path/to/anaconda/lib/libpython2.7.so -DPYTHON_EXECUTABLE=path/to/anaconda/bin/python -DPythonModular=On ..
cmake -DCMAKE_INSTALL_PREFIX=path/to/shogun/install/dir -DPYTHON_INCLUDE_DIR=path/to/anaconda/include/python2.7/ -DPYTHON_LIBRARY=path/to/anaconda/lib/libpython2.7.so -DPYTHON_EXECUTABLE=path/to/anaconda/bin/python -DPython=ON ..

## Windows build <a name="manual-windows"></a>

Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@ IF (NOT TRAVIS_DISABLE_LIBSHOGUN_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/un
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/undocumented/libshogun)
ENDIF()

IF (PythonModular AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/undocumented/python_modular)
IF (Python AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/undocumented/python_modular)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/undocumented/python_modular)
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -141,7 +141,7 @@ def shogun_cmake(arguments=None):
print("Running CMake")

if arguments is None:
arguments='-DPythonModular=ON -DENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=install'
arguments='-DPython=ON -DENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=install'

if distutils.spawn.find_executable('cmake') is not None:
print('CMake arguments: %s ' % arguments)
Expand Down
16 changes: 8 additions & 8 deletions tests/meta/CMakeLists.txt
Expand Up @@ -58,14 +58,14 @@ FOREACH(REFERENCE_FILE ${META_INTEGRATION_REFERENCES})
AddMetaIntegrationTest(cpp 1)
ENDIF()
IF (NOT ${DISABLE_META_INTEGRATION_TESTS})
AddMetaIntegrationTest(python PythonModular)
AddMetaIntegrationTest(java JavaModular)
#AddMetaIntegrationTest(r RModular) # currently we have the r meta examples disabled, so no generated results that can be tested
AddMetaIntegrationTest(octave OctaveModular)
AddMetaIntegrationTest(csharp CSharpModular)
AddMetaIntegrationTest(ruby RubyModular)
AddMetaIntegrationTest(scala ScalaModular)
#AddMetaIntegrationTest(lua LuaModular) # currently doesn't have meta examples
AddMetaIntegrationTest(python Python)
AddMetaIntegrationTest(java Java)
#AddMetaIntegrationTest(r R) # currently we have the r meta examples disabled, so no generated results that can be tested
AddMetaIntegrationTest(octave Octave)
AddMetaIntegrationTest(csharp CSharp)
AddMetaIntegrationTest(ruby Ruby)
AddMetaIntegrationTest(scala Scala)
#AddMetaIntegrationTest(lua Lua) # currently doesn't have meta examples
ENDIF()
ELSE()
MESSAGE(WARNING "Skipping C++ meta integration tests; requires a c++11 compatible compiler.")
Expand Down

0 comments on commit e7a32e6

Please sign in to comment.