Closed marlito-gonaldo-byte closed 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.
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)
Could you try make -j4 galaxia.code
? The curly brackets are meant to indicate that it's a placeholder.
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
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.
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.
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?
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")`
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?
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'
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.
I did that, it seems likepip install -e .
only install amuse-devel, is it okay ?
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.
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
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?
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'
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.
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
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.
Could you check that there is a src/amuse/community/huayno/huayno_worker
file? And if not, post the build.log
file?
there is a src/amuse/community/huayno/huayno_worker
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.)
Actually I just need to be able to generate a star cluster so it is not an issue
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 ?
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.
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 :
and my .zshrc :
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
: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 ofpip install --no-cache-dir --force-reinstall amuse-galaxia
but I can't figure out where is my mistake...