BioDynaMo / biodynamo

BioDynaMo is a high-performance and modular, agent-based simulation platform.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation issue on macOS 14.0

lasimons opened this issue · comments

Describe the bug
The installation of BioDynaMo on macOS 14.0 does not work and it gives an error about not finding ROOT.
The error:
CMake Error at cmake/external/ROOT.cmake:35 (download_verify_extract):
download_verify_extract Function invoked with incorrect arguments for
function named: download_verify_extract
Call Stack (most recent call first):
cmake/utils.cmake:94 (include)
CMakeLists.txt:307 (verify_ROOT)

CMake Error at /opt/homebrew/Cellar/cmake/3.27.8/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find ROOT (missing: ROOT_CONFIG_EXECUTABLE ROOTSYS ROOT_VERSION
ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.27.8/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
cmake/FindROOT.cmake:92 (find_package_handle_standard_args)
cmake/external/ROOT.cmake:42 (find_package)
cmake/utils.cmake:94 (include)
CMakeLists.txt:307 (verify_ROOT)

-- Configuring incomplete, errors occurred!
Something went wrong with the installation. For more details check the log file: /var/folders/m3/h_y1grh16dsdxyfx_cc4dlxc0000gp/T/tmp.uHiTvYAhlT/biodynamo/installation.log

Before giving this error, it gives a warning that ROOT is not installed on the system:
We did not find any ROOT installed on the system. We will proceed to download it. ROOT will be installed in the location /var/folders/m3/h_y1grh16dsdxyfx_cc4dlxc0000gp/T/tmp.uHiTvYAhlT/biodynamo/build/third_party/root.

To Reproduce
I used the following command to install BioDynaMo in my zsh shell: curl https://biodynamo.github.io/install | bash

The log is attached. installation.log

Expected behavior
I expect the installation to be successful.

Setup (please complete the following information):

  • OS: macOS Sonoma (14.0)

Hi @lasimons ,
Thanks for your interest in BioDynaMo, and I'm sorry you encountered some issues. If I'm not mistaken, the one-liner tries to install the 1.04 release. Our macOS support is a little bit more sensitive to updates in the operating system, and we usually push the updates to master on a rolling basis, ensuring everything works smoothly. It would probably be good to push these fixes to the 1.04 branch, but typically, we don't do that.

Could you try installing our software following:

export BDM_INSTALL=master
curl https://biodynamo.github.io/install | bash

Please let me know if that fixes your issue or if the error persists. :)

Hi @TobiasDuswald,
Thank you very much for looking at the issue. The error with ROOT is now solved. However, multiple other errors are produced (too many to write down here).
Hereby the log file.
installation.log
Many thanks.

Alright, these are indeed quite a few error messages. If I compile BDM on osx13.4, my first lines read:

-- Detected OS: osx-13.4-arm64
-- 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
[...]

Yours says

-- Detected OS: osx-14.0-arm64
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /Library/Developer/CommandLineTools/usr/bin/c++
-- Looking for a C compiler
-- Looking for a C compiler - /Library/Developer/CommandLineTools/usr/bin/cc
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

If you want to install BioDynaMo, you need to have XCode installed. I don't know if you have because our CXX compiler differ. Can you check if you have XCode (and all other macOS relevant dependencies) installed?

I have Xcode installed as an app and I also have the Command-Line Tools installed. I also checked and installed the dependencies/packages you send me. However, the error persists.

I'm not sure but it still seems as if somethings's off with your XCode setup. From your log:

########################### WARNING ############################

We did not find any ROOT installed on the system. We will proceed to download it. ROOT will be installed in the location /Users/tobias/tmp/biodynamo/build/third_party/root.

################################################################
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
-- ##### XCODE version:
-- ##### Using ROOT builds for XCODE 13.1

When I install:

########################### WARNING ############################

We did not find any ROOT installed on the system. We will proceed to download it. ROOT will be installed in the location /Users/tobias/tmp/biodynamo/build/third_party/root.

################################################################

-- ##### XCODE version: 14.1

-- ##### Using ROOT builds for XCODE 14.1
-- Using  ROOT tarball    : root_v6.26.06_cxx14_python3.9_osx-xcode-14.1-arm64.tar.gz
-- Using  ROOT source dir : /Users/tobias/tmp/biodynamo/build/third_party/root
-- Using  ROOT SHA key    : osx-xcode-14.1-arm64-ROOT

We determine the XCode version with the command xcodebuild -version | sed -En 's/Xcode[[:space:]]+([0-9\.]*)/\\1/p' in the build system. We need to understand that for ABI compatibility with root cling.

So I think it's a two step process.

  1. You need to figure out what's up with your XCode config and why xcodebuild -version fails with the error above.
  2. Once we have resolved that issue, we need to check if we need to build ROOT for your XCode version. (possible but probably not).

We cannot assess 2 before 1, though.

So you would like to get the following output:
image

(version may differ)

I'd recommend you clone the repository rather than using the one-line installer for quicker iterations. This will make troubleshooting easier.

cd <path-of-choice>
git clone https://github.com/BioDynaMo/biodynamo.git
cd biodynamo
mkdir build
cd build
# Run cmake (make sure the error xcode-select: error: is gone)
cmake .. 
# If no more error, test root version
third_party/root/bin/root             # if no errors, exit with .q + enter
# Compile
make -j

This might be related but not entirely sure @lasimons.
nodejs/node-gyp#569

I had a quick chat with @Senui and @FonsRademakers, and we have previously encountered a similar problem. To set up your system appropriately, you must first install Xcode from the app store and afterward install the command line tools. You may need to get rid of your present Xcode installation @lasimons.

Development task

  • Add check for incomplete Xcode installation

@lasimons Did you manage to resolve your issue with Xcode?

Hi @TobiasDuswald,
Sorry for the late reply. Thank you for your comments. I uninstalled both XCode and the Command Line Tools and reinstalled them in the order you mentioned. However, I still get errors. I will reset my MacBook asap and reinstall it and everything else again to be sure.

I installed it again in the correct order (I also reset my MacBook). There are still some errors (which look like problems with the Jupyter Notebooks?).
Hereby, the log file.
installation.log

Great, one step closer!

These are indeed errors related to the notebooks. I have never used them myself for anything else than reading them and was not involved in their development. I recommend you to follow the cmake install the I described above. With cmake you you can turn off building the notebooks (actually that's the default option). So if you follow the instructions above (#352 (comment)), everything should go smoothly now.

That does not fix the notebooks for you, but should get BioDynaMo (finally) running for you.

The installation works now! I tested the cell division demo as an example and it works (says " Finished successfully."). However, I get an error "clang: error: argument to '-isysroot' is missing (expected 1 value)" but it says that the simulation was completed successfully. Is the error important?

To be frank I've never seen the error and from the top of my head I don't know where it's coming from. I'd advise to run our unit tests once on your computer to verify that software components work as expected. The following commands assume that you have BDM build as described in #352 (comment):

 <path-of-choice>/biodynamo
. build/bin/thisbdm.sh  # sources BDM, note the space between '.' and build.
cd build
./bin/biodynamo-unit-tests

That should take < 5 min and if everything is green it should be fine.

I wonder if you may have overlooked the sourcing part previously and then the compiler did not find root or so. But I'm not sure why the simulation would have worked then.

Whenever you open a new terminal and you want to compile a BDM related project, sourcing BDM is the first thing you want to do.

#open new terminal
. <path-of-choice>/biodynamo/build/bin/thisbdm.sh # make an alias in your bashrc / zshrc if your getting tired of typing that command
# navigate somewhere
cd <other-path-of-choice>
bdm demo
bdm demo pyramidal_cell
cd pyramidal_cell
bdm run

Thank you for replying. When I run third_party/root/bin/root, I get multiple errors

clang: error: argument to '-isysroot' is missing (expected 1 value)
clang: error: no input files
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk   -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
clang: error: argument to '-isysroot' is missing (expected 1 value)
clang: error: no input files
With exit code 0
   ------------------------------------------------------------------
  | Welcome to ROOT 6.29/01                        https://root.cern |
  | (c) 1995-2022, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Apr 20 2023, 11:26:00                   |
  | From heads/master@v6-29-01-1195-g5d5e1bcce1                      |
  | With Apple clang version 14.0.3 (clang-1403.0.22.14.1)           |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

input_line_12:2:2: fatal error: 'libbiodynamo' file not found
 R__LOAD_LIBRARY(libbiodynamo)
 ^
/Users/lhasimons/biodynamo/build/third_party/root/include/Rtypes.h:473:35: note: expanded from macro 'R__LOAD_LIBRARY'
# define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(cling load ( #LIBRARY ))
                                  ^
/Users/lhasimons/biodynamo/build/third_party/root/include/Rtypes.h:472:26: note: expanded from macro '_R_PragmaStr'
# define _R_PragmaStr(x) _Pragma(#x)
                         ^
<scratch space>:12:30: note: expanded from here
 cling load ( "libbiodynamo" )
                             ^
input_line_14:1:10: fatal error: 'biodynamo.h' file not found
#include "biodynamo.h"
         ^~~~~~~~~~~~~
input_line_15:1:17: error: expected namespace name
using namespace bdm;
                ^
input_line_16:2:2: error: unknown type name 'Simulation'
 Simulation simulation("simulation");
 ^
INFO: Created simulation object 'simulation' with UniqueName='simulation'.
root [0]

However, when running the unit tests, I get an error about -isysroot but everything is green.

This might be related to https://root-forum.cern.ch/t/issues-with-root-after-the-developer-tools-apdate/56410.
What's the output of your xcodebuild --version?

xcodebuild: error: invalid option '--version'

Also, how can I update ROOT as suggested in the link? The installation script of BioDynaMo already installs ROOT.

xcodebuild -version gives me:
Xcode 15.0.1
Build version 15A507

We build ROOT for our users such that you (usually / ideally) don't have to worry about it. However, the major Xcode updates require us to rebuild ROOT and upload them to the server. In our build system we extract the Xcode version and choose the appropriate ROOT build for you.

Unfortunately, you're the first person with Xcode 15.0 which makes you the first person to encounter that problem. We will have to build ROOT for Xcode 15.0, upload it to our servers, and update our CMake.

In recent updates these Xcode updates would crash root badly, here it seems if you can still use BDM for now as it is, but I recommend updating once the BDM update is available on master.

I'll get back to you.

Thank you very much! Shall I then close this issue or not yet?

No worries, let's keep it open for now.

I've updated the ROOT version for macOS 14 with Xcode 15. Please try to install again.

Hi @FonsRademakers and @TobiasDuswald,
The -isysroot error I got when running the unit tests is gone. However, third_party/root/bin/root still gives an error

   ------------------------------------------------------------------
  | Welcome to ROOT 6.28/06                        https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for macosxarm64 on Aug 28 2023, 11:29:15                   |
  | From tags/v6-28-06@v6-28-06                                      |
  | With Apple clang version 15.0.0 (clang-1500.0.40.1)              |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

input_line_12:2:2: fatal error: 'libbiodynamo' file not found
 R__LOAD_LIBRARY(libbiodynamo)
 ^
/Users/lhasimons/biodynamo/build/third_party/root/include/Rtypes.h:475:35: note: expanded from macro 'R__LOAD_LIBRARY'
# define R__LOAD_LIBRARY(LIBRARY) _R_PragmaStr(cling load ( #LIBRARY ))
                                  ^
/Users/lhasimons/biodynamo/build/third_party/root/include/Rtypes.h:474:26: note: expanded from macro '_R_PragmaStr'
# define _R_PragmaStr(x) _Pragma(#x)
                         ^
<scratch space>:13:30: note: expanded from here
 cling load ( "libbiodynamo" )
                             ^
input_line_14:1:10: fatal error: 'biodynamo.h' file not found
#include "biodynamo.h"
         ^~~~~~~~~~~~~
input_line_15:1:17: error: expected namespace name
using namespace bdm;
                ^
input_line_16:2:2: error: unknown type name 'Simulation'
 Simulation simulation("simulation");
 ^
INFO: Created simulation object 'simulation' with UniqueName='simulation'.
root [0] 

Did the biodynamo built finish correctly? If so, did you execute the thisbdm.sh script before running, do:
. bin/thisbdm.sh

A handy bash shell alias is:
alias thisbdm='. bin/thisbdm.sh'

After thisbdm the correct ROOT will be found in the search path, just typing root will be enough:
`(drroot) [130] cd biodynamo/build/
[master] (drroot) [131] thisbdm
[OK] You have successfully sourced BioDynaMo's environment.
[bdm-1.5.98] [master] (drroot) [132] which root
root
[bdm-1.5.98] [master] (drroot) [133] root
INFO: Created simulation object 'simulation' with UniqueName='simulation'.
root [0]
Loading BioDynaMo into ROOT...
INFO: Created simulation object 'simulation' with UniqueName='simulation'.
root [1]

Thanks for your effort and providing the new ROOT builds @FonsRademakers ! 🚀

@lasimons to me it also looks as if you had not sourced bdm before running ROOT

Yes, that was the problem! It is solved now. The unit tests (as was mentioned before) work too. Thank you very much for helping me with this issue 😄

You're very much welcome! Hope from now on it will go a bit smoother for you. In case you encounter other problems or have questions feel free to open another issue. Enjoy using BioDynaMo!

Fixed with 893ea4e and 4cbeec6.