Skip to content
Snippets Groups Projects
Commit 2fd020b7 authored by Jan Pöppel's avatar Jan Pöppel
Browse files

Merge branch 'ipaaca4' into 'ryt-fullport'

Ipaaca4

See merge request !2
parents a58b61f9 116e88e1
No related branches found
No related tags found
1 merge request!2Ipaaca4
Instructions for building ipaaca on Windows
Install Visual Studio 2017 (with C++), including CMake
Install GoW (Gnu on Windows) to have some POSIX-like utilities, or double-check the commands below
Open terminal via Visual Studio's "x64 Native Tools Command Prompt", for 64-bit builds
The following instructions are for Debug mode, you can use Release, too
(replace all occurrences below).
BUILD DEPS:
protobuf (latest test with 3.9.0):
cd cmake
mkdir build
cd build
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="C:/Libs/protobuf/x64" -G "Visual Studio 15 2017 Win64" /p:Configuration=Debug ..
cmake --build . --target INSTALL --config Debug -- /nologo /verbosity:minimal /maxcpucount
mosquitto (latest test with 1.5.4):
mkdir build
cd build
# threading=off below disables a nasty library dependency, our dispatcher is threaded anyway
cmake -DWITH_THREADING=OFF -DCMAKE_INSTALL_PREFIX=C:/Libs/mosquitto/x64 -G "Visual Studio 15 2017 Win64" /p:Configuration=Debug ..
cmake --build . --target INSTALL --config Debug -- /nologo /verbosity:minimal /maxcpucount
cp lib\Debug\*.lib lib\cpp\Debug\*.lib \Libs\mosquitto\x64\
BUILD IPAACA (ipaaca4):
cd ......\repo\ipaaca\ipaacalib\proto
mkdir ..\cpp\build\ipaaca
\Libs\protobuf\x64\bin\protoc.exe ipaaca.proto --cpp_out=..\cpp\build\ipaaca
cd ..\cpp\build\ipaaca
cmake -DCMAKE_INSTALL_PREFIX="C:/Libs/ipaaca/x64" -G "Visual Studio 15 2017 Win64" /p:Configuration=Debug ..
cmake --build . --target INSTALL --config Debug -- /nologo /verbosity:minimal /maxcpucount
SETUP FOR VISUAL STUDIO PROJECTS:
Project -> Properties ->
Debugging: add the runtime paths to the environment variables (Path=%Path%;C:\Libs\ipaaca\x64\bin;C:\Libs\mosquitto\x64\bin)
C++: add the include directories (C:\Libs\ipaaca\x64\include;C:\Libs\protobuf\x64\include)
Linker: add ipaaca.lib to the dependencies and C:\Libs\ipaaca\x64\lib to the additional lib dirs
Also add /wd4146 to compiler options if you get errors in protobuf headers (like "unary negative on unsigned value").
......@@ -38,7 +38,7 @@ PROJECT_NAME = "IPAACA-C++"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "Revision 12 (Protocol 2.0)"
#PROJECT_NUMBER = "Revision ... (Protocol ...)"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
......@@ -58,7 +58,7 @@ if(WIN32) # Check if we are on Windows
#include_directories(${PROTOBUF_INCLUDE_DIRS})
#message(STATUS "############################")
#message(STATUS ${PROTOBUF_INCLUDE_DIRS})
set(PROTOBUF_LIBRARY "C:\\libs\\protobuf\\x64\\lib\\libprotobuf.lib")
set(PROTOBUF_LIBRARY optimized "C:\\libs\\protobuf\\x64\\lib\\libprotobuf.lib" debug "C:\\libs\\protobuf\\x64\\lib\\libprotobufd.lib")
link_directories( "C:\\libs\\protobuf\\x64\\lib" )
include_directories( "C:\\libs\\protobuf\\x64\\include" )
......@@ -76,7 +76,7 @@ if(WIN32) # Check if we are on Windows
endforeach()
else()
message(SEND_ERROR "Unsupported compiler! Please build with MSVC 14.0 (Visual Studio 2015).")
message(SEND_ERROR "Unsupported compiler! Please build with MSVC++ 19.x (Visual Studio 2017).")
endif()
else()
#
......@@ -259,8 +259,16 @@ set (TESTER_SOURCE
)
set (TESTER_SOURCE ${TESTER_SOURCE} ${BACKEND_SOURCES})
if(WIN32)
if(MSVC)
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "C:/Libs/ipaaca/x64")
endif()
endif()
else()
# this is for building with cmake/soa
set(CMAKE_INSTALL_PREFIX "")
endif()
# compile all files to "ipaaca" shared library
add_library(ipaaca SHARED ${SOURCE})
......@@ -278,7 +286,6 @@ set(DEFAULT_BIN_SUBDIR bin)
set(DEFAULT_LIB_SUBDIR lib)
set(DEFAULT_DATA_SUBDIR share/data)
set(DEFAULT_INCLUDE_SUBDIR include)
set(CMAKE_INSTALL_PREFIX "")
install (
TARGETS ipaaca ipaaca-tester-cpp
RUNTIME DESTINATION bin
......
......@@ -83,7 +83,7 @@ class Config {
void populate_from_global_sources();
void populate_from_environment();
void populate_from_any_conf_files();
bool populate_from_conf_file(std::fstream& fs);
void populate_from_conf_file(std::fstream& fs);
template<typename T> T get_with_default(const std::string& key, T const& default_value) {
return get_with_default_internal(key, default_value, false);
}
......
......@@ -44,7 +44,11 @@
/**
\mainpage Documentation for IPAACA-C++
This is the automatically generated documentation for the C++ implementation of IPAACA v3.
This is the automatically generated documentation for the C++ implementation of IPAACA.
Protocol version: $(IPAACA_PROTOCOL_VERSION_MAJOR).$(IPAACA_PROTOCOL_VERSION_MINOR) \n
Release number: $(IPAACA_CPP_RELEASE_NUMBER) \n
Release date: $(IPAACA_CPP_RELEASE_DATE)
<b>IPAACA, the Incremental Processing Architecture for Artificial Conversational Agents, is available via <a href="https://opensource.cit-ec.de/projects/ipaaca/wiki"><b>its project page on CITEC Open Source</b></a>.</b>
......
......@@ -155,21 +155,24 @@ void Config::populate_from_any_conf_files()
had_file = true;
} else {
std::fstream f2;
std::string conf_in_home(std::getenv("HOME"));
conf_in_home += "/.config/ipaaca.conf";
f2.open(conf_in_home, std::fstream::in);
if (f2.is_open()) {
IPAACA_DEBUG("Including configuration from ~/.config/ipaaca.conf")
populate_from_conf_file(f2);
f2.close();
had_file = true;
}
char* homedir = std::getenv("HOME"); // TODO: windows
if (homedir) {
std::string conf_in_home(homedir);
conf_in_home += "/.config/ipaaca.conf";
f2.open(conf_in_home, std::fstream::in);
if (f2.is_open()) {
IPAACA_DEBUG("Including configuration from ~/.config/ipaaca.conf")
populate_from_conf_file(f2);
f2.close();
had_file = true;
}
}
}
if (!had_file) {
IPAACA_INFO("Could not load ipaaca.conf either here or in ~/.config")
}
}
bool Config::populate_from_conf_file(std::fstream& fs)
void Config::populate_from_conf_file(std::fstream& fs)
{
std::string line;
while (std::getline(fs, line)) {
......
......@@ -94,7 +94,6 @@ IPAACA_EXPORT void Initializer::override_env_with_cmdline_set_variables()//{{{
IPAACA_INFO("Unknown RSB transport mode " << __ipaaca_static_option_rsb_transport << " - using config default ")
}
}
}//}}}
} // of namespace ipaaca
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment