Skip to content

Commit

Permalink
Merge pull request #1043 from UniStuttgart-VISUS/set-rpath
Browse files Browse the repository at this point in the history
Set RPath and remove megamol.sh script
  • Loading branch information
reinago authored May 25, 2022
2 parents f50c5a2 + 105550e commit 4e2b09e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 41 deletions.
7 changes: 7 additions & 0 deletions cmake/megamol_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ else ()
message(FATAL_ERROR "Unsupported compiler specified: '${CMAKE_CXX_COMPILER_ID}'")
endif ()

# Set RPath to "../lib" on binary install
if (UNIX)
set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
endif ()

# Dependencies

# OpenMP
Expand Down
22 changes: 3 additions & 19 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Our CI pipeline tests the build with gcc-9 and clang-10 on Ubuntu 20.04.

- Hint: Use the `-j` option for `make` to run the build in parallel threads.

7. The run script `megamol.sh` is located in the default installation path `megamol/build/install/bin`.
7. The binary `megamol` is located in the default installation path `megamol/build/install/bin`.

<!-- ---------------------------------------------------------------------- -->
### Command Line Arguments
Expand Down Expand Up @@ -344,22 +344,6 @@ Open a console (e.g *Linux Terminal* or *Windows Powershell*) and change your wo
$ ./megamol
```

If additional external libraries are required (e.g. when using the OSPRay plugin), for Linux you have to run the provided shell script `./megamol.sh` instead.
This script adds the required library path:

```bash
#!/bin/bash
#
# MegaMol startup script
# Copyright 2020, https://megamol.org/
#

BIN_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
cd "$BIN_DIR"

LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./megamol "$@"
```

MegaMol should start and print several messages to the console and an empty rendering window should appear.
You can either check the console log messages or the messages printed in the *Log Console* window.
The leading number of each line is the log level.
Expand Down Expand Up @@ -586,8 +570,8 @@ e.g. mmSetFramebufferSize(100, 100).

**CLI Option:**
`--window wxh+x+y`
e.g. ./megamol.sh --window 100x100 for a window of size 100 x 100 pixels.
Also see help output: `./megamol.sh -h`
e.g. ./megamol --window 100x100 for a window of size 100 x 100 pixels.
Also see help output: `./megamol -h`

### ScreenShooter Module

Expand Down
9 changes: 0 additions & 9 deletions frontend/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ if(BUILD_FRONTEND)
install(FILES $<TARGET_PDB_FILE:${BINARY_NAME}> DESTINATION bin OPTIONAL)
endif()
endif ()

if(UNIX)
include(GNUInstallDirs)
set(cfg_LIB_PATH "../lib") # relative path from bin to lib dir
set(MEGAMOL_SHELL_START_SCRIPT "megamol.sh")
configure_file(extra/megamol.sh.in ${CMAKE_BINARY_DIR}/${MEGAMOL_SHELL_START_SCRIPT} @ONLY)
install(PROGRAMS ${CMAKE_BINARY_DIR}/${MEGAMOL_SHELL_START_SCRIPT} DESTINATION "bin")
endif()

endif()

if(ENABLE_GL)
Expand Down
10 changes: 0 additions & 10 deletions frontend/main/extra/megamol.sh.in

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/cinematic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ In order to run the example change to the `bin` folder of the megamol executable

*Under Windows:* `.\megamol.exe ../examples/cinematic/cinematic_editor_megamol.lua`

*Under Linux:* `./megamol.sh ../examples/cinematic/cinematic_editor_megamol.lua`
*Under Linux:* `./megamol ../examples/cinematic/cinematic_editor_megamol.lua`

### How to use the cinematic editor

Expand Down
3 changes: 1 addition & 2 deletions plugins/mmospray/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ The current dependencies are: [rkcommon](https://github.com/ospray/rkcommon), [o
- CMake subsequently asks for the build files of the following dependencies:
- rkcommon: `<megamol_build_dir>/install/rkcommon/lib/cmake/...`
- Build and install MegaMol.
- In order to test OSPRay, start MegaMol using the example project file `<megamol_build_dir>/install/examples/testspheres_ospray_megamol.lua`.
*Note:* On Linux, you have to run MegaMol using the `megamol.sh` script in order to additionally set the required path to the shared libraries of OSPRay.
- In order to test OSPRay, start MegaMol using the example project file `<megamol_build_dir>/install/examples/testspheres_ospray_megamol.lua`.

## Modules

Expand Down

0 comments on commit 4e2b09e

Please sign in to comment.