Open zhuzzzzzz opened 1 year ago
wget https://raw.githubusercontent.com/numpy/numpy/v/tools/swig/numpy.i
@zhuzzzzzz , we just realized that the current makefile installation requires symbolic links to the python and pip executables of choice (python-sirius
and pip-sirius
, respectivelly). these executables are used in order to find the python version so that the appropriate numpy.i
can be downloaded during the installation process. without these links an invalid version string is created and the download is broken. We will fix this soon by trying to make the installation less dependent on our particular environment. Thanks for pointing it out!
In the meantime you can fix this by creating the symbolic links. In our debian system we create them by issuing the following commands:
ln -s /usr/local/bin/python3.6 /usr/local/bin/python-sirius
ln -s /usr/local/bin/pip3.6 /usr/local/bin/pip-sirius
just adapt them to point to yout python and pip executables.
It doesn't work, I have successfully created the soft link of python3 and pip, but the result of make all still gets something wrong
`g++ -c -m64 -O3 -std=c++11 -fPIC -DVERSION=4.10.0 -pthread -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wcast-align -Wconversion -Wduplicated-cond -Wlogical-op -Wmisleading-indentation -Wnull-dereference -Woverloaded-virtual -Wpedantic -Wunused -Wuseless-cast -I./include -I/usr/include -I./src src/output.cpp -o build/output.o;
In file included from ./include/trackcpp/kicktable.h:20,
from ./include/trackcpp/accelerator.h:20,
from ./include/trackcpp/dynap.h:20,
from ./include/trackcpp/output.h:20,
from ./include/trackcpp/trackcpp.h:20,
from src/output.cpp:17:
./include/trackcpp/auxiliary.h: In member function ‘int PassMethodsClass::size() const’:
./include/trackcpp/auxiliary.h:54:47: warning: conversion from ‘std::vector<std::__cxx11::basic_string |
int size() const { return passmethods.size(); } | const int n = std::min(polynom_b.size(), polynom_a.size()); | ^
./include/trackcpp/passmethods.hpp: In function ‘Status::type pm_kickmap_pass(Pos |
Status::type status = kicktablethinkick(pos, elem.kicktable_idx, brho, elem.nr_steps, elem.rescale_kicks); | ^ |
Status::type status = Status::success; | ^ |
fprintf(fp, "# radiation_state : %s\n", rad_dict[accelerator.radiation_on]); | ~^ | |
---|---|---|---|---|---|---|---|---|---|---|
char* |
src/output.cpp: In function ‘Status::type print_tracking_linepass(const Accelerator&, const std::vector<Pos |
fprintf(fp, "# radiation_state : %s\n", rad_dict[accelerator.radiation_on]); | ~^ |
---|---|---|
char* |
src/output.cpp:80:60: warning: conversion from ‘std::vector |
unsigned int nr_elements = accelerator.lattice.size(); | fprintf(fp, "# radiation_state : %s\n", rad_dict[accelerator.radiation_on]); | ~^ | |
---|---|---|---|---|
char* |
src/output.cpp:111:60: warning: conversion from ‘std::vector |
unsigned int nr_elements = accelerator.lattice.size(); | fprintf(fp, "# radiation_state : %s\n", rad_dict[accelerator.radiation_on]); | ~^ | |
---|---|---|---|---|
char* |
ar rcs build/libtrackcpp.a build/lattice.o build/elements.o build/passmethods.o build/tracking.o build/trackcpp.o build/flat_file.o build/optics.o build/diffusion_matrix.o build/dynap.o build/output.o build/kicktable.o build/multithreads.o build/accelerator.o build/naff.o build/linalg.o build/auxiliary.o
g++ -m64 build/exec.o build/tests.o build/commands.o build/libtrackcpp.a -L/usr/lib/x86_64-linux-gnu -lgsl -lgslcblas -lm -lpthread -o build/trackcpp
make -C python_package
make[1]: Entering directory '/home/zhu/Project/LNLS/trackcpp/python_package'
make[1]: python-sirius-config: No such file or directory
Traceback (most recent call last):
File "
make[1]: [Makefile:48: trackcpp_wrap.cxx] Error 8 make[1]: Leaving directory '/home/zhu/Project/LNLS/trackcpp/python_package' make: [Makefile:147: python_package/trackcpp/_trackcpp.so] Error 2 `
Hi @zhuzzzzzz , I noticed this error:
ModuleNotFoundError: No module named 'numpy' Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy'
in your report.
Do you have numpy
installed? It seems it can't find your numpy
installation to get the version properly and download the correct numpy.i
file.
The link https://raw.githubusercontent.com/numpy/numpy/v/tools/swig/numpy.i
doens't exist because it's missing the correct version. It should be something like this: https://raw.githubusercontent.com/numpy/numpy/v1.24.1/tools/swig/numpy.i
I found that I linked the python and pip excutable file of my linux system but I do make operation in my virtual env where the numpy package has already installed, after I changed to the correct soft link it still doesn't work, so I install the numpy package in my system. However then it works, there is no problem with numpy but it still goes wrong...
`2023-03-02 09:40:45 (394 KB/s) - ‘numpy.i’ saved [103094/103094]
swig -c++ -python -I/usr/include -I../include -I/home/zhu/.local/lib/python3.10/site-packages/numpy/core/include trackcpp.i && cp -f trackcpp.py trackcpp
../include/trackcpp/auxiliary.h:55: Warning 389: operator[] ignored (consider using %extend)
../include/trackcpp/elements.h:106: Warning 503: Can't wrap 'operator <<' unless renamed to a valid identifier.
../include/trackcpp/accelerator.h:42: Warning 503: Can't wrap 'operator <<' unless renamed to a valid identifier.
../include/trackcpp/optics.h:44: Warning 503: Can't wrap 'operator <<' unless renamed to a valid identifier.
../include/trackcpp/linalg.h:62: Warning 503: Can't wrap 'operator +' unless renamed to a valid identifier.
g++ -c -std=c++11 -fPIC -O3 -I/usr/include -I../include -I/home/zhu/.local/lib/python3.10/site-packages/numpy/core/include trackcpp_wrap.cxx -o trackcpp_wrap.o
trackcpp_wrap.cxx:178:11: fatal error: Python.h: No such file or directory
178 | # include ~~~~~
compilation terminated.
make[1]: [Makefile:75: trackcpp_wrap.o] Error 1
make[1]: Leaving directory '/home/zhu/Project/LNLS/trackcpp/python_package'
make: [Makefile:147: python_package/trackcpp/_trackcpp.so] Error 2
`
` ...... ar rcs build/libtrackcpp.a build/lattice.o build/elements.o build/passmethods.o build/tracking.o build/trackcpp.o build/flat_file.o build/optics.o build/diffusion_matrix.o build/dynap.o build/output.o build/kicktable.o build/multithreads.o build/accelerator.o build/naff.o build/linalg.o build/auxiliary.o g++ -m64 build/exec.o build/tests.o build/commands.o build/libtrackcpp.a -L/usr/lib/x86_64-linux-gnu -lgsl -lgslcblas -lm -lpthread -o build/trackcpp make -C python_package make[1]: Entering directory '/home/zhu/Project/LNLS/trackcpp/python_package' make[1]: python-sirius-config: No such file or directory /bin/sh: 1: python-sirius: not found /bin/sh: 1: python-sirius: not found [ -f ./numpy.i ] && echo "numpy.i already here, good" || \ wget https://raw.githubusercontent.com/numpy/numpy/v/tools/swig/numpy.i --2023-02-14 09:13:54-- https://raw.githubusercontent.com/numpy/numpy/v/tools/swig/numpy.i Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2023-02-14 09:13:55 ERROR 404: Not Found.
make[1]: [Makefile:48: trackcpp_wrap.cxx] Error 8 make[1]: Leaving directory '/home/zhu/Project/LNLS/trackcpp/python_package' make: [Makefile:147: python_package/trackcpp/_trackcpp.so] Error 2 ` Hello! I tried to run the va project in my Ubuntu virtual machine bu can't install the trackcpp module, it gives the above result. What is happening and what should I do?