BioDynaMo / biodynamo

BioDynaMo is a high-performance and modular, agent-based simulation platform.
Apache License 2.0
94 stars 46 forks source link

Biodynamo installation problem: Paraview and QT #358

Closed scaython closed 6 months ago

scaython commented 7 months ago

Hi,

I am getting the below error when I try to install BioDynaMo:

CMake Error at CMakeLists.txt:338 (MESSAGE):

  FATAL ERROR

  You need to specify both ParaView_DIR and Qt5_DIR in order to build
  BioDynaMo.  This is needed only if you want to use your own versions of
  ParaView and Qt.

Steps I followed:

cd applications
git clone https://github.com/BioDynaMo/biodynamo.git
cd biodynamo
./prerequisites.sh all   
mkdir build && cd build
cmake ..

I tried to cmake with the following flags which I get through running 'which paraview' to find the location of paraview and Qt:

cmake -DParaView_DIR=/usr/local/bin/paraview -DQt5_DIR=/usr/local/Cellar/qt@5/5.15.12/lib/cmake/Qt5/Qt5Config.cmake

But this time I get: Make Error: The source directory "/Users/e/applications/biodynamo/build" does not appear to contain CMakeLists.txt.

Setup

TobiasDuswald commented 7 months ago

Hi @scaython ,

this seems unusual, I don't think we have ever encountered such an error. Can you send us the entire cmake log, from the error itself I cannot conclude what went wrong.

cd applications/biodynamo
rm -rf build
mkdir build && cd build
cmake .. &> cmake.log

I attach a log of a successful cmake command, maybe that helps you to figure out what's wrong already.

cmake.log

scaython commented 7 months ago

Unfortunately it does not work again.

On the first time I ran your given command nothing showed up on my terminal screen. Then I ran again and got the same error:

`CMake Error at CMakeLists.txt:338 (MESSAGE):

FATAL ERROR

You need to specify both ParaView_DIR and Qt5_DIR in order to build BioDynaMo. This is needed only if you want to use your own versions of ParaView and Qt.

`

TobiasDuswald commented 7 months ago

This is the error message again. I need the full output of the cmake command to assist you further.

scaython commented 7 months ago
cd applications/biodynamo
rm -rf build
mkdir build && cd build
cmake .. &> cmake.log

The commands above you gave to me returns no output. And there is no file content in cmake.log either. But if you would like to see whole message terminal message I can give it that as follows:

Alfred-2:build e$ cmake ..
-- Detected OS: osx-12.7-i386
-- Using default real_t (double)
-- Found Python3: /usr/local/bin/python3.9 (found suitable version "3.9.18", required range is "3.9.1...<3.10") found components: Interpreter Development Development.Module Development.Embed 
-- clang-tidy not found
-- clang-format not found
-- Could NOT find ClangTools (missing: CLANG_FORMAT_BIN CLANG_TIDY_BIN) 
CMake Error at CMakeLists.txt:338 (MESSAGE):

  FATAL ERROR

  You need to specify both ParaView_DIR and Qt5_DIR in order to build
  BioDynaMo.  This is needed only if you want to use your own versions of
  ParaView and Qt.

-- Configuring incomplete, errors occurred!

Above is when you try to run cmake .. after removing build folder. And the below output is what I get if I delete everything and try to reinstall it:

-- Detected OS: osx-12.7-i386
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Looking for a C compiler
-- Looking for a C compiler - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Using default real_t (double)
-- Found Python3: /usr/local/bin/python3.9 (found suitable version "3.9.18", required range is "3.9.1...<3.10") found components: Interpreter Development Development.Module Development.Embed 
-- Found MPI_C: /usr/local/Cellar/open-mpi/5.0.1/lib/libmpi.dylib (found version "3.1") 
-- Found MPI_CXX: /usr/local/Cellar/open-mpi/5.0.1/lib/libmpi.dylib (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: C CXX 
-- Found GLUT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/GLUT.framework  
-- Found OpenMP_C: -Xclang -fopenmp (found version "5.0") 
-- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.0") 
-- Found OpenMP: TRUE (found version "5.0")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Git: /usr/local/bin/git (found version "2.43.0") 
-- Found ROOT: /var/folders/c7/wbm4b4t55h90gc71bgjmzm780000gq/T/tmp.CwREYPCX/biodynamo/build/third_party/root/bin/root-config  
-- clang-tidy not found
-- clang-format not found
-- Could NOT find ClangTools (missing: CLANG_FORMAT_BIN CLANG_TIDY_BIN) 
CMake Error at CMakeLists.txt:338 (MESSAGE):

  FATAL ERROR

  You need to specify both ParaView_DIR and Qt5_DIR in order to build
  BioDynaMo.  This is needed only if you want to use your own versions of
  ParaView and Qt.

-- Configuring incomplete, errors occurred!
TobiasDuswald commented 7 months ago

So it seems as if the build enters into the following if statement:

    if ((DEFINED ENV{ParaView_DIR} AND NOT DEFINED ENV{Qt5_DIR}) OR (NOT DEFINED ENV{ParaView_DIR} AND DEFINED ENV{Qt5_DIR}))
        MESSAGE(FATAL_ERROR "\nFATAL ERROR \nYou need to specify both ParaView_DIR and Qt5_DIR in order to build "
                "BioDynaMo. This is needed only if you want to use your own versions of ParaView and Qt.")
    endif()

This if statement checks for environment variables ParaView_DIR and Qt5_DIR. One of them is defined, and one isn't. I'd generally recommend defining neither and relying on our prebuilds.

Check if these environment variables are set with printenv. If so, unset them.

unset Qt5_DIR
unset ParaView_DIR
cmake ..
make -j

Hopefully this will fix it. If not, try

cmake -Dparaview=off ..
make -j

such that we can confirm that this issue is coming from the paraview section.

TobiasDuswald commented 7 months ago

And just because we had this issue in the past for macos, you have installed the command line tools, haven't you? see dependencies

scaython commented 7 months ago

After running

cmake -Dparaview=off ..
make -j

I get:

18 warnings generated.
[100%] Linking CXX shared library lib/libbiodynamo-unit-tests.dylib
[100%] Built target biodynamo-unit-tests
[100%] Building CXX object CMakeFiles/biodynamo-unit-tests-bin.dir/CMakeFiles/biodynamo-unit-tests-main.cc.o
[100%] Linking CXX executable bin/biodynamo-unit-tests
[100%] Built target biodynamo-unit-tests-bin

And all those warnings were similar in format:

/Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:54:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "/Users/e/applications/biodynamo/test/unit/test_util/test_agent.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h"
/Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:55:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
#include "/Users/e/applications/biodynamo/test/unit/test_util/test_util.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h"

cmake seems like working as it gave me the following:

You have just finished to configure the BioDynaMo source.
Compile it by running "make -j 8".
Before using it do ". /Users/e/applications/biodynamo/build/bin/thisbdm.sh".

To test bioynamo I typed: biodynamo on a new shell. And it is working with the following error:


e$ biodynamo
/Users/e/Applications/biodynamo/build/bin/new_command.py:27: SyntaxWarning: invalid escape sequence '\-'
  pattern = re.compile("^[a-zA-Z]+[a-zA-Z0-9\-_]+$")
/Users/e/Applications/biodynamo/build/bin/util.py:26: SyntaxWarning: invalid escape sequence '\('
  return re.search("project\((.*)\)", content).group(1)
usage: biodynamo [-h] [-v] [--shortversion]
                 {build,clean,config,demo,view,new,run,test} ...

This is the BioDynaMo command line interface. It guides you during the whole
simulation workflow. From starting a new project,to compiling and executing
your simulation.

positional arguments:
  {build,clean,config,demo,view,new,run,test}
    build               Builds the simulation binary
    clean               Removes all build files
    config              Prints the configuration of BDM.
    demo                Creates pre-built demos.
    view                If possible, opens the output in ParaView.
    new                 Creates a new simulation project. Creates a template
                        project, renames it to the given simulation name,
                        configures git.
    run                 Executes the simulation
    test                Executes the unit-tests of a BioDynaMo simulation.

options:
  -h, --help            show this help message and exit
  -v, --version         Display BioDynaMo version
  --shortversion        Display BioDynaMo short version

Should I ignore this error? If so, problem solved.

TobiasDuswald commented 7 months ago

Alright, so we're getting closer. Generally, we follow the development philosophy to treat compiler warnings as errors so this is not perfect yet.

  1. I'm not sure where the warnings are coming from. I suspect this comes from the path that you use for installing BioDynaMo but I cannot debug that from here. Possibly just clone Biodynamo in your home directory and build again to see if this is sufficient to get rid of the warnings. Otherwise may be a good idea to google the compiler warning or paste it into ChatGPT.
  2. Despite the warnings, it seems as if your installation was successful. Maybe try
    cd <path of choice>
    bdm demo pyramidal_cell
    cd pyramidal_cell
    bdm run
  3. You have now installed BDM without Paraview support. I think this is a significant limitation. Have you checked the environment variables as I suggested before?
FonsRademakers commented 7 months ago

Hi,

please check that:

Prerequisites are installed: $ brew install libomp open-mpi @. wget cmake ninja @. libgit2 bash

$ xcodebuild -version Xcode 15.2 Build version 15C500b

$ xcode-select -p /Applications/Xcode.app/Contents/Developer

$ $SHELL —version GNU bash, version 5.2.26(1)-release (x86_64-apple-darwin23.2.0) Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

In this case $ mkdir build; cd build $ cmake -DCMAKE_BUILD_TYPE=Release .. $ make -j $ . bin/thisbdm.sh $ bin/biodynamo-unit-tests

should work.

Cheers, Fons.

On Feb 8, 2024, at 23:16, Enes Aydin @.***> wrote:

After running cmake -Dparaview=off .. make -j

I get: 18 warnings generated. [100%] Linking CXX shared library lib/libbiodynamo-unit-tests.dylib [100%] Built target biodynamo-unit-tests [100%] Building CXX object CMakeFiles/biodynamo-unit-tests-bin.dir/CMakeFiles/biodynamo-unit-tests-main.cc.o [100%] Linking CXX executable bin/biodynamo-unit-tests [100%] Built target biodynamo-unit-tests-bin

And all those warnings were similar in format: /Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:54:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]

include "/Users/e/applications/biodynamo/test/unit/test_util/test_agent.h"

^~~~~~~~~~~~~~ "Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h" /Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:55:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]

include "/Users/e/applications/biodynamo/test/unit/test_util/test_util.h"

^~~~~~~~~~~~~~~~~ "Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h"

cmake seems like working as it gave me the following: You have just finished to configure the BioDynaMo source. Compile it by running "make -j 8". Before using it do ". /Users/e/applications/biodynamo/build/bin/thisbdm.sh".

To test bioynamo I typed: biodynamo on a new shell. And it is working with the following error:

e$ biodynamo /Users/e/Applications/biodynamo/build/bin/newcommand.py:27: SyntaxWarning: invalid escape sequence '-' pattern = re.compile("^[a-zA-Z]+[a-zA-Z0-9-]+$") /Users/e/Applications/biodynamo/build/bin/util.py:26: SyntaxWarning: invalid escape sequence '(' return re.search("project((.*))", content).group(1) usage: biodynamo [-h] [-v] [--shortversion] {build,clean,config,demo,view,new,run,test} ...

This is the BioDynaMo command line interface. It guides you during the whole simulation workflow. From starting a new project,to compiling and executing your simulation.

positional arguments: {build,clean,config,demo,view,new,run,test} build Builds the simulation binary clean Removes all build files config Prints the configuration of BDM. demo Creates pre-built demos. view If possible, opens the output in ParaView. new Creates a new simulation project. Creates a template project, renames it to the given simulation name, configures git. run Executes the simulation test Executes the unit-tests of a BioDynaMo simulation.

options: -h, --help show this help message and exit -v, --version Display BioDynaMo version --shortversion Display BioDynaMo short version

Should I ignore this error? If so, problem solved. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Dr. Fons Rademakers Senior Scientist CERN - European Organization for Nuclear Research

scaython commented 6 months ago

Hi, please check that: Prerequisites are installed: $ brew install libomp open-mpi @. wget cmake ninja @. libgit2 bash $ xcodebuild -version Xcode 15.2 Build version 15C500b $ xcode-select -p /Applications/Xcode.app/Contents/Developer $ $SHELL —version GNU bash, version 5.2.26(1)-release (x86_64-apple-darwin23.2.0) Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. In this case $ mkdir build; cd build $ cmake -DCMAKE_BUILD_TYPE=Release .. $ make -j $ . bin/thisbdm.sh $ bin/biodynamo-unit-tests should work. Cheers, Fons. On Feb 8, 2024, at 23:16, Enes Aydin @.> wrote: After running cmake -Dparaview=off .. make -j I get: 18 warnings generated. [100%] Linking CXX shared library lib/libbiodynamo-unit-tests.dylib [100%] Built target biodynamo-unit-tests [100%] Building CXX object CMakeFiles/biodynamo-unit-tests-bin.dir/CMakeFiles/biodynamo-unit-tests-main.cc.o [100%] Linking CXX executable bin/biodynamo-unit-tests [100%] Built target biodynamo-unit-tests-bin And all those warnings were similar in format: /Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:54:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] #include "/Users/e/applications/biodynamo/test/unit/test_util/test_agent.h" ^~~~~~~~~~~~~~ "Userss/e/Applications/biodynamo/test/unit/test_util/test_agent.h" /Users/e/applications/biodynamo/build/libbiodynamo-unit-tests_dict.cc:55:10: warning: non-portable path to file '"Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path] #include "/Users/e/applications/biodynamo/test/unit/test_util/test_util.h" ^~~~~~~~~~~~~~~~~ "Userss/e/Applications/biodynamo/test/unit/test_util/test_util.h" cmake seems like working as it gave me the following: You have just finished to configure the BioDynaMo source. Compile it by running "make -j 8". Before using it do ". /Users/e/applications/biodynamo/build/bin/thisbdm.sh". To test bioynamo I typed: biodynamo on a new shell. And it is working with the following error: e$ biodynamo /Users/e/Applications/biodynamo/build/bin/newcommand.py:27: SyntaxWarning: invalid escape sequence '-' pattern = re.compile("^[a-zA-Z]+[a-zA-Z0-9-]+$") /Users/e/Applications/biodynamo/build/bin/util.py:26: SyntaxWarning: invalid escape sequence '(' return re.search("project((.))", content).group(1) usage: biodynamo [-h] [-v] [--shortversion] {build,clean,config,demo,view,new,run,test} ... This is the BioDynaMo command line interface. It guides you during the whole simulation workflow. From starting a new project,to compiling and executing your simulation. positional arguments: {build,clean,config,demo,view,new,run,test} build Builds the simulation binary clean Removes all build files config Prints the configuration of BDM. demo Creates pre-built demos. view If possible, opens the output in ParaView. new Creates a new simulation project. Creates a template project, renames it to the given simulation name, configures git. run Executes the simulation test Executes the unit-tests of a BioDynaMo simulation. options: -h, --help show this help message and exit -v, --version Display BioDynaMo version --shortversion Display BioDynaMo short version Should I ignore this error? If so, problem solved. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: **@.***> -- Dr. Fons Rademakers Senior Scientist CERN - European Organization for Nuclear Research

I can confirm this the working solution. But first I removed all the biodynamo folder and recloned again. Now, it seems like working with Paraview.

Thank you.

TobiasDuswald commented 6 months ago

Great, glad everything is working now @scaython; enjoy using BioDynaMo! Thanks, @FonsRademakers for your clarifying comment!