amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

Error with Building wheels for collected packages: amuse-galaxia and many other #1050

Closed marlito-gonaldo-byte closed 2 months ago

marlito-gonaldo-byte commented 2 months ago

I am trying to install amuse for creating cluster to be used as input data for PeTar N-body simulation on a MacBook Pro M2 2022. So I believe I only need amuse-galaxia ? The code is downloaded using : git clone https://github.com/amusecode/amuse.git I followed documentation steps, using python virtual environment : https://amuse.readthedocs.io/en/latest/install/howto-install-AMUSE.html , note that I am using homebrew instead of MacPort, so I configured manually the environment, here is my .zprofile file :

export PATH=/opt/homebrew/bin:$PATH
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"
export PATH="/opt/homebrew/bin/python3.9$PATH"
export PATH="/opt/homebrew/bin/mpiexec:$PATH"
export LD_LIBRARY_PATH=/opt/homebrew/lib/:$LD_LIBRARY_PATH

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

and my .zshrc :

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/maelgonin/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/maelgonin/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/maelgonin/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/maelgonin/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

giving this virtual environment $PATH : /Users/maelgonin/Desktop/PBH/code/Amuse-env/bin:/Users/maelgonin/.pyenv/shims:/opt/homebrew/bin/mpiexec:/opt/homebrew/bin/python3.9/Applications/Sublime Text.app/Contents/SharedSupport/bin:/opt/homebrew/bin:/opt/homebrew/bin/mpiexec:/opt/homebrew/bin/python3.9/Applications/Sublime Text.app/Contents/SharedSupport/bin:/opt/homebrew/bin:/usr/local/opt/python@3.9/bin:/Users/maelgonin/anaconda3/bin:/Users/maelgonin/anaconda3/condabin:/usr/local/opt/python@3.9/bin:/usr/local/opt/openmpi/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin

I don't know why /usr/local/opt/openmpi/bin and /usr/local/opt/python@3.9/bin keep appearing in my PATH since it is not mentioned neither in my .zprofile nor .zshrc and this directory does not exist.

When I try pip install --no-cache-dir --force-reinstall amuse-galaxia :

Collecting amuse-galaxia
  Downloading amuse-galaxia-2024.4.0.tar.gz (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.0/40.0 kB 3.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting amuse-framework (from amuse-galaxia)
  Downloading amuse-framework-2024.4.0.tar.gz (678 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 679.0/679.0 kB 15.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting setuptools>=41.0.0 (from amuse-framework->amuse-galaxia)
  Downloading setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
Collecting setuptools-scm (from amuse-framework->amuse-galaxia)
  Downloading setuptools_scm-8.0.4-py3-none-any.whl.metadata (6.4 kB)
Collecting pip>=19.0.0 (from amuse-framework->amuse-galaxia)
  Downloading pip-24.0-py3-none-any.whl.metadata (3.6 kB)
Collecting wheel>=0.32 (from amuse-framework->amuse-galaxia)
  Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Collecting docutils>=0.6 (from amuse-framework->amuse-galaxia)
  Downloading docutils-0.21.2-py3-none-any.whl.metadata (2.8 kB)
Collecting numpy>=1.2.2 (from amuse-framework->amuse-galaxia)
  Downloading numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.1/61.1 kB 430.9 MB/s eta 0:00:00
Collecting pytest>=4.0 (from amuse-framework->amuse-galaxia)
  Downloading pytest-8.2.0-py3-none-any.whl.metadata (7.5 kB)
Collecting h5py>=1.1.0 (from amuse-framework->amuse-galaxia)
  Downloading h5py-3.11.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (2.5 kB)
Collecting iniconfig (from pytest>=4.0->amuse-framework->amuse-galaxia)
  Downloading iniconfig-2.0.0-py3-none-any.whl.metadata (2.6 kB)
Collecting packaging (from pytest>=4.0->amuse-framework->amuse-galaxia)
  Downloading packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting pluggy<2.0,>=1.5 (from pytest>=4.0->amuse-framework->amuse-galaxia)
  Downloading pluggy-1.5.0-py3-none-any.whl.metadata (4.8 kB)
Collecting exceptiongroup>=1.0.0rc8 (from pytest>=4.0->amuse-framework->amuse-galaxia)
  Downloading exceptiongroup-1.2.1-py3-none-any.whl.metadata (6.6 kB)
Collecting tomli>=1 (from pytest>=4.0->amuse-framework->amuse-galaxia)
  Downloading tomli-2.0.1-py3-none-any.whl.metadata (8.9 kB)
Collecting typing-extensions (from setuptools-scm->amuse-framework->amuse-galaxia)
  Downloading typing_extensions-4.11.0-py3-none-any.whl.metadata (3.0 kB)
Downloading docutils-0.21.2-py3-none-any.whl (587 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.4/587.4 kB 27.7 MB/s eta 0:00:00
Downloading h5py-3.11.0-cp39-cp39-macosx_11_0_arm64.whl (3.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 52.8 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 49.7 MB/s eta 0:00:00
Downloading pip-24.0-py3-none-any.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 57.2 MB/s eta 0:00:00
Downloading pytest-8.2.0-py3-none-any.whl (339 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 339.2/339.2 kB 99.2 MB/s eta 0:00:00
Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 54.9 MB/s eta 0:00:00
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 305.1 MB/s eta 0:00:00
Downloading setuptools_scm-8.0.4-py3-none-any.whl (42 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.1/42.1 kB 259.9 MB/s eta 0:00:00
Downloading exceptiongroup-1.2.1-py3-none-any.whl (16 kB)
Downloading packaging-24.0-py3-none-any.whl (53 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 kB 302.5 MB/s eta 0:00:00
Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Downloading typing_extensions-4.11.0-py3-none-any.whl (34 kB)
Building wheels for collected packages: amuse-galaxia, amuse-framework
  Building wheel for amuse-galaxia (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for amuse-galaxia (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [89 lines of output]
      WARNING setuptools_scm._integration.setuptools pyproject.toml does not contain a tool.setuptools_scm section
      WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/amuse
      creating build/lib/amuse/community
      creating build/lib/amuse/community/galaxia
      copying src/amuse/community/galaxia/_version.py -> build/lib/amuse/community/galaxia
      copying src/amuse/community/galaxia/interface.py -> build/lib/amuse/community/galaxia
      copying src/amuse/community/galaxia/__init__.py -> build/lib/amuse/community/galaxia
      running build_codes
      building libraries and community codes
      build, for logging, see 'build.log'
      creating build/temp.macosx-14-arm64-cpython-39
      creating build/temp.macosx-14-arm64-cpython-39/codes
      creating build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      copying src/amuse/community/galaxia/_version.py -> build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      copying src/amuse/community/galaxia/Makefile -> build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      copying src/amuse/community/galaxia/interface.py -> build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      copying src/amuse/community/galaxia/__init__.py -> build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      copying src/amuse/community/galaxia/interface.f90 -> build/temp.macosx-14-arm64-cpython-39/codes/galaxia
      [12:13:16] building galaxia
      error in call, tail output:

      amusifier --type=f90 interface.py  BarAndSpiralsInterface -o worker_code.f90
      gfortran -c -g -O2 -fno-common -o interface.o interface.f90
      mpif90 -g -O2 -fno-common -I/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/share/amuse/lib/forsockets worker_code.f90 interface.o -o GalaxyModel_worker  -L/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/share/amuse/lib/forsockets -lforsockets -llapack -lblas
      ld: library not found for -ld_classic
      collect2: error: ld returned 1 exit status
      make: *** [GalaxyModel_worker] Error 1

      --------------------------------------------------------------------------------
      will copy worker: src/amuse/community/galaxia
      galaxia
      Community codes not built (because of errors/ missing libraries):
      ================================================================================
       * galaxia
      ================================================================================
      0 out of 1 codes built, 0 out of 0 libraries built
      Traceback (most recent call last):
        File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 410, in build_wheel
          return self._build_with_temp_dir(
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 43, in <module>
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-build-env-hbf6o4n5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-install-tb9ccylb/amuse-galaxia_d3083b773815464d960ac29942a9351a/support/setup_codes.py", line 1101, in run
          raise Exception("No succesful builds detected. Aborting.")
      Exception: No succesful builds detected. Aborting.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for amuse-galaxia
  Building wheel for amuse-framework (pyproject.toml) ... done
  Created wheel for amuse-framework: filename=amuse_framework-2024.4.0-py3-none-any.whl size=619114 sha256=a9702a48c7cd44d235551e3cd3249433da39ed39a683b4064b1de2e5bf49ed41
  Stored in directory: /private/var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T/pip-ephem-wheel-cache-jfeamdcq/wheels/80/0b/b3/aaf563f4d374886e80eddcf89ae4e21abc0d78b954c7f929b1
Successfully built amuse-framework
Failed to build amuse-galaxia
ERROR: Could not build wheels for amuse-galaxia, which is required to install pyproject.toml-based projects

the config.mk file : config.txt

I should mentioned that I went through every solved issue mentioning "wheel" and couldn't find anything helping, I also tried the development build and I am only able to build 21 out 56 code and 5 out 6 libraries.

I believe it is a library issue because of this line ld: library not found for -ld_classic on the output of pip install --no-cache-dir --force-reinstall amuse-galaxia but I can't figure out where is my mistake...

LourensVeen commented 2 months ago

Hi, apologies for the late response, the AMUSE team has been travelling recently and I'm only now back in the right timezone and at a reasonable level of brain functionality.

Regarding your mystery $PATH components, maybe this blog post explains what's happening?

We're aware that there are issues with getting AMUSE installed, and I'm working on a whole new build system and Conda packages that will make everything substantially better, but it's not quite there yet.

The development install is more reliable than the pip-based one, so please use that for the time being. On a Mac with Apple Silicon, I would expect one of the libraries (Sapporo light) and some of the community codes to not build, because they require CUDA and that is not available on modern Macs. Then there are one or two community codes with known issues that we need to fix. Galaxia and PeTaR should work though, and 21 is a rather low number, so there's still something wrong.

Your config.mk looks pretty okay, but I'm wondering where your gcc and g++ are coming from. Did you install GCC using Homebrew, or are they the aliases for clang that come with XCode?

It looks like Homebrew's MPI adds that -Wl,-ld_classic line to the compiler flags, probably as a work-around for Apple releasing a new linker in a broken state a few XCode versions ago. Which version of XCode are you using?

Regardless of the current setup, it will probably help to install GCC using Homebrew and then to point the build system to it by setting alias gcc=gcc-12 g++=g++-12 (or whichever version you have). Then try a make clean (to avoid mixing output of different compilers) and pip install . to do a development build.

marlito-gonaldo-byte commented 2 months ago

Hello Lourens, no worries I understand. I solved the mystery path issue.

I believe gcc and g++ have been installed through Xcode and homebrew since I get this :

$ which g++
/usr/bin/g++

and

ls /opt/homebrew/bin | grep "g++"
aarch64-apple-darwin23-g++-12
aarch64-apple-darwin23-g++-13
g++-12
g++-13

I am using the last version of Xcode. I put alias gcc=gcc-12 g++=g++-12 in my zprofile, sourced it, and pip install amuse-galaxia, without results.

When I pip install -e . it work successfully however when I try to build :

make -j4 {amuse-galaxia}.code
/Users/maelgonin/Desktop/PBH/code/Amuse-env/bin/python setup.py -v build_code --inplace --clean=yes --code-name={amuse-galaxia}
/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools_scm/_integration/setuptools.py:90: UserWarning: version of amuse-devel already set
  warnings.warn(f"version of {dist_name} already set")
running build_code
building libraries and community codes
build, for logging, see 'build.log'
Environment variables
================================================================================
AMUSE_DIR   /Users/maelgonin/Desktop/PBH/code/amuse
BOOSTLIBS   
CC  gcc
CFLAGS  -g -O2 -fno-common
CUDART_LIBS -lnocudart
CUDA_LIBDIRS    -L/NOCUDACONFIGURED/lib -LNOCUDACONFIGURED/lib64
CUDA_LIBS   -lnocuda
CUDA_SDK    /NOCUDACONFIGURED
CUDA_TK /NOCUDACONFIGURED
CXX g++
CXXFLAGS    -g -O2 -fno-common
F90 gfortran
FC  gfortran
FFLAGS  -g -O2 -fno-common
FFTW_FLAGS  -I/opt/homebrew/Cellar/fftw/3.3.10_1/include
FFTW_LIBS   -L/opt/homebrew/Cellar/fftw/3.3.10_1/lib -lfftw3 -lfftw3_threads
FORTRAN gfortran
GSL_FLAGS   -I/opt/homebrew/Cellar/gsl/2.7.1/include
GSL_LIBS    -L/opt/homebrew/Cellar/gsl/2.7.1/lib -lgsl -lgslcblas -lm
JAR /usr/bin/jar
JAVA    /usr/bin/java
JAVAC   /usr/bin/javac
MPICC   mpicc
MPICXX  mpicxx
MPIF90  mpif90
MUSE_PACKAGE_DIR    /Users/maelgonin/Desktop/PBH/code/amuse
OPENMP_CFLAGS   
OPENMP_FCFLAGS  -fopenmp
PYTHON  /Users/maelgonin/Desktop/PBH/code/Amuse-env/bin/python
SAPPORO_LIBS    -L/Users/maelgonin/Desktop/PBH/code/amuse/lib/sapporo_light -lsapporo
0 out of 0 codes built, 0 out of 0 libraries built
(not all codes and libraries need to be built)
LourensVeen commented 2 months ago

Could you try make -j4 galaxia.code? The curly brackets are meant to indicate that it's a placeholder.

marlito-gonaldo-byte commented 2 months ago
make  galaxia.code
/Users/maelgonin/Desktop/PBH/code/Amuse-env/bin/python setup.py -v build_code --inplace --clean=yes --code-name=galaxia
/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools_scm/_integration/setuptools.py:90: UserWarning: version of amuse-devel already set
  warnings.warn(f"version of {dist_name} already set")
running build_code
cleaning src/amuse/community/galaxia
make -C src/amuse/community/galaxia clean
rm -f  *~ *.pyc *.mod *.o GalaxyModel_worker worker_code.f90
building libraries and community codes
build, for logging, see 'build.log'
[13:47:53] building galaxia
make -C src/amuse/community/galaxia all
amusifier --type=f90 interface.py  BarAndSpiralsInterface -o worker_code.f90
gfortran -c -g -O2 -fno-common -o interface.o interface.f90
mpif90 -g -O2 -fno-common -I/Users/maelgonin/Desktop/PBH/code/amuse/lib/forsockets worker_code.f90 interface.o -o GalaxyModel_worker  -L/Users/maelgonin/Desktop/PBH/code/amuse/lib/forsockets -lforsockets -llapack -lblas
ld: library not found for -ld_classic
collect2: error: ld returned 1 exit status
make[1]: *** [GalaxyModel_worker] Error 1
error in call, tail output:

amusifier --type=f90 interface.py  BarAndSpiralsInterface -o worker_code.f90
gfortran -c -g -O2 -fno-common -o interface.o interface.f90
mpif90 -g -O2 -fno-common -I/Users/maelgonin/Desktop/PBH/code/amuse/lib/forsockets worker_code.f90 interface.o -o GalaxyModel_worker  -L/Users/maelgonin/Desktop/PBH/code/amuse/lib/forsockets -lforsockets -llapack -lblas
ld: library not found for -ld_classic
collect2: error: ld returned 1 exit status
make[1]: *** [GalaxyModel_worker] Error 1

--------------------------------------------------------------------------------
[13:47:54] building galaxia, failed, see 'build.log' for error log
Environment variables
================================================================================
AMUSE_DIR   /Users/maelgonin/Desktop/PBH/code/amuse
BOOSTLIBS   
CC  gcc
CFLAGS  -g -O2 -fno-common
CUDART_LIBS -lnocudart
CUDA_LIBDIRS    -L/NOCUDACONFIGURED/lib -LNOCUDACONFIGURED/lib64
CUDA_LIBS   -lnocuda
CUDA_SDK    /NOCUDACONFIGURED
CUDA_TK /NOCUDACONFIGURED
CXX g++
CXXFLAGS    -g -O2 -fno-common
F90 gfortran
FC  gfortran
FFLAGS  -g -O2 -fno-common
FFTW_FLAGS  -I/opt/homebrew/Cellar/fftw/3.3.10_1/include
FFTW_LIBS   -L/opt/homebrew/Cellar/fftw/3.3.10_1/lib -lfftw3 -lfftw3_threads
FORTRAN gfortran
GSL_FLAGS   -I/opt/homebrew/Cellar/gsl/2.7.1/include
GSL_LIBS    -L/opt/homebrew/Cellar/gsl/2.7.1/lib -lgsl -lgslcblas -lm
JAR /usr/bin/jar
JAVA    /usr/bin/java
JAVAC   /usr/bin/javac
MPICC   mpicc
MPICXX  mpicxx
MPIF90  mpif90
MUSE_PACKAGE_DIR    /Users/maelgonin/Desktop/PBH/code/amuse
OPENMP_CFLAGS   
OPENMP_FCFLAGS  -fopenmp
PYTHON  /Users/maelgonin/Desktop/PBH/code/Amuse-env/bin/python
SAPPORO_LIBS    -L/Users/maelgonin/Desktop/PBH/code/amuse/lib/sapporo_light -lsapporo
Community codes not built (because of errors/ missing libraries):
================================================================================
 * galaxia
================================================================================
0 out of 1 codes built, 0 out of 0 libraries built
(not all codes and libraries need to be built)
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/setup.py", line 75, in <module>
    setup(
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/__init__.py", line 104, in setup
    return distutils.core.setup(**attrs)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
    return run_commands(dist)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
    dist.run_commands()
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
    super().run_command(command)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/Users/maelgonin/Desktop/PBH/code/amuse/support/setup_codes.py", line 1220, in run
    BuildCodes.run(self)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/support/setup_codes.py", line 1101, in run
    raise Exception("No succesful builds detected. Aborting.")
Exception: No succesful builds detected. Aborting.
make: *** [galaxia.code] Error 1

Again ld_classic seems to be the issue. I found this : https://forum.dlang.org/post/oerwqjpcuhbczfdcxwxh@forum.dlang.org but I am not sure of how I could apply it to amuse case

LourensVeen commented 2 months ago

Hmm. The error message suggests that the linker used doesn't support the -ld_classic option that the Homebrew MPI packages passes to it. But as far as I can tell, the only linker supported on MacOS is the XCode linker, which from XCode 15 should support that option, and which should be used by everything, including XCode clang and Homebrew GCC.

What does mpif90 -Wl,--version show? That should print the version of the linker used by the failing command, so maybe that will tell us a bit more.

marlito-gonaldo-byte commented 2 months ago
mpif90 -Wl,--version
collect2 version 13.2.0
/Users/maelgonin/anaconda3/bin/ld -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/ -dynamic -arch arm64 -platform_version macos 14.0.0 0.0 -o a.out -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/aarch64-apple-darwin23/13 -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc -L/opt/homebrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/aarch64-apple-darwin23/13/../../.. --version -lemutls_w -lgcc -lSystem -no_compact_unwind -rpath @loader_path -rpath /opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc/aarch64-apple-darwin23/13 -rpath /opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current/gcc -rpath /opt/homebrew/Cellar/gcc/13.2.0/lib/gcc/current
ld: unknown option: --version
collect2: error: ld returned 1 exit status

without a comma : mpif90 -Wl --version GNU Fortran (Homebrew GCC 13.2.0) 13.2.0 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

LourensVeen commented 2 months ago

Ah. It looks like you've got a linker installed through Conda, and you either have Conda set up to always activate the base environment, or you have manually activated a Conda environment.

So now we have Homebrew mpif90 call Homebrew gfortran which then ends up calling Conda ld and I don't know which ld that is but it doesn't support --version or --ld_classic, so it's probably not the standard MacOS one. Also, Conda does some funky rpath stuff with everything it links, so that's going to cause more problems.

Could you try a conda deactivate, check that echo $CONDA_PREFIX prints nothing, and then build again?

marlito-gonaldo-byte commented 2 months ago

It worked ! I still have this printed out but it says the code has been built `/Users/maelgonin/Desktop/PBH/code/Amuse-env/bin/python setup.py -v build_code --inplace --clean=yes --code-name=galaxia /Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools/init.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! dist.fetch_build_eggs(dist.setup_requires) /Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/setuptools_scm/_integration/setuptools.py:90: UserWarning: version of amuse-devel already set warnings.warn(f"version of {dist_name} already set")`

LourensVeen commented 2 months ago

Yes, the warning about PEP 517 is expected, it's actually the main reason I'm redoing the build system.

Python is making some big changes to how packages are built, which is a very good thing because it was a mess and now it will be much less of a mess. PEP 517 is the document describing how it's going to work, and that warning is there to remind everyone to hurry up and upgrade, because the old way will soon no longer be supported.

For most Python packages, the required changes are relatively simple, but for more complex ones it's more work. And between C, C++, Fortran, CUDA, OpenCL, OpenMP, MPI, and a bunch of native and Python-based dependencies, AMUSE is about as complex as it gets. Which is exactly why this should all just work out of the box, because as an end user, you really don't want to deal with this. We'll get there!

Does this mean you have everything you need? Do you have PeTar installed separately already, or do you also want to have that through AMUSE?

marlito-gonaldo-byte commented 2 months ago

I have PeTar installed separately, I started by installing PeTar and then realised I needed a way to generate initial conditions for the cluster. The code built and I am now able to run pip install amuse galaxia, but while I was trying to run evolution_cluster.py I got this :

python ../examples_galaxia/evolution_cluster.py
[Maels-MacBook-Pro.local:16648] shmem: mmap: an error occurred while determining whether or not /var/folders/69/q0sxjwg97jg1_jbm84qfy3vc0000gn/T//ompi.Maels-MacBook-Pro.501/jf.0/1622212608/sm_segment.Maels-MacBook-Pro.501.60b10000.0 could be created.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/core.py", line 120, in __call__
    dtype_to_result = self.interface.channel.recv_message(call_id, self.specification.id, handle_as_array)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/channel.py", line 1189, in recv_message
    raise exceptions.CodeException("Error in code: " + error_message)
amuse.support.exceptions.CodeException: Error in code: no error message - code probably died, sorry.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.9/3.9.19/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/python@3.9/3.9.19/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 267, in __call__
    return self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/core.py", line 123, in __call__
    raise exceptions.CodeException("Exception when calling function '{0}', of code '{1}', exception was '{2}'".format(self.specification.name, type(self.interface).__name__, ex))
amuse.support.exceptions.CodeException: Exception when calling function 'evolve_model', of code 'HuaynoInterface', exception was 'Error in code: no error message - code probably died, sorry.'
wrapped<wrapped<wrapped<wrapped<function: int get_state(int index_of_the_particle)
output: double mass, double x, double y, double z, double vx, double vy, double vz, double radius, int __result>>>>
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/core.py", line 118, in __call__
    self.interface.channel.send_message(call_id, self.specification.id, dtype_to_arguments = dtype_to_values)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/channel.py", line 1134, in send_message
    raise exceptions.CodeException("You've tried to send a message to a code that is not running")
amuse.support.exceptions.CodeException: You've tried to send a message to a code that is not running

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/examples/test/../examples_galaxia/evolution_cluster.py", line 320, in <module>
    t, x, y = evolution.evolution_of_the_cluster(star_cluster)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/examples/test/../examples_galaxia/evolution_cluster.py", line 264, in evolution_of_the_cluster
    system.evolve_model(self.time)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/ext/bridge.py", line 159, in evolve_model
    return self.evolve_simple_steps(tend,timestep)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/ext/bridge.py", line 165, in evolve_simple_steps
    self.method(self.kick_systems,self.drift_systems_dt, timestep)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/ext/composition_methods.py", line 25, in LEAPFROG
    EVOLVEA(dt/2)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/ext/rotating_bridge.py", line 108, in kick_systems
    self.kick_system_rotational(x, self.partners[x], dt)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/ext/rotating_bridge.py", line 64, in kick_system_rotational
    parts=system.particles.copy()
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/datamodel/particles.py", line 375, in copy
    values = self.get_values_in_store(indices, attributes)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/datamodel/particles.py", line 1353, in get_values_in_store
    return self._private.attribute_storage.get_values_in_store(indices, attributes)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/datamodel/incode_storage.py", line 915, in get_values_in_store
    result = getter.get_attribute_values(self, attributes, indices_in_the_code)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/datamodel/incode_storage.py", line 209, in get_attribute_values
    return_value = self.method(*indices, **storage.extra_keyword_arguments_for_getters_and_setters)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/support/methods.py", line 267, in __call__
    return self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/amuse/rfi/core.py", line 123, in __call__
    raise exceptions.CodeException("Exception when calling function '{0}', of code '{1}', exception was '{2}'".format(self.specification.name, type(self.interface).__name__, ex))
amuse.support.exceptions.CodeException: Exception when calling function 'get_state', of code 'HuaynoInterface', exception was 'You've tried to send a message to a code that is not running' 
LourensVeen commented 2 months ago

Oh, I think we may have a mix of a development install and a PyPI install now. They're not the same (another issue that I'm fixing).

Could you do a pip list and see which amuse packages you have installed? Then pip uninstall them all, and do pip install -e . again in the source directory where you built galaxia. You should not do a pip install amuse-galaxia, as that will try to install Galaxia again from PyPI, and because the package definition is different that messes everything up.

marlito-gonaldo-byte commented 2 months ago

I did that, it seems likepip install -e . only install amuse-devel, is it okay ?

LourensVeen commented 2 months ago

Yes, that's all you need. amuse-devel is a kind of reference to the source tree, so it contains all the packages built there automatically. It's messy though, because it doesn't match the PyPI setup of separate packages and so you can install both and then they interfere and it's a mess.

marlito-gonaldo-byte commented 2 months ago

Okay make sense, I know get this error :

$ python ../examples_galaxia/evolution_cluster.py
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/examples/test/../examples_galaxia/evolution_cluster.py", line 14, in <module>
    from amuse.units import units, constants, quantities, nbody_system
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/units/units.py", line 6, in <module>
    from . import constants
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/units/constants.py", line 8, in <module>
    from amuse.units.si import m, kg, s, A, K, mol, none
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/units/si.py", line 1, in <module>
    from amuse.units import core
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/units/core.py", line 1, in <module>
    from amuse.support.core import late
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/__init__.py", line 13, in <module>
    GlobalOptions=GlobalOptions.instance()
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/options.py", line 114, in instance
    cls.INSTANCE.load(preloadfp)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/options.py", line 25, in load
    if pkg_resources.resource_exists("amuse", "amuserc"):
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1173, in resource_exists
    return get_provider(package_or_requirement).has_resource(resource_name)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 391, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "/Users/maelgonin/Desktop/PBH/code/Amuse-env/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1460, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "/opt/homebrew/Cellar/python@3.9/3.9.19/Frameworks/Python.framework/Versions/3.9/lib/python3.9/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
LourensVeen commented 2 months ago

It seems that this could be caused by some leftover bits of the earlier packages still hanging around in the environment. Do you have anything else important in the Amuse-env? If not, could you deactivate it, remove it completely, recreate it, reactivate it, and then pip install -e . again?

marlito-gonaldo-byte commented 2 months ago

did that and here is the output :

$ python3 ../examples_galaxia/evolution_cluster.py
/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py:964: UserWarning: MPI (unexpectedly?) not available, falling back to sockets channel
  warnings.warn("MPI (unexpectedly?) not available, falling back to sockets channel")
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 120, in __call__
    dtype_to_result = self.interface.channel.recv_message(call_id, self.specification.id, handle_as_array)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 2081, in recv_message
    message.receive(self.socket)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 1513, in receive
    header_bytes = self._receive_all(44, socket)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 1498, in _receive_all
    raise exceptions.CodeException("lost connection to code")
amuse.support.exceptions.CodeException: lost connection to code

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.9/3.9.19/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/python@3.9/3.9.19/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 267, in __call__
    return self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 123, in __call__
    raise exceptions.CodeException("Exception when calling function '{0}', of code '{1}', exception was '{2}'".format(self.specification.name, type(self.interface).__name__, ex))
amuse.support.exceptions.CodeException: Exception when calling function 'evolve_model', of code 'HuaynoInterface', exception was 'lost connection to code'
wrapped<wrapped<wrapped<wrapped<function: int get_state(int index_of_the_particle)
output: double mass, double x, double y, double z, double vx, double vy, double vz, double radius, int __result>>>>
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 120, in __call__
    dtype_to_result = self.interface.channel.recv_message(call_id, self.specification.id, handle_as_array)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 2081, in recv_message
    message.receive(self.socket)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 1513, in receive
    header_bytes = self._receive_all(44, socket)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/channel.py", line 1498, in _receive_all
    raise exceptions.CodeException("lost connection to code")
amuse.support.exceptions.CodeException: lost connection to code

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/examples/test/../examples_galaxia/evolution_cluster.py", line 320, in <module>
    t, x, y = evolution.evolution_of_the_cluster(star_cluster)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/examples/test/../examples_galaxia/evolution_cluster.py", line 264, in evolution_of_the_cluster
    system.evolve_model(self.time)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/ext/bridge.py", line 159, in evolve_model
    return self.evolve_simple_steps(tend,timestep)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/ext/bridge.py", line 165, in evolve_simple_steps
    self.method(self.kick_systems,self.drift_systems_dt, timestep)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/ext/composition_methods.py", line 25, in LEAPFROG
    EVOLVEA(dt/2)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/ext/rotating_bridge.py", line 108, in kick_systems
    self.kick_system_rotational(x, self.partners[x], dt)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/ext/rotating_bridge.py", line 64, in kick_system_rotational
    parts=system.particles.copy()
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/datamodel/particles.py", line 375, in copy
    values = self.get_values_in_store(indices, attributes)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/datamodel/particles.py", line 1353, in get_values_in_store
    return self._private.attribute_storage.get_values_in_store(indices, attributes)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/datamodel/incode_storage.py", line 915, in get_values_in_store
    result = getter.get_attribute_values(self, attributes, indices_in_the_code)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/datamodel/incode_storage.py", line 209, in get_attribute_values
    return_value = self.method(*indices, **storage.extra_keyword_arguments_for_getters_and_setters)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 168, in __call__
    result = self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/support/methods.py", line 267, in __call__
    return self.method(*list_arguments, **keyword_arguments)
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 123, in __call__
    raise exceptions.CodeException("Exception when calling function '{0}', of code '{1}', exception was '{2}'".format(self.specification.name, type(self.interface).__name__, ex))
amuse.support.exceptions.CodeException: Exception when calling function 'get_state', of code 'HuaynoInterface', exception was 'lost connection to code'
Exception ignored in: <function CodeInterface.__del__ at 0x1117cc040>
Traceback (most recent call last):
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 751, in __del__
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 847, in _stop
  File "/Users/maelgonin/Desktop/PBH/code/amuse/src/amuse/rfi/core.py", line 123, in __call__
amuse.support.exceptions.CodeException: Exception when calling function '_stop_worker', of code 'HuaynoInterface', exception was '[Errno 32] Broken pipe'
LourensVeen commented 2 months ago

Wow, I think we really deserve a break by now, but apparently not. At least it seems like the Python side is working, but the huayno worker is crashing, probably on startup.

Unfortunately AMUSE doesn't give any output produced by the crashed process here, so it's hard to see what's going on. It could be that there are leftover issues from the earlier linker problem though, so my first try would be to do a make distclean in the root and then python setup.py develop_build to build everything from scratch, then try again.

marlito-gonaldo-byte commented 2 months ago

Okay I just did that and I was only able to build 5 code out of 56... I will start everything over and get back at you once it is done

marlito-gonaldo-byte commented 2 months ago

I tried to start it allover, from the git clone step and I get the same error message... so I did make distclean then pip install -e . and python setup.py develop_build, I got this time 38 out of 55 code built but again the same error when I try to run an example.

LourensVeen commented 2 months ago

Could you check that there is a src/amuse/community/huayno/huayno_worker file? And if not, post the build.log file?

marlito-gonaldo-byte commented 2 months ago

there is a src/amuse/community/huayno/huayno_worker

LourensVeen commented 2 months ago

Hmm. So I think we probably have a mostly working AMUSE installation now, but huayno is crashing for some reason.

Actually, if you only need galaxia, maybe this works well enough? The example requires huayno, but if you don't...

(And yes, it should just work, and it should be giving a more useful error message. Ugh.)

marlito-gonaldo-byte commented 2 months ago

Actually I just need to be able to generate a star cluster so it is not an issue

marlito-gonaldo-byte commented 2 months ago

I am now trying to install PeTar through Amuse, but I have problems doing it... should I create a new issue or keep going here ?

LourensVeen commented 2 months ago

Oh joy. Could you please close this and make a new one? That makes it a bit easier to find things later, if someone else ends up having the same problem.