Giter Club home page Giter Club logo

Comments (25)

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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)

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024
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/[email protected] but I am not sure of how I could apply it to amuse case

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024
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.

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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?

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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")`

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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?

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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/[email protected]/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/[email protected]/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' 

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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/[email protected]/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

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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?

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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/[email protected]/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/[email protected]/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'

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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.

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.)

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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

from amuse.

marlito-gonaldo-byte avatar marlito-gonaldo-byte commented on August 17, 2024

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 ?

from amuse.

LourensVeen avatar LourensVeen commented on August 17, 2024

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.

from amuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.