Wrong installation dir of modules on Ubuntu
Summary
On Ubuntu 18.04 (and other version using dash), compilation of modules such as runTimePostProcessing finishes successfully. However, installation directory is wrong.
Expected dir: $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib
Installed dir: $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/lib
Related issue:
Steps to reproduce
cd $WM_THIRD_PARTY_DIR
makeParaView
ln -s ParaView-v5.6.3/VTK/ VTK-8.2.0
makeVTK
wmRefresh
cd $WM_PROJECT_DIR
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/ParaView-5.6.3
export VTK_DIR=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/VTK-8.2.0
foam
./Allwmake -j -s -l
You can check the functionality with tutorials/incompressible/simpleFoam/windAroundBuildings.
You will get the error message like this librunTimePostProcessing.so: cannot open shared object file: No such file or directory
.
Example case
What is the current bug behaviour?
Library files like librunTimePostProcessing.so
are stored in the directory $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/lib
.
What is the expected correct behavior?
Library files like librunTimePostProcessing.so
should be stored in the directory $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib
.
Relevant logs and/or images
Partially modified (to smear a user name) $WM_PROJECT_DIR/build/linux64GccDPInt32Opt/modules/visualization/src/runTimePostProcessing/cmake_install.cmake
file
# Install script for directory: $WM_PROJECT_DIR/modules/visualization/src/runTimePostProcessing
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
CMAKE_INSTALL_PREFIX does not need the last “lib”.
Environment information
- OpenFOAM version : OpenFOAM v2006
- Operating system : Ubuntu 18.04.4
- Hardware info :
- Compiler : gcc 7.5.0
Possible fixes
This will be related to dash (not bash) used in Ubuntu.
The test script is created using line 17 of `$WM_PROJECT_DIR/modules/visualization/src/runTimePostProcessing/Allwmake. The above modification rips “lib” off from $FOAM_LIBBIN with dash or bash.
Original:
: "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
Modification:
: "${CMAKE_INSTALL_PREFIX:="${FOAM_LIBBIN%/*}"}"
test01.sh <- not modified with sh
test01bash.sh <- not modified with bash
test02.sh <- modified with sh
test02bash.sh <- modified with bash
$ ./test01.sh
#!/bin/sh
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
$ ./test01bash.sh
#!/bin/bash
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt
$ ./test02.sh
#!/bin/sh
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt
$ ./test02bash.sh
#!/bin/bash
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
/home/user/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt
/label bug