amusecode / amuse

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

Issue with installation on Kubuntu 20.04 #715

Closed Kraysent closed 2 years ago

Kraysent commented 3 years ago

I'm trying to install AMUSE via source code on Kubuntu 20.04 (python 3.8). During installation I get these errors:

...
running build_py
copying build/lib/amuse/amuserc -> /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse
byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/validation/particles_and_gas_in_cluster.py to particles_and_gas_in_cluster.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/validation/particles_and_gas_in_cluster.py", line 212
    print self.converter.to_nbody(self.code.time)
          ^
SyntaxError: invalid syntax

byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/validation/particles_and_multiples.py to particles_and_multiples.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/validation/particles_and_multiples.py", line 81
    print "Time          :", time
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Time          :", time)?

byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_stellar_merger.py to test_stellar_merger.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_stellar_merger.py", line 207
    print "Evolving to:", t_end
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Evolving to:", t_end)?

byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_HRdiagram_tracks.py to test_HRdiagram_tracks.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_HRdiagram_tracks.py", line 95
    print " ... evolved model to t = " + \
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(" ... evolved model to t = " + \)?

byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_smallcluster_async.py to test_smallcluster_async.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_smallcluster_async.py", line 166
    gravity_evolve = gravity.evolve_model.async(time)
                                          ^
SyntaxError: invalid syntax

byte-compiling /home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_smallcluster.py to test_smallcluster.cpython-38.pyc
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/examples/applications/test_smallcluster.py", line 136
    print "evolving the model until t = " + str(end_time)
          ^
SyntaxError: invalid syntax

running install_scripts
running egg_info
...

I don't really get why these errors occur because I do everything precisely according to this guide, which is supposed to deal with python 3.6 (not 2.*). Few lines below I get this thing:

reading manifest file 'src/amuse.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.txt'
warning: no files found matching '*.*' under directory 'doc/html'
warning: no files found matching '*.pdf' under directory 'doc/pdf'
warning: no files found matching '*.*' under directory 'doc/plot_directive'
warning: no previously-included files matching '*.*' found under directory 'doc/build'
warning: no previously-included files matching '*.pyc' found under directory 'src'
warning: no previously-included files matching '*.o' found under directory 'src'
warning: no previously-included files matching '*~' found under directory 'src'
warning: no previously-included files matching '.pc' found under directory 'src'
warning: no previously-included files matching 'ccache' found under directory 'src'
warning: no previously-included files matching '*.a' found under directory 'src'
warning: no previously-included files matching '*.pyc' found under directory 'lib'
warning: no previously-included files matching '*.o' found under directory 'lib'
warning: no previously-included files matching '*~' found under directory 'lib'
warning: no previously-included files matching 'ccache' found under directory 'lib'
warning: no previously-included files matching '*.a' found under directory 'lib'
no previously-included directories found matching 'lib/ibis'
no previously-included directories found matching 'src/amuse/community/mesa/src'
no previously-included directories found matching 'src/amuse/community/mpiamrvac/src'
no previously-included directories found matching 'src/amuse/community/mpiamrvac/.pc'
no previously-included directories found matching 'src/amuse/community/mocassin/src'
no previously-included directories found matching 'src/amuse/community/mocassin/.pc'
no previously-included directories found matching 'src/amuse/community/athena/.pc'
no previously-included directories found matching 'src/amuse/community/pynbody/PyNbody'
warning: no previously-included files matching '*' found under directory 'data/gadget2/output'
warning: no previously-included files matching '*' found under directory 'data/simplex/output'
warning: no previously-included files matching '*' found under directory 'data/mpiamrvac/output'
warning: no previously-included files matching '*' found under directory 'data/mmams/output'
warning: no previously-included files matching '*' found under directory 'data/fi/output'
warning: no previously-included files matching '*' found under directory 'data/evtwin/output'
warning: no previously-included files matching '*' found under directory 'data/mesa/output'
warning: no files found matching 'empty_dir.txt' under directory 'data/mpiamrvac/output'
no previously-included directories found matching 'data/mesa/input/star_data'
writing manifest file 'src/amuse.egg-info/SOURCES.txt'
running build_scripts

And finally:

Community codes not built (because of errors):
================================================================================
 * distributed
 * galaxia
Optional builds failed, need special libraries:
 * asterisk - java
 * fastkick - gpu
 * fi - gl, periodic_gl
 * hacs64 - gpu
 * higpus - gpu
 * huayno - cl, cl, cl, cl, cl, mp.so, mp.so, mp.so
 * mi6 - gpu
 * ph4 - gpu
 * phigrape - gl, grape, gl_gpu, gpu
Optional builds failed, need CUDA/GPU libraries:
 * sapporo_light
 * bonsai
 * bonsai2
 * etics
 * octgrav
 * pikachu
Optional builds failed, need separate download
 * flash , make flash.code DOWNLOAD_CODES=1
 * krome , make krome.code DOWNLOAD_CODES=1
 * mocassin , make mocassin.code DOWNLOAD_CODES=1
 * mpiamrvac , make mpiamrvac.code DOWNLOAD_CODES=1
 * rebound , make rebound.code DOWNLOAD_CODES=1
 * tupan , make tupan.code DOWNLOAD_CODES=1
================================================================================
...
================================================================================
45 out of 47 codes built, 5 out of 6 libraries built

But when I try to run some example codes, e.g. this one, I get error from MPI:

No module named 'tupan'
evolving with huayno
3.5 Myr -> [-25.63767, -53.2656, -2.71921] parsec
--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 1
slots that were requested by the application:

  /home/kraysent/Science/n-body2/Amuse-env/bin/python

Either request fewer slots for your application, or make more slots
available for use.

A "slot" is the Open MPI term for an allocatable unit where we can
launch a process.  The number of slots available are defined by the
environment in which Open MPI processes are run:

  1. Hostfile, via "slots=N" clauses (N defaults to number of
     processor cores if not provided)
  2. The --host command line parameter, via a ":N" suffix on the
     hostname (N defaults to 1 if not provided)
  3. Resource manager (e.g., SLURM, PBS/Torque, LSF, etc.)
  4. If none of a hostfile, the --host command line parameter, or an
     RM is present, Open MPI defaults to the number of processor cores

In all the above cases, if you want Open MPI to default to the number
of hardware threads instead of the number of processor cores, use the
--use-hwthread-cpus option.

Alternatively, you can use the --oversubscribe option to ignore the
number of available slots when deciding the number of processes to
launch.
--------------------------------------------------------------------------
Traceback (most recent call last):
  File "evolve_orbit_in_potential.py", line 230, in <module>
    evolve_orbit_and_plot(codes, filename, parameters)
  File "evolve_orbit_in_potential.py", line 190, in evolve_orbit_and_plot
    full_orbit = evolve_bridged_orbit_in_potential(
  File "evolve_orbit_in_potential.py", line 165, in evolve_bridged_orbit_in_potential
    bridge, gravity, gravity_to_orbit = setup_bridge(
  File "evolve_orbit_in_potential.py", line 132, in setup_bridge
    gravity = codelist[code](converter)
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/community/huayno/interface.py", line 217, in __init__
    legacy_interface = self.__interface__(**options)
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/community/huayno/interface.py", line 34, in __init__
    CodeInterface.__init__(self, name_of_the_worker = self.name_of_worker(mode), **options)
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/rfi/core.py", line 752, in __init__
    self._start(name_of_the_worker = name_of_the_worker, **options)
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/rfi/core.py", line 780, in _start
    self.channel.start()
  File "/home/kraysent/Science/n-body2/Amuse-env/lib/python3.8/site-packages/amuse/rfi/channel.py", line 1067, in start
    self.intercomm = MPI.COMM_SELF.Spawn(command, arguments, self.number_of_workers, info=self.info)
  File "mpi4py/MPI/Comm.pyx", line 1534, in mpi4py.MPI.Intracomm.Spawn
mpi4py.MPI.Exception: MPI_ERR_SPAWN: could not spawn processes

I am aware that strange MPI errors can occur when both mpich and openmpi are installed but there is only openmpi on my system. What can I do to fix this thing?

Kraysent commented 3 years ago

By the way, when I run python setup.py test I get this:

running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.                                                                                                                                                                                       
running egg_info
writing src/amuse.egg-info/PKG-INFO
writing dependency_links to src/amuse.egg-info/dependency_links.txt
writing requirements to src/amuse.egg-info/requires.txt
writing top-level names to src/amuse.egg-info/top_level.txt
reading manifest file 'src/amuse.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.txt'
warning: no files found matching '*.*' under directory 'doc/html'
warning: no files found matching '*.pdf' under directory 'doc/pdf'
warning: no files found matching '*.*' under directory 'doc/plot_directive'
warning: no previously-included files matching '*.*' found under directory 'doc/build'
warning: no previously-included files matching '*.pyc' found under directory 'src'
warning: no previously-included files matching '*.o' found under directory 'src'
warning: no previously-included files matching '*~' found under directory 'src'
warning: no previously-included files matching '.pc' found under directory 'src'
warning: no previously-included files matching 'ccache' found under directory 'src'
warning: no previously-included files matching '*.a' found under directory 'src'
warning: no previously-included files matching '*.pyc' found under directory 'lib'
warning: no previously-included files matching '*.o' found under directory 'lib'
warning: no previously-included files matching '*~' found under directory 'lib'
warning: no previously-included files matching 'ccache' found under directory 'lib'
warning: no previously-included files matching '*.a' found under directory 'lib'
no previously-included directories found matching 'lib/ibis'
no previously-included directories found matching 'src/amuse/community/mesa/src'
no previously-included directories found matching 'src/amuse/community/mpiamrvac/src'
no previously-included directories found matching 'src/amuse/community/mpiamrvac/.pc'
no previously-included directories found matching 'src/amuse/community/mocassin/src'
no previously-included directories found matching 'src/amuse/community/mocassin/.pc'
no previously-included directories found matching 'src/amuse/community/athena/.pc'
no previously-included directories found matching 'src/amuse/community/pynbody/PyNbody'
warning: no previously-included files matching '*' found under directory 'data/gadget2/output'
warning: no previously-included files matching '*' found under directory 'data/simplex/output'
warning: no previously-included files matching '*' found under directory 'data/mpiamrvac/output'
warning: no previously-included files matching '*' found under directory 'data/mmams/output'
warning: no previously-included files matching '*' found under directory 'data/fi/output'
warning: no previously-included files matching '*' found under directory 'data/evtwin/output'
warning: no previously-included files matching '*' found under directory 'data/mesa/output'
warning: no files found matching 'empty_dir.txt' under directory 'data/mpiamrvac/output'
no previously-included directories found matching 'data/mesa/input/star_data'
writing manifest file 'src/amuse.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

which, I guess, is wrong.

rieder commented 3 years ago

What can I do to fix this thing?

You could increase the number of available MPI slots, or run with mpirun --oversubscribe python (scriptname) (scriptoptions)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.