Skip to content
Snippets Groups Projects
Commit a1126502 authored by Ramin Yaghoubzadeh Torky's avatar Ramin Yaghoubzadeh Torky
Browse files

Merge branch 'softwareweek2019' into ryt-fullport

parents 364d1bb6 1c76bf61
No related branches found
No related tags found
No related merge requests found
# IPAACA
This repository contains the software library IPAACA developed by the Social Cognitive Systems Group at Bielefeld University. IPAACA stands for 'Incremental Processing Architecture for Artificial Conversational Agents.' The library is available in three languages: Python (Python3 compatible), C++, and Java, and for three operating systems: Linux, OS X, and Windows.
## Build dependencies
### Linux
Dependencies: Protocol Buffer (libprotobuf), Transport Protocol (**libmosquittopp**, ros, librsb)
sudo apt-get install libprotobuf-dev
sudo apt-get install libprotoc-dev
sudo apt-get install protobuf-compiler
sudo apt-get install mosquitto libmosquittopp-dev
## Build/Install instructions
### Linux
**Compiling C++ Version**
cd ipaaca/ipaacalib/cpp
mkdir build
cd build
cmake ..
make
sudo make install
**Installing Python Version**
cd ipaaca/ipaacalib/python
python3 setup.py install --user
### OS X
### Windows
## Usage
**Python:** import ipaaca
**C++:** #include "ipaaca/ipaaca.h"
## History
## Credits
Hendrik Buschmeier <hbuschme@techfak.uni-bielefeld.de>
Ramin Yaghoubzadeh <ryaghoub@techfak.uni-bielefeld.de>
## License
GNU LESSER GENERAL PUBLIC LICENSE (See LICENSE.txt in the repository)
## Further Reading
[1] IPAACA: https://scs.techfak.uni-bielefeld.de/wiki/public/ipaaca/start
[2] Schlangen et al. "Middleware for Incremental Processing in Conversational Agents," SIGDIAL 2010. https://www.aclweb.org/anthology/W10-4308
#!/bin/bash
# install rsb-python
# Trick conda build to let rsb-python installation run
# The url to spread in there is not used, but will still raise a RuntimeError if
# not tricked like this...
#unset CONDA_BUILD
#pip install --no-dependencies rsb-python
#set CONDA_BUILD
# Since we setup subfolders for ipaaca and proto, we want to step into the ipaaca folder here
cd ipaaca
echo "Installing ipaaca using setup.py"
python setup.py install
# build protobuf files
echo 0
\ No newline at end of file
# this one is important
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_PLATFORM Linux)
#this one not so much
set(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CC})
# where is the target environment
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# god-awful hack because it seems to not run correct tests to determine this:
set(__CHAR_UNSIGNED___EXITCODE 1)
\ No newline at end of file
#!/bin/bash
echo "Installing ipaaca-cpp"
INCLUDE_PATH="${PREFIX}/include"
LIBRARY_PATH="${PREFIX}/lib"
export CMAKE_INCLUDE_PATH=$INCLUDE_PATH
export CMAKE_LIBRARY_PATH=$LIBRARY_PATH
if [[ "$(uname)" == "Linux" ]]; then
# Linus needs this lrt flag
export LDFLAGS="$LDFLAGS -lrt"
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")
elif [[ "$(uname)" == "Darwin" ]]; then
echo "mac"
fi
# build protobuf files
mkdir -p ipaaca-cpp/build/ipaaca
cd proto
protoc ipaaca.proto --cpp_out=../ipaaca-cpp/build/ipaaca
# build ipaaca cpp
cd ../ipaaca-cpp/build
export VERBOSE=1
cmake .. -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBOOST_INCLUDEDIR=${INCLUDE_PATH} -DBOOST_LIBRARYDIR=${LIBRARY_PATH} ${CMAKE_PLATFORM_FLAGS[@]}
echo "Finished cmake, trying build now"
make
make install DESTDIR=${PREFIX}
cd ../../..
\ No newline at end of file
#!/bin/bash
# Since we setup subfolders for ipaaca and proto, we want to step into the ipaaca folder here
# Note: setup.py assumes protoc file to be at ../proto from here and we do not want to change
# that for easier manual installation
cd ipaaca-py
echo "Installing ipaaca using setup.py"
#python -m pip install . -vv
python setup.py install --single-version-externally-managed --record=record.txt
\ No newline at end of file
{% set protobufversion = "3.8.0" %}
package:
name: ipaaca
version: "0.1.0"
name: ipaaca
version: "0.1.2"
source:
- path: ../ipaacalib/python
folder: ipaaca
- path: ../ipaacalib/proto
folder: proto
- path: ../ipaacalib/cpp
folder: ipaaca-cpp
- path: ../ipaacalib/proto
folder: proto
- path: ../ipaacalib/python
folder: ipaaca-py
build:
number: 1
number: 1
requirements:
build:
- python
- pip
- setuptools
run:
- ipaaca-cpp
- ipaaca-py
run:
- python
- mosquitto
- protobuf
- paho-mqtt
outputs:
- name: ipaaca-cpp
script: install_cpp.sh
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- cmake >=3.10
host:
- libprotobuf {{ protobufversion }}
- mosquitto
- libboost
run:
- mosquitto
- libprotobuf {{ protobufversion }}
- libboost
- name: ipaaca-py
noarch: python
script: install_python.sh
requirements:
host:
- python
- pip
- setuptools
- protobuf {{ protobufversion }}
run:
- python
- mosquitto
- paho-mqtt
- protobuf {{ protobufversion }}
......@@ -3,10 +3,10 @@ cmake_minimum_required (VERSION 2.6)
# project name
project (ipaaca_cpp)
set (CMAKE_CXX_STANDARD 11)
#set (CMAKE_CXX_STANDARD 11)
## use C++11 (starting with proto v2 / ipaaca-c++ release 12)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
## use the following line to enable console debug messages in ipaaca
## (this entails a slight slowdown since dynamic log level checks made at the very least)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIPAACA_DEBUG_MESSAGES")
......@@ -93,6 +93,15 @@ else()
link_directories(${PROTOBUF_LIBRARY_DIRS})
include_directories(${PROTOBUF_INCLUDE_DIRS})
set(PROTOBUF_INPUT_DIRECTORY "${PROJECT_SOURCE_DIR}")
set(PROTOBUF_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/build/ipaaca")
file(MAKE_DIRECTORY ${PROTOBUF_OUTPUT_DIRECTORY})
set(PROTOBUF_ARGUMENTS "--cpp_out=${PROTOBUF_OUTPUT_DIRECTORY}")
execute_process(COMMAND protoc ${PROTOBUF_ARGUMENTS} ipaaca.proto
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../proto/
RESULT_VARIABLE PROTOBUF_RESULT
OUTPUT_VARIABLE PROTOBUF_OUTPUT_VARIABLE)
# change for each new rsb version
if (DEFINED APPLE)
#set(RSBLIBS rsc0.14 rsb0.14)
......
This diff is collapsed.
This diff is collapsed.
......@@ -50,7 +50,7 @@ class ProtoBuild(build_py):
if (not op.exists(output) or (op.getmtime(source) > op.getmtime(output))):
sys.stderr.write('Protobuf-compiling ' + source + '\n')
subprocess.check_call([self.find_protoc(), "-I={}".format(packagedir),'--python_out=.', source])
subprocess.check_call([self.find_protoc(), "-I={}".format(packagedir),'--python_out=./src/ipaaca', source])
class BDist_egg(bdist_egg):
'''
......@@ -105,11 +105,11 @@ setup(name="ipaaca",
license='LGPLv3+',
url='https://opensource.cit-ec.de/projects/ipaaca',
install_requires=["paho-mqtt", "six", "protobuf"],
packages=["ipaaca"],
packages=["ipaaca", "ipaaca.util"],
package_dir={"ipaaca":"src/ipaaca"},
# TODO Do we want to add ipaaca_pb2.py to the egg or as separate package?
data_files=[("./ipaaca", ["ipaaca_pb2.py"])],
# data_files=[("./ipaaca", ["ipaaca_pb2.py"])],
# dependency_links=[
# 'http://www.spread.org/files/'
......
......@@ -5,7 +5,7 @@
# "Incremental Processing Architecture
# for Artificial Conversational Agents".
#
# Copyright (c) 2009-2015 Social Cognitive Systems Group
# Copyright (c) 2009-2019 Social Cognitive Systems Group
# CITEC, Bielefeld University
#
# http://opensource.cit-ec.de/projects/ipaaca/
......@@ -43,6 +43,7 @@ import uuid
import ipaaca
import ipaaca.misc
import six
__all__ = [
......@@ -124,7 +125,7 @@ def logger_set_log_level(level=LogLevel.DEBUG):
with LOGGER_LOCK:
if level in LogLevel._values:
CURRENT_LOG_LEVEL = level
elif isinstance(level, ipaaca.misc.string_types) and level.upper() in LOG_LEVEL_FROM_STRING_DICT:
elif isinstance(level, six.string_types) and level.upper() in LOG_LEVEL_FROM_STRING_DICT:
CURRENT_LOG_LEVEL = LOG_LEVEL_FROM_STRING_DICT[level.upper()]
else:
pass # leave previous setting untouched
......@@ -152,8 +153,8 @@ def LOG_IPAACA(lvl, text, now=0.0, fn='???', thread='???'):
+ traceback.format_exc())
def LOG_CONSOLE(lvlstr, msg, fn_markup='\033[38;5;142m', msg_markup='', now=0.0, fn='???', thread='???'):
if isinstance(msg, ipaaca.misc.string_types):
def LOG_CONSOLE(lvlstr, msg, fn_markup='', msg_markup='', now=0.0, fn='???', thread='???'):
if isinstance(msg, six.string_types):
lines = msg.split('\n')
else:
lines = [msg]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment