evironment variables are not collected by cmake

Bug #1160959 reported by roemer2201
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Won't Fix
Undecided
Unassigned

Bug Description

Dear All,

I'm currently trying to install yade on a cluster. On this machine all software is handled through environment modules (see "apt-cache show ennvironment-modules"). Therefore I compiled all dependencies of yade by hand and put them in such an env-module. To the corressponding module I put alle the Variables that cmake is going to interpret when building Yade. Unfortunately these four variables are not gathered from the users environment:

LOKI_INCLUDE_DIR=/shared/apps/loki/0.1.7/include
LOKI_LIBRARY=/shared/apps/loki/0.1.7/lib
EIGEN3_INCLUDE_DIR=/shared/apps/eigen/3.1.2/include/eigen3
PYTHON_INCLUDE_DIR=/shared/apps/python/2.6.8/include/python2.6

If I put these variables in the cmake command with the "-D" option, everything works like a charm:

cmake -DEIGEN3_INCLUDE_DIR=/shared/apps/eigen/3.1.2/include/eigen3 -DLOKI_INCLUDE_DIR=/shared/apps/loki/0.1.7/include -DLOKI_LIBRARY=/shared/apps/loki/0.1.7/lib -DPYTHON_INCLUDE_DIR=/shared/apps/python/2.6.8/include/python2.6/ -DINSTALL_PREFIX=/$HOME/yade/ /$HOME/trunk/

Is it possible gather these variables from the environment?

roemer2201 (roemer2201)
description: updated
Revision history for this message
Anton Gladky (gladky-anton) wrote : Re: [Bug 1160959] [NEW] evironment variables are not collected by cmake

Hi,

I am not sure, whether it is a bug. Cmake has some environment
variables which effect its behavior [1], but it is not a common practice
for cmake-scripts to consider env-variables. We do it only for build-flags.

We, actually, did the same on cluster, compiling Yade adding -DVARIABLES
explicitly. One more option is to set CMAKE_INCLUDE_PATH and
CMAKE_LIBRARY_PATH and then cmake should look for those libs in
pre-defined paths.

[1] http://www.cmake.org/Wiki/CMake_Useful_Variables#Environment_Variables

Cheers,

Anton

Revision history for this message
roemer2201 (roemer2201) wrote :

Dear Anton,

thank you for your answer. I thought that interpreted variables are configured in the CMakeLists.txt in the software and that something in there is missing that leads to the behaviour described in my initial post. I came to that conclusion because a lot variables are interpreted as expected, e.g. $PYTHON_EXECUTABLE, $PYTHON_INCLUDE_DIRS, $LOKI_INCLUDE_DIR. So I'm still not sure whether this difference belongs to cmake itself or the CMakeLists.txt and all included files.

However, thank you for the link to the cmake wiki. I extended our modulefiles like this:
export CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH:$LOKI_LIBRARY
export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH:$LOKI_INCLUDE_DIR
export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH:$EIGEN3_INCLUDE_DIR
export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH:$PYTHON_INCLUDE_DIR

Regards

roemer2201

Revision history for this message
Anton Gladky (gladky-anton) wrote :

I am glad, you have solved you problem. I am closing the bug, because we will
unlikely find a better solution for that. And yes, cluster specific environments are
always requiring "tuning".

Anton

Changed in yade:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.