kpeeters / homebrew-repo

Homebrew repository for my software
0 stars 0 forks source link

brew upgrade fails to update Cadabra 2.4.2.4 -> 2.4.4.1 #4

Open spinor87 opened 11 months ago

spinor87 commented 11 months ago

brew upgrade is failing to upgrade Cadabra.

% brew upgrade
==> Upgrading 1 outdated package:
kpeeters/repo/cadabra2 2.4.2.4 -> 2.4.4.1
==> Fetching kpeeters/repo/cadabra2
==> Downloading https://files.pythonhosted.org/packages/5a/36/4667b08bc45131fe655a27b1a112c1730f3244343c53a338f44d730bd6ba/sympy-1.11.1.tar.gz
Already downloaded: /Users/vivek/Library/Caches/Homebrew/downloads/e0a50a80533c5695eb86a6ea8bcf5a0bdc84c36e659a8f0f9645ec2dd62fcafb--sympy-1.11.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/80/02/a9f4de927fc1677a68b40d966f9ea757b58997cfe06cf305ffa2159979ce/gmpy2-2.1.2.tar.gz
Already downloaded: /Users/vivek/Library/Caches/Homebrew/downloads/55842958226ac2cf30697d162fe04e9fd61f70c5b89ae05e2836744ab136a1cb--gmpy2-2.1.2.tar.gz
==> Downloading https://github.com/kpeeters/cadabra2/archive/refs/tags/2.4.4.1.tar.gz
Already downloaded: /Users/vivek/Library/Caches/Homebrew/downloads/ee242b81ca97ede32add9ed069785334a9558abae1ef79b94e4ffca287379f2f--cadabra2-2.4.4.1.tar.gz
==> Upgrading kpeeters/repo/cadabra2
  2.4.2.4 -> 2.4.4.1 

==> cmake -DENABLE_MATHEMATICA=OFF .
==> make install
Last 15 lines from /Users/vivek/Library/Logs/Homebrew/cadabra2/02.make:
Install the project...
/opt/homebrew/Cellar/cmake/3.27.4/bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /opt/homebrew/Cellar/cadabra2/2.4.4.1/share/jupyter/kernels/cadabra2/kernel.json
-- Installing: /opt/homebrew/Cellar/cadabra2/2.4.4.1/share/jupyter/kernels/cadabra2/logo-32x32.png
-- Installing: /opt/homebrew/Cellar/cadabra2/2.4.4.1/share/jupyter/kernels/cadabra2/logo-64x64.png
CMake Error at jupyterkernel/cmake_install.cmake:57 (file):
  file cannot create directory:
  /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter.
  Maybe need administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:43 (include)

make: *** [install] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/kpeeters/homebrew-repo/issues

Things I tried but which failed

brew cleanup brew cleanup --prune=1 sudo chown -R <user> /opt/homebrew sudo brew upgrade (not supported anymore)

This is a single-user Mac system and I do have admin privileges. However, the standard online remedies for a CMake error in brew did not cure the ailment.

I am fairly certain this is just a brew problem with privileges and not a Cadabra issue, but I've never faced it in a form that wouldn't get fixed after using chown.

kpeeters commented 11 months ago

Yeah, I know. I spent 5 minutes updating the homebrew package to the latest cadabra version, and then two hours trying to figure out why this happens. I have no idea so far, but it looks like the homebrew people messed up something. I don't have time to dig into this further, any help is welcome (if not I will probably remove the homebrew package altogether as it is just causing headaches).

spinor87 commented 11 months ago

any help is welcome

I will let you know if I figure out a fix.

navagaddam commented 7 months ago

Is there an update on this?

I am also having trouble building from source when I run the last step. This worked in the past for the previous version 2.4.2.4 but I have the following error for the latest version 2.4.4.1:

% sudo make install
[  2%] Built target cadabra-server

[  6%] Built target cadabra_client

[  9%] Built target cadabra2html

[ 11%] Built target cadabra2latex

[ 79%] Built target cadabra2

[ 79%] Built target cadabra2-cli

[ 81%] Built target cdb-nbtool

[ 81%] Built target test_preprocessor

[ 83%] Built target cadabra2python

[ 86%] Built target cadabra2ipynb

[ 88%] Built target cadabra2cadabra

[ 90%] Built target _component

[ 90%] Built target _algorithm

[ 97%] Built target cadabra2-gtk

[ 97%] Built target quickstart_test

[ 97%] Built target beginners_test

[ 97%] Built target tensor_monomials_test

[ 97%] Built target for_previous_users_test

[ 97%] Built target converge_test

[100%] Built target fierz_test

[100%] Built target gamma_matrix_algebra_test

[100%] Built target poincare_algebra_test

[100%] Built target string_states_test

[100%] Built target bianchi_identities_test

[100%] Built target schwarzschild_test

[100%] Built target kaluza_klein_test

[100%] Built target scalar_manipulations_test

Install the project...

-- Install configuration: ""

-- Up-to-date: /usr/local/share/jupyter/kernels/cadabra2/kernel.json

-- Up-to-date: /usr/local/share/jupyter/kernels/cadabra2/logo-32x32.png

-- Up-to-date: /usr/local/share/jupyter/kernels/cadabra2/logo-64x64.png

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/__init__.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/__main__.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/context.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/completer.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/kernel.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cadabra2_jupyter/server.py

-- Up-to-date: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/static/components/codemirror/mode/cadabra/cadabra.js

CMake Error at client_server/cmake_install.cmake:49 (file):

  file cannot create directory: /usr/local/share/cadabra2.  Maybe need

  administrative privileges.

Call Stack (most recent call first):

  cmake_install.cmake:44 (include)

make: *** [install] Error 1
kpeeters commented 7 months ago

I can't help with the homebrew problem, they messed something up or changed something in a backward incompatible way and I do not have time to dig into that.

When you build from source and do make install, unless you have indicated an installation directory which is writable for you, it will go into /usr/local/ and you need superuser privileges to write there. Do make as normal user, and then sudo make install to install.

navagaddam commented 7 months ago

Thanks for your response, Kasper. I do literally what you suggested

git clone https://github.com/kpeeters/cadabra2

cd cadabra2
mkdir build
cd build
cmake -DENABLE_MATHEMATICA=OFF ..
make
sudo make install

So I do make as normal user, and then sudo make install after that. This last step is what produced the error I mentioned earlier.

kpeeters commented 7 months ago

Some weird permissions on your /usr/local folder. What does

ls -lad /usr/local

give?

navagaddam commented 7 months ago

That gives

drwxr-xr-x 17 root wheel 544 Jan 13 18:26 /usr/local

What should the normal permissions be?

kpeeters commented 7 months ago

What does

ls -la /usr/local/share/

give?