iut-ibk / DynaMind-ToolBox

DynaMind-ToolBox
www.dance4water.org
GNU General Public License v2.0
9 stars 6 forks source link

Module path is broken #308

Open attozeta opened 9 years ago

attozeta commented 9 years ago

The executable (no GUI) can not find any modules. This regression is probably introduced via https://github.com/iut-ibk/DynaMind-ToolBox/commit/776534bfc098f58988722f011c4f725386e0a912.

attozeta commented 9 years ago

Fix is to revert https://github.com/iut-ibk/DynaMind-ToolBox/commit/776534bfc098f58988722f011c4f725386e0a912, however there might be other related issues as we still get

ERROR    Do. Aug. 20 21:02:01 2015| Failed to set working directory to  /tmp/dynamind  does not exist

It is also possible to fix the issue by copying the required *.so's to $BUILD/output.

christianurich commented 9 years ago

QString currentPath = QCoreApplication::applicationDirPath(); QString currentPath = QDir::currentPath(); Are you sure that this 2 functions return the same and it also works when its called dymaind is called from a random path (e.g. when installed)

The idea was that if compiled it returns the output path otherwise the lib folders, I didn't run into issues with the linux installations here.

attozeta commented 9 years ago

No they are definitely not the same. However modules did not work otherwise, after a clean build (if executed from $build/output. Obviously it should work if we call dynamind from a random path, but IMHO this should also work if we did not install it.

I think a straight-forward way would be to just have a $DYNAMIND_MODULES env variable that can be used to include third-party modules. Built-In modules (i.e. modules that are in the tree, basic-modules/ , dynavibe/ , gdalmodules/ *) are just expected to be in $build/modules and can be savely loaded by determining the executable's path. If this is non-trivial we might wrap it via a script like the following and read out $DYNAMIND_HOME at runtime, something like

$!/bin/bash
export DYNAMIND_HOME=`dirname $0`
$DYNAMIND_HOME/dynamind $@