Skip to content

Commit

Permalink
Merge pull request #27 from AnoushkaU/command_parse
Browse files Browse the repository at this point in the history
ADD: Set Plugins from Command Line
  • Loading branch information
Rafael Stahl authored Dec 2, 2020
2 parents b5c6d2e + d2f45b1 commit f05100d
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 82 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ ADD_LIBRARY(ETISS SHARED
${ETISS_SOURCE} ${ETISS_HEADER}
)
set_target_properties(ETISS PROPERTIES COMPILE_DEFINITIONS "ETISS_LIB_SHARED=1;ETISS_EXPORTS;ETISS_PLUGIN_EXPORTS")
TARGET_LINK_LIBRARIES(ETISS PUBLIC ${Boost_LIBRARIES} Boost::boost Threads::Threads)
TARGET_LINK_LIBRARIES(ETISS PUBLIC Boost::boost Threads::Threads)
IF(UNIX)
TARGET_LINK_LIBRARIES(ETISS PUBLIC ${Boost_LIBRARIES})
ENDIF()
IF(WIN32)
# Sadly CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS does not set -Wl,--export-all-symbols if gcc is sued
IF(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
Expand Down
3 changes: 2 additions & 1 deletion ETISSConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ endif()
set(ETISS_LIBRARIES "@CMAKE_INSTALL_PREFIX@/lib/${ETISS_SHLIB_DLL_PREFIX}ETISS${ETISS_SHLIB_DLL_SUFFIX}")

FIND_PACKAGE(Threads REQUIRED)
FIND_PACKAGE(Boost 1.48 COMPONENTS filesystem system REQUIRED)
FIND_PACKAGE(Boost 1.48 COMPONENTS filesystem system program_options REQUIRED)

LINK_DIRECTORIES("${Boost_LIBRARY_DIRS}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})

SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
if (NOT ETISS_DISABLE_COMPILERFLAGS)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ ETISS is supported on x86_64 Linux and Windows hosts. Tested compilers include G

Packages for Ubuntu 18:

sudo apt-get install g++ libboost-system-dev libboost-filesystem-dev graphviz doxygen libtinfo-dev zlib1g-dev texinfo

sudo apt-get install g++ libboost-system-dev libboost-filesystem-dev libboost-program-options-dev graphviz doxygen libtinfo-dev zlib1g-dev texinfo

### Build and Installation

Expand Down
9 changes: 5 additions & 4 deletions examples/bare_etiss_processor/run_helper.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ echo -e \

VP_EXE="${ETISS_DIR}/examples/bare_etiss_processor/build/main"

CMD_OPTIONS=""

USE_GDB=0
USE_TGDB=0
DO_NOT_ATTACH=0
Expand Down Expand Up @@ -81,8 +83,7 @@ do
VP_EXE="$2"
shift
else
echo -e "Unknown argument: $arg"
exit 1
CMD_OPTIONS="${CMD_OPTIONS} ${arg}"
fi
shift
done
Expand All @@ -108,7 +109,7 @@ fi
if [ "${USE_GDB}" -eq 1 ]; then
gdb --args ${VP_EXE} ${ARGS}
else
${VP_EXE} ${ARGS}
${VP_EXE} ${ARGS} ${CMD_OPTIONS}
fi

rm $DYN_INI
rm $DYN_INI
10 changes: 8 additions & 2 deletions include/etiss/ETISS.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ std::set<std::string> listLibraryPrefixes();
* etiss::initialize / etiss::shutdown manually
*/
void initialize(std::vector<std::string> args);

void initialize(int argc, const char* argv[]);
/**
* @brief Get the default JIT implementation.
*
Expand Down Expand Up @@ -345,7 +345,13 @@ class Initializer
toList(args, args_append...);
initialize(args);
}


Initializer(std::list<std::string> *files, int argc, const char* argv[])
{
loadIni(files);
initialize(argc, argv);
}

/**
* @brief Constructor that initializes ETISS.
*
Expand Down
2 changes: 2 additions & 0 deletions include/etiss/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ class Configuration
*/
std::list<std::string> set(const std::list<std::string> &args);

static std::pair<std::string, std::string> set_cmd_line_boost(const std::string& s);

/**
* @brief get a copy of the configuration as a map
*/
Expand Down
Loading

0 comments on commit f05100d

Please sign in to comment.