Giter Site home page Giter Site logo

agama's People

Contributors

eugvas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agama's Issues

Discrepancy with Galpy when using agama.GalpyPotential

Hi!

Not sure if this issue has been already reported, it might just be my problem jeje

The thing is that I was checking things and tried to create and NFW profile using the PyGaia potential. The result is that when I tried to use the agama.GalpyPotential interface, the resulting AGAMA potential differs from what it should be.

If I then create a native AGAMA NFW with the same parameters I get the right answer. So my first instinct is to suspect that the agama.GalpyPotential interface is not converting the Galpy potential correctly. (see attached image)
Screenshot 2022-09-21 at 17 28 51

I just installed Galpy before doing this, so it is in its most recent version, 1.8.0. For AGAMA, I am using the setup we put together in the other issue: python 3.8 with the AGAMA version I have in my fork.

It is probably nothing but I just thought I should report it.

Cheers,

Installing on Mac with Python 3.7

Hey Eugene --

I'm trying to install Agama on a new machine running Mac 10.14.6 with an Anaconda installed Python 3.7.

I would rather not install a new C compiler and have to re-install Python and many other things, so I'm trying to roll with Clang and no OpenMP. I have gsl installed, but also into the Anaconda path. I created and edited a Makefile.local to add:

COMPILE_FLAGS += -I/Users/apricewhelan/anaconda/include/
LINK_FLAGS    += -L/Users/apricewhelan/anaconda/lib/ -lgsl -lgslcblas

and removed -fopenmp. I have gfortran installed, but also ran into issues compiling the Fortran code, so I commented out the Fortran compile lines in Makefile - they look like they only run a test file, so it didn't seem crucial, but maybe this is a problem?

In any case, running make does succeed, and it produces the agama.so shared library. However, when I try to import with Python, I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_agama)

Any ideas?

Use of new models

Hi!

I noticed that you published about the new distribution functions exponential model some time ago(James Binney and Eugene Vasiliev 2022), but when I quoted it,it return "Error in creating distribution function: Unknown type of distribution function". I have tried to reinstall Agama, but there are still error. So, how should I use the new model?

Thank you very much!

Logarithmic potential does support ActionFinder

Hi Eugene,

Hope you are doing well!

I'm exploring the functionalities of actions in Agama. Runing the following code,

import agama
pot = agama.Potential(type='Logarithmic', scaleRadius=1, v0=1)
af = agama.ActionFinder(pot, interp=False)

I got such error,

ValueError: Error in ActionFinder initialization: Interpolator: can only work with potentials that tend to zero as r->infinity

I guess I can understand the interpolation won't work for infinitely deep potential like Logarithmic, since it is hard to define an appropriate interpolation table. However, I'm a bit surprised, because, naively, I thought we only need interpolation when interp=True is specified. Is this behavior expected? Thanks.

Best regards,

Zhaozhou

Example python scripts do not work on newer python versions

When I was going through the example python scripts in the py folder, I noticed that some scripts do not work on newer python versions specifically python 3.10.

For example the script example_actions_nbody.py fails because it tries to use time.clock(). The function time.clock() has been deprecated since python 3.3 and was removed in python 3.8. The alternative function is time.perf_counter() released in python 3.3.

In order to support the newer versions of python, the scripts need to be changed to avoid using deprecated/removed functions.

Should the scripts be updated to only use the newer functions or should the use of the older functions be supported still via something like try: tbegin = time.clock() except AttributeError: tbegin = time.perf_counter()?

It might be nice to use updated f-strings for string formatting as well instead of the old % string formatting.

galpypot.py

Hi everyone,

I'm trying to run galpypot.py, unfortunately, I faced the following problem in lines 156 - 165, where I have to create an array of initial conditions

ic is the array of initial conditions: R, z, phi, vR, vz, vphi
def compare(ic, inttime, numsteps): times = _numpy.linspace(0, inttime, numsteps)

integrate the orbit in galpy using MWPotential2014 from galpy
g_orb_obj = galpy.orbit.Orbit([ic[0],ic[3],ic[5],ic[1],ic[4],ic[2]]) dt = time.time() g_orb_obj.integrate(times, g_pot) g_orb = g_orb_obj.getOrbit() print('Time to integrate orbit in galpy: %.4g s' % (time.time()-dt))

Now, I have two questions:
1- How to create this array?
2- I had created an arbitrary array ic=[11.1, 12.24, 7.25, 11.1, 12.24, 7.25], then I got the following problem
`---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
1 g_orb_obj = galpy.orbit.Orbit([mar[0],mar[3],mar[5],mar[1],mar[4],mar[2]])
2 dt = time.time()
----> 3 g_orb_obj.integrate(times, g_pot)
4 g_orb = g_orb_obj.getOrbit()
5 print('Time to integrate orbit in galpy: %.4g s' % (time.time()-dt))

NameError: name 'times' is not defined
`

Kindly advise me.

Installing Agama Windows 10 / Python 3.9.0

Hello there,
I'm trying to install Agama on my Windows 10 as follows:

python setup.py install --user

The following error occurs:

...
copying .\Doxyfile -> build\lib.win-amd64-3.9\agama
copying .\INSTALL -> build\lib.win-amd64-3.9\agama
copying .\LICENSE -> build\lib.win-amd64-3.9\agama
copying .\README -> build\lib.win-amd64-3.9\agama
running build_ext

    ==== Checking supported compiler options and available libraries ====

g++ -Wall test.cpp -o /dev/null
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file /dev/null.exe: No such file or directory
collect2.exe: error: ld returned 1 exit status
error: Could not locate a compiler (set CXX=... environment variable to override)

It seems this error is general for windows 10 devices, as I also tried in my colleague's laptop and the same issue occurs.

Could someone please assist?
Thank you!

Generating randomized N-body initial conditions with Agama

Hi,
I was using the python interface to agama to take the output from phaseflow to generate N-body initial conditions. I was wondering if there was a way to set a random seed to generate randomized initial conditions. So far I have used np.random.seed() and random.seed() but they seem to have no effect.

Thank you.

Installing Agama

Hi everyone,
I'm trying to install Agama by its default mode, so I ran
python setup.py install --user

Then I got the following error:

Received: dyld: Library not loaded: @rpath/libpython3.6m.dylib
Referenced from: /Users/mardini/phd_research/Agama-master/pytest42.so
Reason: image not found
From py: Fatal Python error: PyThreadState_Get: no current thread

I would appreciate if you help me with this issue?

central density of King profile

I found a strange behavior with King profile in agama:

import agama
den = agama.Density(type='King', W0=10)
den.density([0., 0, 0]), den.density([1e-100, 0, 0])
# output
# (inf, 0.007955322088520804)

I am sorry if it has already been resolved in recent updates. My agama version is '1.0 compiled on Jan 12 2022'.
Anyway, I would be fine with den.density([1e-100, 0, 0]) as a proxy for now :)

BTW, I wanted the density in the center because I am calculating the amplitude of the distribution function (Gieles & Zocchi 2015, eq. 1 and 30).

Inner cutoff radius for spherical models

Hello,
I was trying to construct isotropic spherical N-body models using mkspherical. For the purposes of my simulations, I need spherical models where there are no particles present inside some inner cutoff radius. Is this possible to do with Agama? If so, how?

Thank you.

document of Einasto profile

Hi Eugene,
I am using the Einasto profile and want to make sure I understand the document correctly. The "eta" mentioned here
image
is the same "eta" in the following?
image
Or is it a typo of "xi=1/n"?

Thanks!

Cannot install Agama on my Apple Silicon Monterey

I am not sure if this has been asked before (could not find it) but I am having problems installing Agama on the new Apple M1 chips. I will try to solve it myself but thought better to report it here so that anyone can find it.

First of all, I created a conda environment with python 3.9. Then, I run python setup.py install --user --yes on the terminal and it failed. Here is the relevant part of the log:

==== Checking supported compiler options and available libraries ====
c++ -fPIC -Wall -O2 test.cpp -o test.out
c++ -fPIC -Wall -O2 test.cpp -o test.out -fopenmp -Werror -Wno-unknown-pragmas
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
c++ -fPIC -Wall -O2 test.cpp -o test.out -lgomp -Xpreprocessor -fopenmp -Werror -Wno-unknown-pragmas
test.cpp:1:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
c++ -fPIC -Wall -O2 test.cpp -o test.out -lomp -Xpreprocessor -fopenmp -Werror -Wno-unknown-pragmas
test.cpp:1:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
1 error generated.
Warning, OpenMP is not supported
If you're compiling on MacOS with clang, you'd better install another compiler such as GCC
Do you want to continue without OpenMP? [Y/N] y
c++ -fPIC -Wall -O2 test.cpp -o test.out -std=c++11
c++ -fPIC -Wall -O2 -std=c++11 test.cpp -o test.out -march=native
clang: error: the clang compiler does not support '-march=native'
c++ -fPIC -Wall -O2 -std=c++11 test.cpp -o test.out -march=core2
clang: error: the clang compiler does not support '-march=core2'
c++ -fPIC -Wall -O2 -std=c++11 test.cpp -o test.out -qno-opt-dynamic-align
clang: error: unknown argument: '-qno-opt-dynamic-align'
c++ -fPIC -Wall -O2 -std=c++11 test.cpp -o test.out -Werror -Wno-missing-field-initializers
c++ -fPIC -Wall -O2 -std=c++11 -Wno-missing-field-initializers test.cpp -o test.out -Werror -Wno-cast-function-type
**** Trying the options provided by python3.9-config --ldflags ****
**** Trying the following options for linking against Python library ****
c++ -fPIC -Wall -O2 -std=c++11 -Wno-missing-field-initializers -Wno-cast-function-type test.cpp -o ./agamatest.so -I"/Users/pauramos/miniconda3/envs/python3_agama/include/python3.9" -I"/Users/pauramos/miniconda3/envs/python3_agama/lib/python3.9/site-packages/numpy/core/include" -shared -fPIC -L/Users/pauramos/miniconda3/envs/python3_agama/lib/python3.9/config-3.9-darwin -ldl -framework CoreFoundation
Undefined symbols for architecture arm64:
"_PyCapsule_GetPointer", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyCapsule_Type", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyErr_Format", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyErr_Print", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyErr_SetString", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyExc_AttributeError", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyExc_ImportError", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyExc_RuntimeError", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyImport_ImportModule", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyModule_Create2", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyObject_GetAttrString", referenced from:
_PyInit_agamatest in test-90ec7c.o
"_PyRun_SimpleStringFlags", referenced from:
bla() in test-90ec7c.o
run() in test-90ec7c.o
_PyInit_agamatest in test-90ec7c.o
"_Py_Finalize", referenced from:
run() in test-90ec7c.o
"_Py_Initialize", referenced from:
run() in test-90ec7c.o
"__Py_Dealloc", referenced from:
_PyInit_agamatest in test-90ec7c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Could not compile test program which uses libpython3.9

I do think the problem is that Xcode does not support OpenMP now. Then, reading the error I realised that the code can be compiled with GCC, but since I set '--yes' I did not get to change the compiler. I will try again without this before trying to install a second Clang compiler with brew.

Error during installation: relocation R_X86_64_32 against

I installed python 2.7.18 in my local directory /software/jwu549/myPy2/ on a HPC cluster using the source code downloaded from python.org. (I did not use the default python on the cluster because the corresponding python-dev was not installed. )To install agama, I used the following command:
/software/jwu549/myPy2/bin/python -m pip install agama

I got many messages like this:
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

Below is a screenshot of the message output
image

The same error occurred when trying to install agama from the source code using setup.py.

explicitly including G in the calculation of Toomre Q in the example?

In the example code example_self_consistent_model3.py, the author calculates the Toomre Q values with:
ToomreQ = sigma[:,0]**0.5 * kappa / 3.36 / Sigma
This formula works fine with the default Agama unit system, in which G=1.
However, if one revises this code for their models and changes the unit system, the code will then give wrong Toomre Q values.
I would suggest explicitly including G in the formula and updating it to be
ToomreQ = sigma[:,0]**0.5 * kappa / 3.36 / Sigma / agama.G
It is a tiny issue but solving it may provide some tiny benefits.

Thanks!

Error in installation using pip

If I make AGAMA a package dependency in my requirements file it cannot be installed on a CI or ReadTheDocs because the new PIP version resolver checks Agama's metadata and doesn't like the difference between 1.0b and 1.0.

Collecting agama
  Downloading agama-1.0b.tar.gz (2.1 kB)
  WARNING: Requested agama from https://files.pythonhosted.org/packages/20/e5/a378745ddd3d06acdabf07dd05ead1df2a3bb972aadfe5f06f54c2edabce/agama-1.0b.tar.gz#sha256=01817ab0939dbe85f4e28a810841976e29f96805110c48aa02524ddc5422b4c4 (from test-package==0.1.dev31+ga4c0ef1), but installing version 1.0

Generating rotating star clusters

Hello,
I was wondering if there was any way to generate rotating (uniform mass) king profile models in Agama? I read through the Agama handbook but was still a bit confused. I assume you would have to add an angular momentum component in the z-direction to the distribution function and sample from that but I am not sure how to do that in Agama.

Thank you for your help!

Number of sampling points of an orbit not equal to the requested value.

Code

Tested using Python 3.6.5, Agama 1.0 and Numpy 1.19.5.

Issue

I want to integrate the orbit of an object (taken from an N-body simulation) and sample its position along the orbit N times. However, I find that depending on the specified integration time range, you might obtain N-1 sampling points.

I suspect this is related to rounding, since whether I get the expected behaviour or not is dependent on whether I use times as directly measured from the simulation, copying the values printed in the console when I call print(simulation_times) or if I set the starting integration time equal to 0. A screenshot showing this behaviour is shown below for the example of N = 2.
image

Example code

I have attached the script used to generate the outputs shown above, as well as the potential, object ICs and time range values.
example.tar.gz

artificial density oscillations in the outskirt of Spheroid potential

Hi Eugene,

I noticed that the density profile of agama spheroid potential sometimes shows oscillations in the outskirt, see e.g., the blue curve below. It is generated by the following code.

pot1 = agama.Potential(
    type='Spheroid',
    densityNorm=1, scaleRadius=1,
    alpha=1, beta=3, gamma=1,
    outerCutoffRadius=4, cutoffStrength=2,
)

In the beginning, I was surprised, because I thought the density profile is analytical. Later, I realized it is because of the limited grid number of multipole decomposition (right?).

For potential directly generated by specifying a density function with type=Multipole, we may use keywords rmin, rmax, gridSizeR etc to specify the desired precision (see the orange curve with gridSizeR=2000).
But these keywords seem to not work for the Spheroid potential object, as I have tried. It is a bit wired since Spheroid is implemented by Multipole as well (right?).

While I understand people usually do not care about the very low-density region, it might be good to allow users to control the precision of Spheroid (and maybe other default available potentials) when strange behavior appears.

image

Feature request: enclosed mass in Python interface

Hi Eugene,
In the C++ part of the documentation, you mentioned "Methods of the BaseDensity class include enclosedMass (compute the mass enclosed within a given spherical radius) and totalMass".
However, it seems only the totalMass being exposed to the Python density/potential object. I am wondering if it would be useful to add enclosedMass to the python interface as well.
(I ask here just in case it is simple to implement, please decide by your own priority of course! :)

In case it may be useful to someone facing the same task as mine, here are two workarounds,

  1. The function totalMass accepts a single radius as input, unfortunately, it does not support arrays.
  2. For a spherical system, one can use pot.force to get GM(<r)/r^2 and hence M(<r).

Sampling refinement procedure error

Hello,

I am trying to create a sample of N stars through the sample() method through the GalaxyModel object through the Python interface. However, I noticed that for some parameters of the distribution function or potential, I get the following error: RuntimeError: Error in sample(): Error in sampleNdim: refinement procedure did not converge.

I have seen in the math_sample.cpp source code that there exists a maxNumIter variable which limits the number of iterations in the recursive refinement loop. This is set to 50.

My question is: is there any way I could change that constant? Or if that is not possible/recommended what would you suggest to do instead to obtain a sample?

Thank you in advance!

Paula Gherghinescu
University of Surrey

Add a getUnits() function in py_wrapper?

I'm working on some code that uses both Gala and Agama, but needs to construct an Agama potential on-the-fly and compare with unit-ful output from Gala, and so it would be useful if there was a way to retrieve the current units that are used by Agama. Is there a way to do this already that I missed? Since there is agama.setUnits() it might make sense to provide a agama.getUnits() to retrieve the current unit state?

Simulation with binary SMBH and two component mass function crashing after some timesteps

Hi,
I was running a simulation with 131072 particles consisting of a two component mass function with a binary SMBH at the center (I am attaching the initial conditions inside). I used a value of Coulomb logarithm = ln (0.3 * M_{SMBH} / M_{\odot} = 13.8 when I noticed that after a few timesteps I get the following error

terminate called after throwing an instance of 'std::invalid_argument'
  what():  BaseInterpolator2d: fvalues must be finite (fvalues[234,0]=inf)
Stack trace (11 functions, starting from the most recent one):
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(+0x1be281) [0x1483a9861281]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(math::BaseInterpolator2d::BaseInterpolator2d(std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, math::IMatrixDense<double> const&)+0x187) [0x1483a98642d7]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(math::CubicSpline2d::CubicSpline2d(std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, math::IMatrixDense<double> const&, bool, double, double, double, double)+0x3b) [0x1483a986439b]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(galaxymodel::SphericalIsotropicModelLocal::SphericalIsotropicModelLocal(potential::PhaseVolume const&, math::IFunction const&, math::IFunction const&, std::vector<double, std::allocator<double> > const&)+0x1897) [0x1483a98ee187]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(+0x2b04b9) [0x1483a99534b9]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(raga::RagaTaskRelaxation::finishEpisode()+0x2dd) [0x1483a9953b9d]
/hildafs/projects/phy200019p/diptajym/p3_final_sims/raga_tests/lowres_q_0.1_seg_stellar/agama.so(raga::RagaCore::doEpisode(double)+0xb31) [0x1483a99432a1]
./raga.exe() [0x401215]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x1483a85377b3]
./raga.exe() [0x4012ee]

I checked the energy conservation and potential at the center and they seemed reasonable to me. I also used a triaxial symmetry like you suggested previously. What could be the source of this error?

Thank you for your help!
raga_smbhb.zip

Wrong Potential for Gas and DarkMatter particles

Hi!
I'm using Agama with python 2 (anaconda/2/2019.03) to evaluate the vertical action of MW-like galaxies in the IllustrisTNG simulation.
I'm having problems in evaluating the potentials of stars and gas particles.

  • The input data are x,y,z and mass of particles in kpc and Msun, respectively
  • I'm using agama.setUnits(mass=1, length=1, velocity=1)

The code runs but when I plot the circular velocity profile of gas and stars, it goes like crazy, and compared within the ones evaluated with the mass enclosed they are completely wrong.

Do you have any idea of what can be the problem?

NaN values for total energy in RAGA

Hi,
I was performing a simulation involving ~131k particles. It is a two component system with one set of particles have masses 0.1 times the other set of particles. I found that when I used a non-zero value for the coulomb logarithm, I found that the simulation starts reporting NaN values for energy after a few timesteps. Is this behavior expected? If not, how should one go about troubleshooting it?

Thank you.

Problems of installing agama on mac osx

I have problems on installing Agama on my mac osx (10.15.7, Catalina)
When I do pip install agama
I get this message that openMP is not supported... -Any idea?

Thanks a lot for your feedback!
Mathias

Collecting agama
Using cached https://files.pythonhosted.org/packages/e4/41/e89578bc985f05166687f2500c0f522f2bfc732705c75400fb5a83ddc305/agama-1.00.tar.gz
Running /private/var/folders/d0/d081jvpd35j9s1wrjm5sjg280000gn/T/pip-install-otxxdm2v/agama/setup.py
Downloading the latest version of package from github
Building wheels for collected packages: agama
Building wheel for agama (setup.py) ...
==== Checking supported compiler options and available libraries ====

\Warning, OpenMP is not supported
If you're compiling on MacOS with clang, you'd better install another compiler such as GCC
Do you want to continue without OpenMP? [Y/N]

ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
**** Trying the options provided by python3.7-config --ldflags ****
**** Trying the following options for linking against Python library ****
x86_64-apple-darwin13.4.0-clang++ -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -fPIC -Wall -O2 -std=c++11 -march=native -Wno-missing-field-initializers test.cpp -o ./agamatest.so -I"/Users/schultheis/opt/anaconda3/include/python3.7m" -I"/Users/schultheis/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include" -shared -fPIC -L/Users/schultheis/opt/anaconda3/lib/python3.7/config-3.7m-darwin -lpython3.7m -ldl -framework CoreFoundation
ld: warning: -pie being ignored. It is only used when linking a main executable
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libdl.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libdl.tbd
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
ld: symbol dyld_stub_binder not found (normally in libSystem.dylib). Needed to perform lazy binding to function _PyCapsule_GetPointer for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
error: Could not compile test program which uses libpython3.7

ERROR: Failed building wheel for agama

Error when Importing Agama: dlopen symbol not found in flat namespace

I've tried installing agama a few different ways with varying success on an M1 Macbook Air running macOS 12.4 Monterey. The most recent attempts using pip install --user agama or python setup.py install --user appear to compile fine in an anaconda environment with python 3.8, but produce an error when attempting to import agama:

% python
Python 3.8.13 (default, Mar 28 2022, 06:13:39) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import agama
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/jglad/Downloads/Agama-master/agama.so, 0x0002): symbol not found in flat namespace '__ZNKSt12__basic_fileIcE7is_openEv'

Any advice or help would be appreciated.

Gadget-4 plugin

Hi Eugene,
I am considering using Gadget4 in the future at some point for its scalability. Gadget4 allows one to add external potential by editing grav_external.cc. It would be great to incorporate Agama into Gadget4 as the external potential (e.g., specified by an .ini file) in a similar way to the Agama NEMO plugin. Do you have any general suggestions for the implementation?
I haven't dived into it at the moment and might get back with more specific questions in the future.
Just wondering if you happen to have any plans for making a plugin for Gadget4 or be interested in making an example for incorporating agama into Gadget4.

Memory leak?

Hi!

I have been using the ActionMapper method heavily and I noticed that, whenever I use it, the memory pressure only increases (and very fast). Even when it is finished, or even if I delete the ActionMapper object and create it again when I move from one set of actions to the next set in the 3D grid I am using, the allocated memory does not go down.

I am wondering if I am doing something wrong or not but a simple call like

%%timeit -n 1000
am = agama.ActionMapper(pot, np.array([240.00000066666666, 1e-01, 360.0]))

made python consume 1Gb of RAM in seconds, which I cannot get back until I restart my Jupyter kernel. Could it be this the issue? That I work with Jupyter notebooks?

Thank you in advance!

Installing on Intel Mac 10.15 w/ Anaconda Python 3.8

Hey Eugene,

This is not a bug report, but wanted to document a hiccup I ran into when building on a new laptop. Using the solutions from #3 got agama and the python wrapper to build, but when I imported from Python I would get:

>>> import agama
Fatal Python error: _PyInterpreterState_Get(): no current thread state
Python runtime state: unknown

[1]    83458 abort      python

After a bunch of googling, I found some relevant discussion here. Ultimately, the solution was to add (as suggested in that post)

LINK_FLAGS    += -undefined dynamic_lookup

🤷

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.