Segmentation Fault while trying to install julia packages - julia

I am having some trouble using julia on this new linux machine on which I have limited privileges. For instances, I am getting a Segmentation Fault while trying to install a simple package. As you can see, I am able to update the installation, getting the toml files from github, but the later instruction to install Pluto fails in a less then verbose way.
(py3+) [nuwjtv5#rh6-rd-ho-cloudera-07 ~]$ bat packages.jl
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: packages.jl
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ using Pkg
2 │ Pkg.update()
3 │ Pkg.add("Pluto")
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
(py3+) [nuwjtv5#rh6-rd-ho-cloudera-07 ~]$ julia --version
julia version 1.5.2
(py3+) [nuwjtv5#rh6-rd-ho-cloudera-07 ~]$ julia packages.jl
Installing known registries into `~/.julia`
######################################################################## 100.0%
Added registry `General` to `~/.julia/registries/General`
Updating registry at `~/.julia/registries/General`
No Changes to `~/.julia/environments/v1.5/Project.toml`
No Changes to `~/.julia/environments/v1.5/Manifest.toml`
Resolving package versions...
julia: /buildworker/worker/package_linux64/build/src/cgmemmgr.cpp:831: virtual uint8_t* {anonymous}::RTDyldMemoryManagerJL::allocateCodeSection(uintptr_t, unsigned int, unsigned int, llvm::StringRef): Assertion `!code_allocated' failed.
signal (11): Segmentation fault
in expression starting at /export/home/nuwjtv5/packages.jl:3
Segmentation fault
Any help would be greatly appreciated.

Related

pre-commit giving error with mirrors-mypy, how do I fix it?

I am getting the below error when running "pre-commit run --all-files" and when trying to make a commit, it is some python error, python version in use is "Python 2.7.16".
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/user/.cache/pre-commit/repoq_mv31g8/py_env-default/bin/python', '-mpip', 'install', '.', 'tokenize-rt==3.2.0', 'pydantic')
return code: 1
expected return code: 0
stdout:
Processing /Users/user/.cache/pre-commit/repoq_mv31g8
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting tokenize-rt==3.2.0
Using cached tokenize_rt-3.2.0-py2.py3-none-any.whl (6.1 kB)
Collecting pydantic
Using cached pydantic-1.9.0-cp310-cp310-macosx_11_0_arm64.whl (2.4 MB)
Collecting mypy==0.782
Using cached mypy-0.782-py3-none-any.whl (2.4 MB)
Collecting mypy-extensions<0.5.0,>=0.4.3
Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting typing-extensions>=3.7.4
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting typed-ast<1.5.0,>=1.4.0
Using cached typed_ast-1.4.3.tar.gz (210 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: pre-commit-dummy-package, typed-ast
Building wheel for pre-commit-dummy-package (setup.py): started
Building wheel for pre-commit-dummy-package (setup.py): finished with status 'done'
Created wheel for pre-commit-dummy-package: filename=pre_commit_dummy_package-0.0.0-py3-none-any.whl size=1154 sha256=ea7d756fd19dee0f5f03851e3e343db4194f4b306f21fecb796b4d6d89d266fb
Stored in directory: /private/var/folders/v4/nlc505k12rn9pf4c9kntz8qm0000gn/T/pip-ephem-wheel-cache-4jcph5rz/wheels/80/78/0d/746d1697141e342b257e21c980fc51ac134e6b6400568c3646
Building wheel for typed-ast (setup.py): started
Building wheel for typed-ast (setup.py): finished with status 'error'
Running setup.py clean for typed-ast
Successfully built pre-commit-dummy-package
Failed to build typed-ast
Installing collected packages: typed-ast, mypy-extensions, typing-extensions, tokenize-rt, pydantic, mypy, pre-commit-dummy-package
Running setup.py install for typed-ast: started
Running setup.py install for typed-ast: finished with status 'error'
stderr:
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
running bdist_wheel
running build
running build_py
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
running build_ext
building '_ast27' extension
building '_ast3' extension
ast3/Python/ast.c:844:5: warning: code will never be executed [-Wunreachable-code]
abort();
^~~~~
ast3/Python/ast.c:4514:9: error: implicit declaration of function '_PyUnicode_DecodeUnicodeEscape' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^
ast3/Python/ast.c:4514:9: note: did you mean 'PyUnicode_DecodeUnicodeEscape'?
/opt/homebrew/opt/python#3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/unicodeobject.h:608:23: note: 'PyUnicode_DecodeUnicodeEscape' declared here
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
^
ast3/Python/ast.c:4514:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for typed-ast
error: subprocess-exited-with-error
× Running setup.py install for typed-ast did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
running install
/Users/user/.cache/pre-commit/repoq_mv31g8/py_env-default/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
running build_ext
building '_ast27' extension
building '_ast3' extension
ast3/Python/ast.c:844:5: warning: code will never be executed [-Wunreachable-code]
abort();
^~~~~
ast3/Python/ast.c:4514:9: error: implicit declaration of function '_PyUnicode_DecodeUnicodeEscape' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^
ast3/Python/ast.c:4514:9: note: did you mean 'PyUnicode_DecodeUnicodeEscape'?
/opt/homebrew/opt/python#3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/unicodeobject.h:608:23: note: 'PyUnicode_DecodeUnicodeEscape' declared here
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
^
ast3/Python/ast.c:4514:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> typed-ast
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Check the log at /Users/user/.cache/pre-commit/pre-commit.log
I am running it on Apple M1 Air (macOS Big Sur), what am I missing or is it a known M1 issue ?
I have tried installing pydantic manually, pre-commit is installed by brew.
Thanks in Advance
pre-commit config:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
hooks:
- id: mypy
additional_dependencies: [pydantic]
you're installing a very old version of mypy (0.782) which depends on an old version of typed-ast (<1.5.0) which does not support M1
you can ~usually get to the latest version by running pre-commit autoupdate -- or pick a version newer than 0.900 (where mypy started support for M1)
disclaimer: I created pre-commit
I am using Ubuntu 22.04.
In short, when I try git commit, it will report an error because I have installed pre-commit:
An unexpected error has occurred: CalledProcessError: command: ('python', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
Executable `python` not found
First, we usually have python3 installed, so the python command is invalid.
Do it:
sudo apt install python-is-python3
Then, you usually encounter this problem in Ubuntu 22.04:
An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment
more info:
virtualenv python version did not match created version:
- actual version: <<error retrieving version from /home/wind/.cache/pre-commit/reposyb8net0/py_env-python3/bin/python>>
- expected version: 3.10.4.final.0
To fix this, add this line to your .bashrc file:
export SETUPTOOLS_USE_DISTUTILS=stdlib
Refresh the configuration file by restarting a terminal window or running source ~/.bashrc.

amdgpu-pro installation failed and now dependencies problem

first of all please bear with me as my English is still improving. So, yesterday i was trying to install DaVinci Resolve 16 on my newly installed Pop Os using an AMD RX 570 but i came across a problem related to openCL. So, i did some research and i found this command:
sudo apt install mesa-opencl-icd
Once, I did that and started DaVinci it crashed on startup with error "DaVinci Resolve quit unexpectedly "
Again I came to google for help and i found that i need to install amdgpu-pro drivers to get my gpu openCL support and i followed these instructions:
* you need to edit the "amdgpu-pro-install"-file.
* Change the string "ubuntu" to debian or debianlinux or so.
* The string "ubuntu" you can find in function os_release()
* With Linux Mint i need to change it to "linuxmint" and installation will be fine
so I followed the instructions and now it is giving me these errors:
Errors were encountered while processing:
amdgpu-dkms
amdgpu
amdgpu-pro-rocr-opencl
amdgpu-pro
amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)
and now i can't install or uninstall any pkg or deb file
-> sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up amdgpu-dkms (1:5.6.20.906316-1188099) ...
Removing old amdgpu-5.6.20.906316-1188099 DKMS files...
------------------------------
Deleting module version: 5.6.20.906316-1188099
completely from the DKMS tree.
------------------------------
Done.
Loading new amdgpu-5.6.20.906316-1188099 DKMS files...
Building for 5.8.0-7630-generic
Building for architecture amd64
Building initial module for 5.8.0-7630-generic
ERROR (dkms apport): kernel package linux-headers-5.8.0-7630-generic is not supported
Error! Bad return status for module build on kernel: 5.8.0-7630-generic (amd64)
Consult /var/lib/dkms/amdgpu/5.6.20.906316-1188099/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--configure):
installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
amdgpu depends on amdgpu-dkms (= 1:5.6.20.906316-1188099); however:
Package amdgpu-dkms is not configured yet.
dpkg: error processing package amdgpu (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro-rocr-opencl:
amdgpu-pro-rocr-opencl depends on amdgpu-dkms (= 1:5.6.20.906316-1188099); however:
Package amdgpu-dkms is not configured yet.
dpkg: error processing package amdgpu-pro-rocr-opencl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro:
amdgpu-pro depends on amdgpu (= 20.45-1188099); however:
Package amdgpu is not configured yet.
dpkg: error processing package amdgpu-pro (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro-lib32:
amdgpu-pro-lib32 depends on amdgpu (= 20.45-1188099) | amdgpu-hwe (= 20.45-1188099No apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
); however:
Package amdgpu is not configured yet.
Package amdgpu-hwe is not installed.
amdgpu-pro-lib32 depends on amdgpu-pro (= 20.45-1188099) | amdgpu-pro-hwe (= 20.45-1188099); however:
Package amdgpu-pro is not configured yet.
Package amdgpu-pro-hwe is not installed.
dpkg: error processing package amdgpu-pro-lib32 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
amdgpu-dkms
amdgpu
amdgpu-pro-rocr-opencl
amdgpu-pro
amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)
You should be able to uninstall amdgpu(-pro) drivers by running /usr/bin/amdgpu(-pro)-uninstall script.
Did you try to install the amdgpu drivers with the different kernel as advised here?

How to use julia's PackageCompiler to build a quick launch environment for PlotStats?

I want to use 'DataFrames,CSV,StatsPlots' packages without waiting time after reboot machine, I'm trying to use PackageCompiler, but the README or help is hard to understand.
using using PackageCompiler
syso, sys = compile_incremental(:DataFrames,:CSV,:StatsPlots)
Well, I'm afraid to destroy the system image, so, at first, I don't use the 'force=true' option. It shows error messages:
...
Resolving package versions...
ERROR: LoadError: Unsatisfiable requirements detected for package WinRPM [c17dfb99]:
WinRPM [c17dfb99] log:
├─possible versions are: [0.3.3, 0.4.0-0.4.3] or uninstalled
├─restricted by compatibility requirements with PackageCompiler [9b87118b] to versions: [0.3.3, 0.4.0-0.4.3]
│ └─PackageCompiler [9b87118b] log:
│ ├─possible versions are: [0.5.0-0.5.1, 0.6.0-0.6.5] or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions [0.5.0-0.5.1, 0.6.0-0.6.5]
├─restricted by compatibility requirements with Compat [34da2185] to versions: 0.4.3 or uninstalled, leaving only versions: 0.4.3
│ └─Compat [34da2185] log:
│ ├─possible versions are: [1.0.0-1.0.1, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0-1.5.1, 2.0.0, 2.1.0, 2.2.0, 3.0.0, 3.1.0, 3.2.0] or uninstalled
│ └─restricted to versions 3.2.0 by an explicit requirement, leaving only versions 3.2.0
└─restricted by compatibility requirements with HTTPClient [0862f596] to versions: uninstalled — no versions left
└─HTTPClient [0862f596] log:
├─possible versions are: 0.2.1 or uninstalled
└─restricted by compatibility requirements with Compat [34da2185] to versions: uninstalled
└─Compat [34da2185] log: see above
It seems workable by PackageCompilerX. At first, the package's version is very sensitive, it require correct version to let everything work.
Here are two of my testing environment for julia 1.3.1
debian: apt -t unstable install julia libjulia-dev
archlinux: pacman -S julia
check Julia's version(PackageCompilerX only work after 1.3.1)
julia> versioninfo()
Julia Version 1.3.1
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Xeon(R) CPU # 2.20GHz
Add PackageCompilerX and all package which you want to plot to repository
pkg> add https://github.com/KristofferC/PackageCompilerX.jl
pkg> status
Status `~/.julia/environments/v1.3/Project.toml`
...
Copy system's Project.toml to current directory for customize your development environment, use editor(here vim) to remove some package which can't compile or not required.
shell> rm Project.toml
shell> cp ~/.julia/environments/v1.3/Project.toml .
shell> vim Project.toml
activate local package environment
julia> using PackageCompilerX
pkg> activate .
pkg> status # double check all package which you want have installed
Status `~/prj/julia/Project.toml`
[336ed68f] CSV v0.5.22
[a93c6f00] DataFrames v0.20.0
...
generated sybmol array automatically in julia prompt
s=split(read("Project.toml", String),"\n")
pkgs=Symbol[]
for i in s
if (length(i) > 0) && !(i[1] in ['[','#'])
push!(pkgs, Symbol(split(i," ")[1]))
end
end
show pkgs
julia> pkgs
10-element Array{Symbol,1}:
:CSV
:DataFrames
...
compile it and output to "dev.so" by
julia> create_sysimage(pkgs, sysimage_path="dev.so")
exit julia, and re-launch julia by
julia -J dev.so
Benchmark these two launch method and result:
time julia -q -e 'using Plots,UnicodePlots; unicodeplots(); display(plot(sin))'
# result: 35.175s
time julia -J dev.so -q -e 'using Plots,UnicodePlots; unicodeplots(); display(plot(sin))'
# result: 15.2365s

Error when installing MultiNest for MPI - missing Fortran libraries

I am trying to install MultiNest and PyMultiNest on Ubutnu 16.04. I have OpenMPI installed and can successfully run programs with it. However, during the installation of MultiNest, I get this:
kevin#kevin-VirtualBox:~/MultiNest/build$ cmake ..
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Detected gfortran, adding -ffree-line-length-none compiler flag.
CMake Warning at /usr/share/cmake-3.5/Modules/FindMPI.cmake:406 (message):
Unable to find MPI library mpi_mpifh
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindMPI.cmake:596 (interrogate_mpi_compiler)
src/CMakeLists.txt:86 (FIND_PACKAGE)
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIBRARIES)
-- MPI not found, only non-MPI MultiNest libraries will be built.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kevin/MultiNest/build
Any guidance on how to fix this?
When I installed 'libopenmpi-dev', the cmake process seemed to finish properly.

could not install frama-c-Phosphorus using opam

I had successfully installed frama-c-Silicon using opam by the instructions, but when I want to upgrade to Phosphorus, opam does not work.
I used the command:
opam pin add frama-c Downloads/frama-c-Phosphorus20170501.tar.gz
it said that:
[NOTE] Package frama-c is already path-pinned to
/home/talos/Downloads/frama-c-Phosphorus-20170501.tar.gz.
This will erase any previous custom definition.
Proceed ? [Y/n] y
[frama-c] /home/talos/Downloads/frama-c-Phosphorus-20170501.tar.gz synchronized
frama-c needs to be installed.
The following actions will be performed:
∗ install frama-c-base 20161101* [required by frama-c]
Why3 can be used by the WP plug-in for running additional automatic solvers
Coq can be used with the WP plug-in for proving interactively proof obligations
∗ install frama-c 20161101*
Alt-Ergo Graphical Interface can be used by the WP plug-in
===== ∗ 2 =====
Do you want to continue ? [Y/n] y
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[frama-c.20161101] /home/talos/Downloads/frama-c-Phosphorus-20170501.tar.gz already up-to-date
[frama-c-base.20161101] /home/talos/Downloads/frama-c-Phosphorus-20170501.tar.gz already up-to-date
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#=== ERROR while installing frama-c-base.20161101 =============================#
These patches didn't apply at /home/talos/.opam/system/build/frama-c-base.20161101:
- 4.05-support.patch
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
∗ install frama-c 20161101
The following actions failed
∗ install frama-c-base 20161101
No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of
sync.
I think your problem is related more to the usage of OPAM itself (opam pin in particular) than Frama-C.
This line in particular indicates that you have pinned a Frama-C package in your OPAM installation:
[NOTE] Package frama-c is already path-pinned to
/home/talos/Downloads/frama-c-Phosphorus-20170501.tar.gz.
This will erase any previous custom definition.
This was only necessary before the Phosphorus package was available in OPAM. You should revert to a default configuration by removing it and then installing it via the "standard" (non-pinned) way:
opam pin remove frama-c
# just in case, you may want to unpin the frama-c-base package, if it is pinned
opam pin remove frama-c-base
# then install the package normally; you may need to update OPAM to make
# sure the package is available in your repository
opam update
opam install frama-c
Note that, if you still have a message displayed such as:
The following actions will be performed:
∗ install frama-c-base 20161101* [required by frama-c]
That might indicate an issue with OPAM's constraints.
The version number of the Phosphorus release is 20170501. Anything other than that means you won't get Phosphorus, but an older version. It is not worth continuing: the issue must be fixed beforehand.

Resources