Skip to content

Commit b4c56dc

Browse files
committed
Merge branch 'master' of github.com:nest/nest-simulator into update_models_rst_format
2 parents ccd092c + 27dc242 commit b4c56dc

File tree

18 files changed

+50
-72
lines changed

18 files changed

+50
-72
lines changed

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ set( CMAKE_INSTALL_DATADIR "share/${PROJECT_NAME}" CACHE STRING "Relative direct
9090

9191
include( GNUInstallDirs )
9292

93-
################################################################################
94-
################# Do not install into /usr/local #################
95-
################################################################################
96-
97-
get_filename_component(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
98-
# If CMAKE_INSTALL_PREFIX is omitted CMake will set the installation prefix to its default '/usr/local'.
99-
# This is not desired. A subdirectory is allowed, e.g. 'usr/local/nest'.
100-
if ( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
101-
message( FATAL_ERROR "Do not install into '${CMAKE_INSTALL_PREFIX}'. Please set -DCMAKE_INSTALL_PREFIX:PATH=<install prefix>." )
102-
endif ()
103-
10493
################################################################################
10594
################## Find utility programs ##################
10695
################################################################################

cmake/ConfigureSummary.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ function( NEST_PRINT_CONFIG_SUMMARY )
188188
message( "The NEST executable will be installed to:" )
189189
message( " ${CMAKE_INSTALL_FULL_BINDIR}/" )
190190
message( "" )
191+
message( "NEST dynamic libraries and user modules will be installed to:" )
192+
message( " ${CMAKE_INSTALL_FULL_LIBDIR}/nest/" )
193+
message( "" )
191194
message( "Documentation and examples will be installed to:" )
192195
message( " ${CMAKE_INSTALL_FULL_DOCDIR}/" )
193196
message( "" )

cmake/ProcessOptions.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,14 @@ function( NEST_PROCESS_STATIC_LIBRARIES )
216216
# set the rpath only when installed
217217
if ( APPLE )
218218
set( CMAKE_INSTALL_RPATH
219-
"@loader_path/../${CMAKE_INSTALL_LIBDIR}"
220219
"@loader_path/../${CMAKE_INSTALL_LIBDIR}/nest"
221-
# for pynestkernel: @loader_path at <prefix>/lib/python2.7/site-packages/nest
222-
"@loader_path/../../.."
220+
# for pynestkernel: @loader_path at <prefix>/lib/python3.x/site-packages/nest
223221
"@loader_path/../../../nest"
224222
PARENT_SCOPE )
225223
else ()
226224
set( CMAKE_INSTALL_RPATH
227-
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}"
228225
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/nest"
229-
# for pynestkernel: origin at <prefix>/lib/python2.7/site-packages/nest
230-
"\$ORIGIN/../../.."
226+
# for pynestkernel: origin at <prefix>/lib/python3.x/site-packages/nest
231227
"\$ORIGIN/../../../nest"
232228
PARENT_SCOPE )
233229
endif ()

conngen/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ target_include_directories( conngen PRIVATE
3535
)
3636

3737
install( TARGETS conngen
38-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
39-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
38+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
39+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
4040
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
4141
)
4242

doc/installation/linux_install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ What gets installed where
111111
By default, everything will be installed to the subdirectories ``/install/path/{bin,lib,share}``, where ``/install/path`` is the install path given to ``cmake``:
112112

113113
- Executables ``/install/path/bin``
114-
- Dynamic libraries ``/install/path/lib/``
114+
- Dynamic libraries ``/install/path/lib/nest``
115115
- SLI libraries ``/install/path/share/nest/sli``
116116
- Documentation ``/install/path/share/doc/nest``
117117
- Examples ``/install/path/share/doc/nest/examples``

examples/MyModule/CMakeLists.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,11 @@ execute_process(
214214
# on OS X
215215
set( CMAKE_MACOSX_RPATH ON )
216216

217-
# Use the NEST_INSTALL_* variables as CMAKE_INSTALL_*, if not set explicitly.
218-
if ( "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" )
219-
set( CMAKE_INSTALL_PREFIX "${NEST_INSTALL_PREFIX}" CACHE STRING "Install path prefix, prepended onto install directories." FORCE )
220-
set( CMAKE_INSTALL_LIBDIR "${NEST_LIBDIR}/nest" CACHE STRING "object code libraries (lib/nest or lib64/nest or lib/<multiarch-tuple>/nest on Debian)" FORCE )
221-
set( CMAKE_INSTALL_DOCDIR "${NEST_INSTALL_DOCDIR}" CACHE STRING "documentation root (DATAROOTDIR/doc/nest)" FORCE )
222-
set( CMAKE_INSTALL_DATADIR "${NEST_INSTALL_DATADIR}" CACHE STRING "read-only architecture-independent data (DATAROOTDIR/nest)" FORCE )
223-
endif ()
217+
# Use the NEST_INSTALL_* variables as CMAKE_INSTALL_*
218+
set( CMAKE_INSTALL_PREFIX "${NEST_INSTALL_PREFIX}" CACHE STRING "Install path prefix, prepended onto install directories." FORCE )
219+
set( CMAKE_INSTALL_LIBDIR "${NEST_LIBDIR}" CACHE STRING "object code libraries (lib/nest or lib64/nest or lib/<multiarch-tuple>/nest on Debian)" FORCE )
220+
set( CMAKE_INSTALL_DOCDIR "${NEST_INSTALL_DOCDIR}" CACHE STRING "documentation root (DATAROOTDIR/doc/nest)" FORCE )
221+
set( CMAKE_INSTALL_DATADIR "${NEST_INSTALL_DATADIR}" CACHE STRING "read-only architecture-independent data (DATAROOTDIR/nest)" FORCE )
224222

225223
include( GNUInstallDirs )
226224

@@ -285,7 +283,7 @@ if ( BUILD_SHARED_LIBS )
285283
PREFIX ""
286284
OUTPUT_NAME ${MODULE_NAME} )
287285
install( TARGETS ${MODULE_NAME}_module
288-
DESTINATION ${CMAKE_INSTALL_LIBDIR}
286+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
289287
)
290288
endif ()
291289

@@ -303,7 +301,7 @@ set_target_properties( ${MODULE_NAME}_lib
303301
OUTPUT_NAME ${MODULE_NAME} )
304302

305303
# Install library, header and sli init files.
306-
install( TARGETS ${MODULE_NAME}_lib DESTINATION ${CMAKE_INSTALL_LIBDIR} )
304+
install( TARGETS ${MODULE_NAME}_lib DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest )
307305
install( FILES ${MODULE_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${MODULE_NAME} )
308306
install( DIRECTORY sli DESTINATION ${CMAKE_INSTALL_DATADIR} )
309307

@@ -364,7 +362,7 @@ message( " make" )
364362
message( " make install" )
365363
message( "" )
366364
message( "The library file lib${MODULE_NAME}.so will be installed to" )
367-
message( " ${CMAKE_INSTALL_FULL_LIBDIR}" )
365+
message( " ${CMAKE_INSTALL_FULL_LIBDIR}/nest/" )
368366
message( "Help files will be installed to" )
369367
message( " ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}" )
370368
message( "" )
@@ -373,10 +371,11 @@ message( " (${MODULE_NAME}) Install (in SLI)" )
373371
message( " nest.Install('${MODULE_NAME}') (in PyNEST)" )
374372
message( "" )
375373

376-
if( NOT "${CMAKE_INSTALL_PREFIX}" EQUAL "${NEST_INSTALL_PREFIX}" )
374+
if( NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${NEST_INSTALL_PREFIX}" )
377375
message( "The module will be installed into a non-default location!" )
378376
message( "Make sure to set the environment variables:" )
379-
message( " export NEST_MODULE_PATH=${CMAKE_INSTALL_FULL_LIBDIR}:$NEST_MODULE_PATH" )
377+
message( " export LD_LIBRARY_PATH=${CMAKE_INSTALL_FULL_LIBDIR}/nest:$LD_LIBRARY_PATH" )
378+
message( "Note that on the Mac, the variable LD_LIBRARY_PATH is called DYLD_LIBRARY_PATH." )
380379
message( " export SLI_PATH=${CMAKE_INSTALL_FULL_DATADIR}/sli:$SLI_PATH" )
381380
message( "" )
382381
endif ()

extras/nest-config.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ while test $# -gt 0; do
6666
echo "@ALL_CXXFLAGS@"
6767
;;
6868
--libs)
69-
echo "-L$prefix/@CMAKE_INSTALL_LIBDIR@ @ALL_LIBS@"
69+
echo "-L$prefix/@CMAKE_INSTALL_LIBDIR@/nest @ALL_LIBS@"
7070
;;
7171
--compiler)
7272
echo "@CMAKE_CXX_COMPILER@"

extras/nest_vars.sh.in

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ export NEST_DATA_DIR="${NEST_INSTALL_DIR}/@CMAKE_INSTALL_DATADIR@"
99
# NEST finds help files $NEST_DOC_DIR/help
1010
export NEST_DOC_DIR="${NEST_INSTALL_DIR}/@CMAKE_INSTALL_DOCDIR@"
1111

12-
# The path where NEST looks for user modules.
13-
export NEST_MODULE_PATH="${NEST_INSTALL_DIR}/@CMAKE_INSTALL_LIBDIR@/nest"
12+
# The path in which NEST dynamic libraries are found. Works also if $(DY)LD_LIBRARY_PATH is undefined.
13+
if [[ "$OSTYPE" == "darwin"* ]]; then
14+
export DYLD_LIBRARY_PATH="$NEST_INSTALL_DIR/@CMAKE_INSTALL_LIBDIR@/nest"${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
15+
else
16+
export LD_LIBRARY_PATH="$NEST_INSTALL_DIR/@CMAKE_INSTALL_LIBDIR@/nest"${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
17+
fi
1418

1519
# The path where the PyNEST bindings are installed.
1620
export NEST_PYTHON_PREFIX="${NEST_INSTALL_DIR}/@PYEXECDIR@"
1721

18-
# Prepend NEST to PYTHONPATH in a safe way even if PYTHONPATH is undefined
19-
export PYTHONPATH="${NEST_PYTHON_PREFIX}${PYTHONPATH:+:$PYTHONPATH}"
22+
# Prepend NEST to PYTHONPATH. Works also if $PYTHONPATH is undefined.
23+
export PYTHONPATH="$NEST_PYTHON_PREFIX${PYTHONPATH:+:$PYTHONPATH}"
2024

21-
# Make nest / sli /... executables visible.
25+
# Make nest/sli/... executables visible.
2226
export PATH="${NEST_INSTALL_DIR}/bin:${PATH}"

extras/travis_build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ if [ "$xSTATIC_ANALYSIS" = "1" ]; then
193193
# Set the command line arguments for the static code analysis script and execute it.
194194

195195
# The names of the static code analysis tools executables.
196-
VERA=vera++
196+
VERA=vera++
197197
CPPCHECK=cppcheck
198198
CLANG_FORMAT=clang-format
199199
PEP8=pep8
@@ -275,6 +275,8 @@ echo "MSGBLD0270: Running make install."
275275
make install
276276
echo "MSGBLD0280: Make install completed."
277277

278+
source $NEST_RESULT/bin/nest_vars.sh
279+
278280
echo
279281
echo "+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"
280282
echo "+ R U N N E S T T E S T S U I T E +"

libnestutil/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ target_include_directories( nestutil PRIVATE
4343
)
4444

4545
install( TARGETS nestutil
46-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
47-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
46+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
47+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/nest
4848
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
4949
)
5050

0 commit comments

Comments
 (0)