How to change CMAKE_INSTALL_PREFIX?


#1

Is it possible to install in a location other than the default? On my cluster I would like to install in /nfs/software, for example, so that all nodes can see the binaries. Wouldn’t this be possible with something like this?

nbest@ec2-107-20-87-150:~/scidb-11.06.0.2877$ export CMAKE_INSTALL_PREFIX=/nfs/software/scidb/11.06
nbest@ec2-107-20-87-150:~/scidb-11.06.0.2877$ cmake .
– CMAKE_INSTALL_PREFIX not Initialized to default keeping: /opt/scidb/11.06
. . .

Why is it not respecting my environment variable?


#2

Hi,

all internal cmake variables passed through switch -D, so right command will be:


#3

Great. Thanks, Artyom, that helped me make some progress. Now I have the install step failing like this:

nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ sudo make install
. . .
[100%] Built target operators
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /nfs/software/scidb/11.06/bin/scidb
-- Installing: /nfs/software/scidb/11.06/lib/libscidbclient.so
CMake Error at cmake_install.cmake:44 (FILE):
  file INSTALL cannot find
  "/nfs/home/nbest/scidb-11.06.0.2877/bin/_libscidbpython.so".


make: *** [install] Error 1

In case there are any clues here:

nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ pwd
/nfs/home/nbest/scidb-11.06.0.2877
nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ ls -a bin
.         csv2scidb     gen_matrix  libscidbclient.so   packaging_only  scidbLoadCsv.sh      scidbtestharness
..        data          init-db.sh  log1.properties     plugins         scidb-prepare-db.sh
benchGen  env_setup.sh  iquery      log4cxx.properties  scidb           scidb.py
nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ find . -name "libscidb*"
./bin/libscidbclient.so
./src/network/proto/libscidb_msg_lib.a
nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ find . -name "_libscidb*"
nbest@ec2-50-17-43-211:~/scidb-11.06.0.2877$ 

Can anyone guess what has gone wrong here? Could this have anything to do with the fact that I am changing the installation location? I doubt it, which means I probably should have started a new thread . . . Thanks.


#4

Hmm, I think you don’t building python binding for SciDB, but install target expecting this. I remember I fixed that after releasing 11.06… As quick fix I suggest you two ways: (1) install SWIG2 and build SciDB with binding or (2) just remove/comment all python related install commands in install.cmake (you can see bunch of such lines right at the end of install.cmake).


#5

Thanks for your comments. I think this explains in part my confusion related to the statement in the install guide about SWIG not having a pre-built package. I had package “swig” installed the first time around, then I removed it and installed “swig2.0” and did make clean; make but I still don’t see bin/_libscidbpython.so appearing in the build tree, so something is failing silently, I guess. I don’t really care about Python bindings (yet) so I will try your second suggestion and report back. I am building from source on Ubuntu 11.04 “Natty”, by the way.


#6

CMake’s SWIG package trying find ‘swig’ executable, but in Ubuntu it renamed to ‘swig2.0’, use:

cmake -DSWIG_EXECUTABLE=/usr/bin/swig2.0 

to force cmake using right SWIG binary.
I’m using Natty too, so python binding must build if SWIG will be found.


#7

That allowed me to move forward. Now I’m stuck here:

nbest@ec2-184-73-77-157:~$ scidb.py initall scidb
Traceback (most recent call last):
  File "/nfs/software/scidb/11.06/bin/scidb.py", line 382, in <module>
    parse_global_options(configfile)
  File "/nfs/software/scidb/11.06/bin/scidb.py", line 83, in parse_global_options
    for (key, value) in config.items(section_name):
  File "/usr/lib/python2.7/ConfigParser.py", line 339, in items
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'scidb'
nbest@ec2-184-73-77-157:~$ cat /nfs/software/scidb/11.06/etc/config.ini
[scidb]
node-0=10.96.65.140,1
node-1=10.193.138.245,1
node-2=10.214.46.16,1
db_user=scidb
db_passwd=scidb
install_root=/nfs/software/scidb/11.06
metadata=/nfs/software/scidb/11.06/share/scidb/meta.sql
pluginsdir=/nfs/software/scidb/11.06/lib/scidb/plugins
logconf=/nfs/software/scidb/11.06/share/scidb/log1.properties
base-path=/ephemeral/0/scidb_data
base-port=1239
interface=eth0

“section” refers to the name in square brackets in config.ini, right? why would it be ignored? I don’t understand what is happening now.


#8

I just reviewed script scidb.py and found bug — it always using config by default from “/opt/scidb/…” despite prefix during building. Looks like you already installed some files to /opt and they was used. Use third argument for pointing to your config (scidb.py initiall scidb /path/to/config.ini). Also note this script need root for configuring postgresql catalog.