Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Homebrew formula for gtk3 (now GTK4) installation on macOS (or Linux) #33

Open
YoshitakaMo opened this issue Mar 12, 2021 · 675 comments

Comments

@YoshitakaMo
Copy link

YoshitakaMo commented Mar 12, 2021

Dear Paul Emsley,

I am a researcher in the field of bioinformatics, specifically structural biology.
I'm interested in the Coot software and want to use it. For my own interest and for the convenience of other macOS users, I have created a Homebrew formula to install Coot-gtk3 from the source code by referring to build-3-3 autobuild script in the gtk3 branch.

To start the installation of Coot-Gtk3 on a macOS with Homebrew, run the following command on the terminal app:

# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)

# install coot
brew install wget
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/coot.rb
brew install ./coot.rb --verbose --HEAD

# Experimental (since May 14, 2024)
brew install yoshitakamo/bio2/coot

(May 14, 2024, Update the installation command. I provide coot bottles for macOS sonoma and Linux users)

(May 9, 2023, Update: Coot gtk3 now requires gtk 3.24.34, not the latest version. To use and pin it, see #33 (comment))

I successfully installed Coot-Gtk3 on my macOS and open the Coot-Gtk3 app. However, it won't work completely with a lot of error messages error draw_central_cube() A err,
as shown in the attached images.

pic1

pic2

Also, I tried to do another installation with the RDKit option (--with-enhanced-ligand-tools), but the installation failed due to a build error around it. If there is anything I should improve, I would like to know about it.

Since most Homebrew formulae can be also used by linuxbrew, this formula may be available on Linux OS, but I've never tested it yet.

I would like to thank @wgscott and @keitaroyam for their support in creating this Formula. I would like to complete this Homebrew Formula for Coot so that Coot users can easily get access to the latest functions.

@pemsley
Copy link
Owner

pemsley commented Apr 6, 2021

Hi YoshitakaMo, I just saw this. Usually the way to communicate with me is via email or the Coot mailing list. However, I see that Github is increasingly being use to communicate with me and I should read it more often.

Now, I think I have fixed the error draw_central_cube() bug. I think it is due to an Apple bug. I used a function that shouldn't produce but error does so.

It seems to me that your framebuffer is taking up one quarter of the GL widget (by width). I don't know why that should be. You could investigate by looking at the size of GL widget in on_glarea_resize() and changing framebuffer_scale.

Paul.

@YoshitakaMo
Copy link
Author

YoshitakaMo commented Feb 4, 2022

Hi Paul, I'm sorry to neglect the reply for a long time.

I made an updated formula on https://gist.github.com/YoshitakaMo/d07056febca81fc2ca73c6f379fce4b0, and installed the Gtk3-Coot on Intel Mac (NOT M1 Mac) with the formula on this Jan 5 https://twitter.com/Ag_smith/status/1478567242749325314 . But today the installation failed on its ./configure step.

Here is the installation step using my Homebrew formulae.

# install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
# download coot.rb
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/coot.rb -O coot.rb
# install coot
brew install ./coot.rb --verbose --HEAD --debug --keep-tmp

I think the old version of [email protected] and [email protected] formulae are required because the latest boost made breaking changes.

Here, to get the coot.rb formula to work perfectly, I'd like to know that which build procedure is the best way to install. I'm reading https://github.com/pemsley/coot/blob/refinement/build-it now, but is it the best one? Or, it would be helpful if you could write the command to build it directly here.

I also found another potential obstacles to install Gtk3-Coot on any platform. libccp4 6.5.1 couldn't be built on M1 mac (See also brewsci/homebrew-bio#1450 ). I have no idea how to solve it currently.

@YoshitakaMo
Copy link
Author

Ah, I accidentally tried to build from the 'refinement' branch, not 'gtk3'. Now I've fixed the coot.rb and I successfully installed Gtk3-Coot on my Intel Mac with Homebrew. It takes about 10 minutes to install.

After the installation, boot Coot using this command /usr/local/opt/coot/libexec/coot-bin. Currently, /usr/local/opt/coot/bin/coot or coot won't work properly probably because its setting of PATH is not correct.

Thanks to the Coot community, libccp4 was successfully built on M1 Mac ( brewsci/homebrew-bio#1450 ). I updated the Formula of libccp4. However, installation of Coot on M1 Mac has not been tested yet because [email protected] cannot be installed properly on it...

@pemsley
Copy link
Owner

pemsley commented Feb 5, 2022

I successfully installed Gtk3-Coot on my Intel Mac with Homebrew

Congratulations.

To test that the refinement works, click on the blue circle/sphere on the right and then click on 2 residues. You should be able to pull atoms around and see geometry "health bars" move.

because its setting of PATH is not correct

Where is the path not correct?

Most of the coot.in/coot script is to try to handle installation in an arbitrary directory - you don't need that so just use a "one-liner" to exec $libexec_prefix/coot-bin

@keitaroyam
Copy link
Contributor

@YoshitakaMo Many thanks for the update. Finally I managed to install COOT, but the window looked like yours in the first post.

Here is my installation note which may be my environment specific. I am using macOS Catalina 10.15.7.

I followed your instruction:

# download Formula of [email protected] and [email protected] first
brew install wget
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/boost%401.74.rb
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/boost-python3%401.74.rb
# install them
brew install ./[email protected] --verbose
brew install ./[email protected] --verbose

Then an error occurred:

==> Cleaning
==> Finishing up
ln -s ../../Cellar/[email protected]/1.74.0/share/doc/[email protected] [email protected]
ln -s ../../Cellar/[email protected]/1.74.0/lib/cmake/boost_numpy-1.74.0 boost_numpy-1.74.0
ln -s ../../Cellar/[email protected]/1.74.0/lib/cmake/boost_python-1.74.0 boost_python-1.74.0
rm /usr/local/lib/cmake/boost_numpy-1.74.0
rm /usr/local/lib/cmake/boost_python-1.74.0
rm /usr/local/share/doc/[email protected]
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/libboost_numpy39-mt.a
Target /usr/local/lib/libboost_numpy39-mt.a
is a symlink belonging to boost-python3. You can unlink it:
  brew unlink boost-python3

To force the link and overwrite all conflicting files:
  brew link --overwrite [email protected]

To list all files that would be deleted:
  brew link --overwrite --dry-run [email protected]

Possible conflicting files are:
/usr/local/lib/libboost_numpy39-mt.a -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_numpy39-mt.a
/usr/local/lib/libboost_numpy39-mt.dylib -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_numpy39-mt.dylib
/usr/local/lib/libboost_numpy39.a -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_numpy39.a
/usr/local/lib/libboost_numpy39.dylib -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_numpy39.dylib
/usr/local/lib/libboost_python39-mt.a -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_python39-mt.a
/usr/local/lib/libboost_python39-mt.dylib -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_python39-mt.dylib
/usr/local/lib/libboost_python39.a -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_python39.a
/usr/local/lib/libboost_python39.dylib -> /usr/local/Cellar/boost-python3/1.76.0/lib/libboost_python39.dylib
==> Summary
🍺  /usr/local/Cellar/[email protected]/1.74.0: 472 files, 18.5MB, built in 7 minutes 29 seconds
==> Running `brew cleanup [email protected]`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Error: Could not get runtime dependencies from /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtkglext.rb!
Error: gtk+: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:86: syntax error, unexpected <<, expecting ']'
<<<<<<< Updated upstream
^~
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:87: syntax error, unexpected ',', expecting end
... "--with-gdktarget=#{backend}",
...                              ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:88: syntax error, unexpected ']', expecting end
...        "--disable-visibility"]
...                              ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:92: syntax error, unexpected ',', expecting end
	    "--with-gdktarget=x11",
	                          ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:94: syntax error, unexpected ']', expecting end
           ]
           ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:108: syntax error, unexpected do (for lambda), expecting end
  test do
       ^~
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:162: syntax error, unexpected do (for lambda), expecting end
    on_macos do
             ^~
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb:167: syntax error, unexpected end, expecting end-of-input
  end
  ^~~

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gtk+.rb looked like

  def install
    args = ["--disable-dependency-tracking",
            "--disable-silent-rules",
            "--prefix=#{prefix}",
            "--enable-static",
            "--disable-glibtest",
            "--enable-introspection=yes",
<<<<<<< Updated upstream
            "--with-gdktarget=#{backend}",
            "--disable-visibility"]
=======
            #"--with-gdktarget=quartz",
            #"--disable-visibility"
            "--with-gdktarget=x11",
            "--enable-x11-backend"
           ]
>>>>>>> Stashed changes

So I ran following command

brew unlink boost-python3
brew link --overwrite [email protected]
brew update-reset

and finally

# install coot
wget https://gist.githubusercontent.com/YoshitakaMo/d07056febca81fc2ca73c6f379fce4b0/raw/6b6838c9aa5790b963327e8482101c8153687b41/coot.rb
brew install ./coot.rb --verbose --HEAD --debug --keep-tmp

with success.

As @YoshitakaMo mentioned, /usr/local/bin/coot failed. I changed

if [ $systype = Darwinx ] ; then
    COOT_PREFIX="$(cd "$(dirname "$current_exe_dir")" 2>/dev/null && pwd)"
else
    unlinked_exe=$(readlink -f $0)
    unlinked_exe_dir=$(dirname $unlinked_exe)
    COOT_PREFIX=$(dirname $unlinked_exe_dir)
fi

to

unlinked_exe=$(readlink -f $0)
unlinked_exe_dir=$(dirname $unlinked_exe)
COOT_PREFIX=$(dirname $unlinked_exe_dir)

but then following error occurred:

Python path configuration:
  PYTHONHOME = '/usr/local/Cellar/coot/HEAD-18202fe'
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/local/Cellar/coot/HEAD-18202fe/libexec/coot-bin'
  sys.base_prefix = '/usr/local/Cellar/coot/HEAD-18202fe'
  sys.base_exec_prefix = '/usr/local/Cellar/coot/HEAD-18202fe'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/local/Cellar/coot/HEAD-18202fe/libexec/coot-bin'
  sys.prefix = '/usr/local/Cellar/coot/HEAD-18202fe'
  sys.exec_prefix = '/usr/local/Cellar/coot/HEAD-18202fe'
  sys.path = [
    '/usr/local/Cellar/coot/HEAD-18202fe/lib/python39.zip',
    '/usr/local/Cellar/coot/HEAD-18202fe/lib/python3.9',
    '/usr/local/Cellar/coot/HEAD-18202fe/lib/python3.9/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000001122d6dc0 (most recent call first):
<no Python frame>
. ------ Coot crashed - trying to diagnose -----

I was able to start COOT from /usr/local/opt/coot/libexec/coot-bin, but map and model were displayed at the bottom left and I could not select atoms properly.

@pemsley
Copy link
Owner

pemsley commented Feb 5, 2022

I was able to start COOT from /usr/local/opt/coot/libexec/coot-bin, but map and model were displayed at the bottom left and I could not select atoms properly.

Indeed! I was wondering how @YoshitakaMo made that work because I don't think that I have pushed the fix yet.

@keitaroyam
Copy link
Contributor

So you have fixed it but not yet pushed?

@pemsley
Copy link
Owner

pemsley commented Feb 5, 2022

So you have fixed it but not yet pushed?

It was not pushed because it was not coded up with on-Mac-only test. I intend to make an update shortly - but it might be more complicated than I hope.

@pemsley
Copy link
Owner

pemsley commented Feb 6, 2022

I have pushed a simple-minded fix for the widget size vs framebuffer size problem (by by-passing the AO framebuffer). But it is not the same one that @YoshitakaMo has used because you can see in the twitter video that his version still uses the AO framebuffer.

@keitaroyam
Copy link
Contributor

keitaroyam commented Feb 6, 2022

I upgraded COOT to 050e7dd (not knowing if this is the right way)

brew upgrade ./coot.rb --verbose --fetch-HEAD --debug --keep-tmp

and it worked so nicely!

..until I resized the window.
Screenshot 2022-02-06 at 12 39 53

@pemsley
Copy link
Owner

pemsley commented Feb 6, 2022

Hmm.. Please use the argument --gtkbuilder
In order to get the Python gui working I need to
setenv GI_TYPELIB_PATH /usr/lib/x86_64-linux-gnu/girepository-1.0
For you that will be somewhat different of course.

@keitaroyam
Copy link
Contributor

What is this option for?

@pemsley
Copy link
Owner

pemsley commented Feb 6, 2022

What is this option for?

With --gtkbuilder the gui is generated (on the fly) from the builder/glade file, not from the ancient gtk2-interface.c - it's a large code path difference and may (well) affect what you are seeing.

@keitaroyam
Copy link
Contributor

So is it an option of configure? Nothing seems to have changed..

@pemsley
Copy link
Owner

pemsley commented Feb 6, 2022

So is it an option of configure? Nothing seems to have changed..

It's an argument to coot - sorry that that was not clear.

@keitaroyam
Copy link
Contributor

OK thanks. The appearance has changed a bit, but the resizing problem remains the same.

@blake-riley
Copy link

blake-riley commented Apr 1, 2022

Yep, I can confirm that the resizing problem remains on macOS

Coot 1.0 (commit e55c6b9)
macOS Big Sur 11.5.2 (a bit out of date), Intel, 27" iMac

Screen.Recording.2022-04-01.at.18.19.47.squish.mp4

I hope this video helps you identify where the issue might be in the code?

@YoshitakaMo
Copy link
Author

I'm happy to hear that Coot 1 has been released. However, this Homebrew Formula was developed before the release and I haven't tested yet for the latest version. The window-resize issue on macOS is a known bug, but I've not found the solution yet.
I will rebuild the Homebrew Formula for Coot 1 when I have time.

@pemsley
Copy link
Owner

pemsley commented Apr 2, 2022

Hi Blake, can you try a couple of things for me? What happens when you are "Plain" render mode? (Edit → Shader Preferences) and try to resize? Try turning on the FPS meter (under Draw menu). Thanks.

@pemsley
Copy link
Owner

pemsley commented Apr 2, 2022

The window-resize issue on macOS is a known bug, but I've not found the solution yet.

The problem is in graphics_info_t::reset_frame_buffers(). From the looks of things (the video from blake-riley), this is being called before attach_buffers() has been called. It might be a "OpenGL in GTK on Mac OS" bug (but probably is a problem in my code).

In "Plain" render mode it seems that reset_frame_buffers() is using the wrong dimensions.

@blake-riley
Copy link

More pixels, more time to draw a frame.
Ultimately, the resizing still suffers from the same "misdimensioning" (though it initially starts at a 1/2w, 1/2h scale factor).
I'd hazard a guess that this is to do with the 2x DPI on Macs with Retina displays.

Here's another video (so you can check out the FPS meter):
https://user-images.githubusercontent.com/4962663/161405017-9a697637-02e8-477c-9dbf-be7455b9ef05.mp4

@biochem-fan
Copy link

biochem-fan commented Apr 3, 2022

Resize issue:

On my Mac Book Pro Retina, the scale factor is 1.

After the graphics is messed up, I can recover by clicking the top part of the window where you would have menus (even if the menu is invisible in the screwed up window).

@YoshitakaMo
Copy link
Author

Hi, I'm aware there may be a lot of people waiting for a one-liner installation using Homebrew.
https://www.jiscmail.ac.uk/cgi-bin/wa-jisc.exe?A2=ind2204&L=COOT&O=D&X=329C65F4D20514F6D5&P=3586
I'm trying the installation in M1 Mac. But, as reported in the mailing list, the installation of FFTW2 (required for clipper) failed.

$ ./configure --prefix=/opt/homebrew/Cellar/clipper4coot/2.1.20180802_1/fftw2 --enable-shared --enable-float --disable-static
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking type prefix for installed files... (none)
checking for vendor's cc to be used instead of gcc... checking for cc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking whether we are using gcc 2.90 or later... yes
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking whether ln -s works... yes
checking build system type... configure: error: /bin/sh ./config.sub -apple-darwin21.4.0 failed

I guess the ./configure failed to detect the machine environment. Could anyone tell me how to solve this issue?

@huwjenkins
Copy link

Is this and this fix any help? I don't have access to a M1 Mac to test.

@pemsley
Copy link
Owner

pemsley commented Apr 3, 2022

I'm trying the installation in M1 Mac. But, as reported in the mailing list, the installation of FFTW2 (required for clipper) failed.

$ ./configure --prefix=/opt/homebrew/Cellar/clipper4coot/2.1.20180802_1/fftw2 --enable-shared --enable-float --disable-static
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking type prefix for installed files... (none)
checking for vendor's cc to be used instead of gcc... checking for cc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking whether we are using gcc 2.90 or later... yes
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking whether ln -s works... yes
checking build system type... configure: error: /bin/sh ./config.sub -apple-darwin21.4.0 failed

I guess the ./configure failed to detect the machine environment. Could anyone tell me how to solve this issue?

Curious that blake-riley didn't have the same problem:

#38

@YoshitakaMo
Copy link
Author

YoshitakaMo commented Apr 3, 2022

@huwjenkins, Thanks! Patches of https://sources.debian.org/patches/fftw/2.1.5-6/ (especially "05_ac_define_syntax.diff") and autoreconf -vfi command enabled the installation on M1 Mac! I'll rebuild brewsci/bio/clipper4coot.rb after some additional tests.

@blake-riley
Copy link

blake-riley commented Apr 3, 2022

Sorry for not mentioning it. I threw in

args << "--build=arm-apple-#{OS.kernel_name.downcase}#{OS.kernel_version.major}" if Hardware::CPU.arm? && OS.mac?

to clipper4coot.rb (ahead of the ./configure step).
Clearly hacky.
autoreconf seems like the way to go, @YoshitakaMo .

@blake-riley
Copy link

blake-riley commented Apr 3, 2022

FWIW I was also able to drop the depends_on "xcode" from all the recipes.
I'm not sure why it's necessary for building, though I could be missing something.
(Edit: it appears that this is now known)

@Species10C
Copy link

Hi All

Im just documenting here what I wrote on Twitter: https://twitter.com/klausenhauser/status/1510655605115179010?s=20&t=KOufKUDc17tJGqIkQXZvzQ

I am on a Macbook Pro, Intel, running Big Sur 12.3.1.

I am for sure not an expert in any of this, but I could make out most of what I see on here.

I followed @YoshitakaMo original commands

Here is the installation step using my Homebrew formulae.

# download Formula of [email protected] and [email protected] first
brew install wget
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/boost%401.74.rb
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/boost-python3%401.74.rb
# install them
brew install ./[email protected] --verbose
brew install ./[email protected] --verbose
# install coot
wget https://gist.githubusercontent.com/YoshitakaMo/d07056febca81fc2ca73c6f379fce4b0/raw/6b6838c9aa5790b963327e8482101c8153687b41/coot.rb
brew install ./coot.rb --verbose --HEAD --debug --keep-tmp

Everything up to the final brew install for coot was completely A-OK for me.

During COOT installation I ran into an error in which I ignored.

Screenshot 2022-04-03 at 17 59 09

After the ignore, everything seemed to be successful but under /usr/local/opt/coot/libexec/, coot-bin does not exist.

I tried to brew reinstall coot but then I get the following:

Error: An exception occurred within a child process:
  FormulaUnavailableError: No available formula with the name "/usr/local/opt/coot/.brew/coot.rb".

@blake-riley
Copy link

blake-riley commented Apr 4, 2022

@Species10C: there is a race condition in make install, it needs to be run in an ENV.deparallelize in the recipe.
When you ignored this error, you hadn't finished moving compiled files into their install directories, and you skipped right ahead. This is why you can't find coot-bin.
To fix it, I think (could be wrong) you will have to first brew rm coot, and then you should be back to an unbroken state, from which you can reinstall.

@KevinPros
Copy link

Hi again,

I have been trying to install coot on a new M1 Macbook running macos 13.6 using the instructions above, but every time the install does not complete and I get the following error message:
Screenshot 2024-03-07 at 12 23 56 PM
I have tried uninstalling homebrew and trying again, but that does not seem to work either.

@kailie107
Copy link

Hi again,

I have been trying to install coot on a new M1 Macbook running macos 13.6 using the instructions above, but every time the install does not complete and I get the following error message: Screenshot 2024-03-07 at 12 23 56 PM I have tried uninstalling homebrew and trying again, but that does not seem to work either.

I'm getting the same error during the execution of 'make install'

@huwjenkins
Copy link

@KevinPros please don't paste screenshots - paste the actual text in code tags. Anyway I can reproduce with 14a9d28 and 1.1.07:

looks like known issue g-truc/glm#1269

@pemsley
Copy link
Owner

pemsley commented Mar 8, 2024

It seems to me to be a glm issue. I edited the header "by hand" by removing the [[nodiscard]] and things progressed.

@huwjenkins
Copy link

It's annoying that homebrew makes it so hard to use an older version of glm to build Coot though:

Error: You must `brew unpin glm` as installing coot requires the latest version of pinned dependencies

I have glm 0.9.9.8 installed which used to work and now I can't install Coot with homebrew because homebrew updated glm and won't let me revert to the old version 😠

@huwjenkins
Copy link

huwjenkins commented Mar 8, 2024

The only supported way to do this seems to be making a custom 'Tap' copying the old glm 0.9.9.8 formula there and changing it to [email protected], editing it to have class GlmAT0998 (and no bottles) then adding this to coot.rb:

depends_on "huwjenkins/core/[email protected]" => :build

@huangpeng427
Copy link

Hi @YoshitakaMo @pemsley, Thanks for your instructions to install GTK4 coot on M2-chip Mac, do you have tutorial about how to operate? It's similar as Wincoot and coot1 generally, but I could not find how to do real space refinement zone by selecting two atoms as I did in wincoot, and selected area will skip to somewhere else when I try to select two atoms. Thanks for your answer.

@pemsley
Copy link
Owner

pemsley commented Apr 15, 2024

@huangpeng427 You are right. GTK4 Coot (i.e. 1.1 or later) is "Select First/Centre First" - it is the residue at the centre of the screen that is the selection when you press a button. You don't need to pick on an atom in a residue (or residues) after selecting the tool.

In the atypical case of wanting to refine a particular range, then you define the "Range/Pair" first - then click on "Refine" and then select "RSR Range Refine."

I need to make a video.

@huangpeng427
Copy link

@pemsley Got it. Thanks very much.

@pemsley pemsley changed the title Suggestion: Homebrew formula for gtk3 installation on macOS (or Linux) Suggestion: Homebrew formula for gtk3 (now GTK4) installation on macOS (or Linux) Apr 15, 2024
@huangpeng427
Copy link

@pemsley Hi, I'm writting to ask another question regarding operation. How to meaure distance between 2 atoms in GTK4? It doesn't work when I click to selected two atoms to be measured after choosing measure--distance, and doesn't work neither when I center atom to be measured by moving the cursor. Thanks.

@pemsley
Copy link
Owner

pemsley commented Apr 23, 2024

This is how it is supposed to work (with left click): Measure -> Distances & Angles -> Distance -> {Click atom 1} {Click atom 2}

I can confirm that it works that way for me.

@huangpeng427
Copy link

Hi @pemsley, thanks for your reply, I believe this is same way as Wincoot, but in my GTK4, I can only see two atoms labels appear when I clicked them, but not distance, strange?

@YoshitakaMo
Copy link
Author

I've updated coot.rb to 1.1.08!
However, coot command doesn't launch Coot. Is it a bug, @pemsley ?

$ /opt/homebrew/Cellar/coot/1.1.08/bin/coot
/opt/homebrew/Cellar/coot/1.1.08/bin/coot: error: '/opt/homebrew/Cellar/coot/1.1.08/bin/.libs/Coot' does not exist
This script is just a wrapper for Coot.
See the libtool documentation for more information.

@pemsley
Copy link
Owner

pemsley commented Apr 25, 2024

@YoshitakaMo Yay, nicely done.
coot-bin has been renamed to Coot
(this has been done so that "Coot" appears in the macOS menu bar (instead of "coot-bin"))
In the coot script, coot_bin should point to $COOT_PREFIX/libexec/Coot
I have the same error as you have above in the Github Action homebrew coot build.
My understanding is that /opt/homebrew/Cellar/coot/1.1.08/bin/.libs should not exist.

Run /usr/local/bin/coot --no-graphics < /dev/null
/usr/local/bin/coot: error: '/usr/local/Cellar/coot/HEAD-f908f05/bin/.libs/Coot' does not exist
This script is just a wrapper for Coot.
See the libtool documentation for more information.

@pemsley
Copy link
Owner

pemsley commented Apr 25, 2024

@huangpeng427

I believe this is same way as Wincoot,

That was my intention.

but in my GTK4, I can only see two atoms labels appear when I clicked them, but not distance, strange?

Yes. Sounds like a bug. I have not seen that behavior before. Hmm.

Can you test that it behaves the same way for you using the Tutorial Model?

@huangpeng427
Copy link

@pemsley, sure, but where to find Tutorial model?

@pemsley
Copy link
Owner

pemsley commented Apr 25, 2024

@huangpeng427 Calculate -> Load Tutorial Model and Data

@pemsley
Copy link
Owner

pemsley commented Apr 25, 2024

@YoshitakaMo I think I see what is going wrong. The file system doesn't understand that Coot and coot are different files.
After compilation and before installation, replace src/coot with this:

prefix = /usr/local/Cellar/coot/1.1.06
$prefix/libexec/Coot "$@"

You will have to determine what prefix is. Is that OK?
Or shall we think of something else?

@YoshitakaMo
Copy link
Author

YoshitakaMo commented Apr 25, 2024

I think modifying the lines in bin/coot (after installation) is enough to work for me:

  # Try to get the absolute directory name.
  absdir=`cd "$thisdir" && pwd`
  test -n "$absdir" && thisdir="$absdir"

  program='Coot'
-  progdir="$thisdir/.libs"
+  # progdir="$thisdir/.libs"
+  progdir="$thisdir/../libexec"

But it's not a good solution, is it?

@pemsley
Copy link
Owner

pemsley commented Apr 25, 2024

@YoshitakaMo
It is not a good solution, but it is a solution that will work, so please reify it.

What we need is a command line argument that tells the build system whether or not to make coot from coot.in - which, in the homebrew case should be turned off.

@YoshitakaMo
Copy link
Author

YoshitakaMo commented Apr 26, 2024

Now I've implemented my workaround in coot.rb and rebuilt the bottles.
coot command after reinstallation will work!

@pemsley
Copy link
Owner

pemsley commented Apr 26, 2024

@YoshitakaMo Great. Thank you.

@rajssai
Copy link

rajssai commented Apr 27, 2024

How to Install
I tried following
wget https://raw.githubusercontent.com/YoshitakaMo/homebrew-bio/coot/Formula/coot.rb --no-check-certificate
brew install ./coot.rb --verbose

This initiate but end up with error

==> /opt/homebrew/opt/[email protected]/bin/python3.12 -m pip --python=/opt/homebrew/Cellar/coot/1.1.08/libexec/bin/python install --verbose --no-deps --no-binary=:all: --ignore-installed --no-compile /private/tmp/coot--idna-20240427-63806-m35onw/idna-3.4
Using pip 24.0 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12)
Processing /private/tmp/coot--idna-20240427-63806-m35onw/idna-3.4
Installing build dependencies: started
Running command pip subprocess to install build dependencies
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))': /simple/flit-core/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))': /simple/flit-core/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))': /simple/flit-core/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))': /simple/flit-core/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))': /simple/flit-core/
Could not fetch URL https://pypi.org/simple/flit-core/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flit-core/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))) - skipping
ERROR: Could not find a version that satisfies the requirement flit_core<4,>=3.2 (from versions: none)
ERROR: No matching distribution found for flit_core<4,>=3.2
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))) - skipping
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /opt/homebrew/Cellar/coot/1.1.08/libexec/bin/python /opt/homebrew/lib/python3.12/site-packages/pip/pip-runner.py install --ignore-installed --no-user --prefix /private/tmp/pip-build-env-0p5hbqrq/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'flit_core >=3.2,<4'
cwd: [inherit]
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))) - skipping

==> Formula
Path: /Users/rrs55/Downloads/coot.rb
==> Configuration
HOMEBREW_VERSION: 4.2.19
ORIGIN: https://github.com/Homebrew/brew
HEAD: 54bea636b41f7953c01a7da5f488f08c1b42ffd1
Last commit: 5 days ago
Core tap JSON: 27 Apr 05:01 UTC
Core cask tap JSON: 27 Apr 05:02 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.7moqakHKMG/org.xquartz:0
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: dodeca-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 13.5.2-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: 15.2
Rosetta 2: false
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j12
CMAKE_PREFIX_PATH: /opt/homebrew/opt/readline:/opt/homebrew/opt/sqlite:/opt/homebrew/opt/icu4c:/opt/homebrew/opt/libomp:/opt/homebrew/opt/m4:/opt/homebrew/opt/jpeg:/opt/homebrew/opt/openblas:/opt/homebrew/opt/krb5:/opt/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
CMAKE_FRAMEWORK_PATH: /opt/homebrew/opt/[email protected]/Frameworks
PKG_CONFIG_PATH: /opt/homebrew/opt/glm/lib/pkgconfig:/opt/homebrew/opt/libpng/lib/pkgconfig:/opt/homebrew/opt/freetype/lib/pkgconfig:/opt/homebrew/opt/fontconfig/lib/pkgconfig:/opt/homebrew/opt/pcre2/lib/pkgconfig:/opt/homebrew/opt/mpdecimal/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/xz/lib/pkgconfig:/opt/homebrew/opt/[email protected]/lib/pkgconfig:/opt/homebrew/opt/glib/lib/pkgconfig:/opt/homebrew/opt/libxau/lib/pkgconfig:/opt/homebrew/opt/libxdmcp/lib/pkgconfig:/opt/homebrew/opt/libxcb/lib/pkgconfig:/opt/homebrew/opt/libx11/lib/pkgconfig:/opt/homebrew/opt/libxext/lib/pkgconfig:/opt/homebrew/opt/libxrender/lib/pkgconfig:/opt/homebrew/opt/lzo/lib/pkgconfig:/opt/homebrew/opt/pixman/lib/pkgconfig:/opt/homebrew/opt/cairo/lib/pkgconfig:/opt/homebrew/opt/jpeg-turbo/lib/pkgconfig:/opt/homebrew/opt/lz4/lib/pkgconfig:/opt/homebrew/opt/zstd/lib/pkgconfig:/opt/homebrew/opt/libtiff/lib/pkgconfig:/opt/homebrew/opt/gdk-pixbuf/lib/pkgconfig:/opt/homebrew/opt/fribidi/lib/pkgconfig:/opt/homebrew/opt/graphite2/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/harfbuzz/lib/pkgconfig:/opt/homebrew/opt/pango/lib/pkgconfig:/opt/homebrew/opt/librsvg/lib/pkgconfig:/opt/homebrew/opt/libccp4/lib/pkgconfig:/opt/homebrew/opt/mmdb2/lib/pkgconfig:/opt/homebrew/opt/clipper4coot/lib/pkgconfig:/opt/homebrew/opt/gmp/lib/pkgconfig:/opt/homebrew/opt/isl/lib/pkgconfig:/opt/homebrew/opt/mpfr/lib/pkgconfig:/opt/homebrew/opt/brotli/lib/pkgconfig:/opt/homebrew/opt/highway/lib/pkgconfig:/opt/homebrew/opt/imath/lib/pkgconfig:/opt/homebrew/opt/little-cms2/lib/pkgconfig:/opt/homebrew/opt/openexr/lib/pkgconfig:/opt/homebrew/opt/webp/lib/pkgconfig:/opt/homebrew/opt/jpeg-xl/lib/pkgconfig:/opt/homebrew/opt/libvmaf/lib/pkgconfig:/opt/homebrew/opt/aom/lib/pkgconfig:/opt/homebrew/opt/libavif/lib/pkgconfig:/opt/homebrew/opt/gd/lib/pkgconfig:/opt/homebrew/opt/jbig2dec/lib/pkgconfig:/opt/homebrew/opt/libidn/lib/pkgconfig:/opt/homebrew/opt/openjpeg/lib/pkgconfig:/opt/homebrew/opt/libde265/lib/pkgconfig:/opt/homebrew/opt/x265/lib/pkgconfig:/opt/homebrew/opt/libheif/lib/pkgconfig:/opt/homebrew/opt/liblqr/lib/pkgconfig:/opt/homebrew/opt/jasper/lib/pkgconfig:/opt/homebrew/opt/libraw/lib/pkgconfig:/opt/homebrew/opt/imagemagick/lib/pkgconfig:/opt/homebrew/opt/jpeg/lib/pkgconfig:/opt/homebrew/opt/ssm/lib/pkgconfig:/opt/homebrew/opt/dwarfutils/lib/pkgconfig:/opt/homebrew/opt/glfw/lib/pkgconfig:/opt/homebrew/opt/gsl/lib/pkgconfig:/opt/homebrew/opt/graphene/lib/pkgconfig:/opt/homebrew/opt/libepoxy/lib/pkgconfig:/opt/homebrew/opt/gtk4/lib/pkgconfig:/opt/homebrew/opt/openblas/lib/pkgconfig:/opt/homebrew/opt/gobject-introspection/lib/pkgconfig:/opt/homebrew/opt/pygobject3/lib/pkgconfig:/opt/homebrew/opt/krb5/lib/pkgconfig:/opt/homebrew/opt/xorgproto/share/pkgconfig:/opt/homebrew/opt/adwaita-icon-theme/share/pkgconfig:/opt/homebrew/opt/shared-mime-info/share/pkgconfig:/opt/homebrew/opt/eigen/share/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/13
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
ACLOCAL_PATH: /opt/homebrew/share/aclocal
PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/opt/homebrew/opt/pkg-config/bin:/opt/homebrew/opt/libpng/bin:/opt/homebrew/opt/freetype/bin:/opt/homebrew/opt/fontconfig/bin:/opt/homebrew/opt/pcre2/bin:/opt/homebrew/opt/openssl@3/bin:/opt/homebrew/opt/sqlite/bin:/opt/homebrew/opt/xz/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/gettext/bin:/opt/homebrew/opt/glib/bin:/opt/homebrew/opt/cairo/bin:/opt/homebrew/opt/jpeg-turbo/bin:/opt/homebrew/opt/lz4/bin:/opt/homebrew/opt/zstd/bin:/opt/homebrew/opt/libtiff/bin:/opt/homebrew/opt/gdk-pixbuf/bin:/opt/homebrew/opt/fribidi/bin:/opt/homebrew/opt/graphite2/bin:/opt/homebrew/opt/icu4c/bin:/opt/homebrew/opt/harfbuzz/bin:/opt/homebrew/opt/pango/bin:/opt/homebrew/opt/librsvg/bin:/opt/homebrew/opt/gemmi/bin:/opt/homebrew/opt/gcc/bin:/opt/homebrew/opt/brotli/bin:/opt/homebrew/opt/giflib/bin:/opt/homebrew/opt/little-cms2/bin:/opt/homebrew/opt/openexr/bin:/opt/homebrew/opt/webp/bin:/opt/homebrew/opt/jpeg-xl/bin:/opt/homebrew/opt/libvmaf/bin:/opt/homebrew/opt/aom/bin:/opt/homebrew/opt/libavif/bin:/opt/homebrew/opt/gd/bin:/opt/homebrew/opt/jbig2dec/bin:/opt/homebrew/opt/libidn/bin:/opt/homebrew/opt/openjpeg/bin:/opt/homebrew/opt/ghostscript/bin:/opt/homebrew/opt/libde265/bin:/opt/homebrew/opt/shared-mime-info/bin:/opt/homebrew/opt/x265/bin:/opt/homebrew/opt/libheif/bin:/opt/homebrew/opt/jasper/bin:/opt/homebrew/opt/libraw/bin:/opt/homebrew/opt/m4/bin:/opt/homebrew/opt/libtool/bin:/opt/homebrew/opt/imagemagick/bin:/opt/homebrew/opt/jpeg/bin:/opt/homebrew/opt/raster3d/bin:/opt/homebrew/opt/dwarfutils/bin:/opt/homebrew/opt/gsl/bin:/opt/homebrew/opt/gtk4/bin:/opt/homebrew/opt/numpy/bin:/opt/homebrew/opt/gobject-introspection/bin:/opt/homebrew/opt/krb5/bin:/opt/homebrew/opt/postgresql@14/bin:/opt/homebrew/opt/[email protected]/libexec/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: coot 1.1.08 did not build
Logs:
/Users/rrs55/Library/Logs/Homebrew/coot/00.options.out
/Users/rrs55/Library/Logs/Homebrew/coot/01.python3.12
/Users/rrs55/Library/Logs/Homebrew/coot/02.python3.12
/Users/rrs55/Library/Logs/Homebrew/coot/03.python3.12
/Users/rrs55/Library/Logs/Homebrew/coot/04.python3.12
Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

@YoshitakaMo
Copy link
Author

Could not fetch URL https://pypi.org/simple/flit-core/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flit-core/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))) - skipping

It seems that your environment cannot access PyPi through port 443. This is not an issue of Coot itself.

@rajssai
Copy link

rajssai commented Apr 27, 2024

How do I rectify this

@pemsley
Copy link
Owner

pemsley commented Apr 27, 2024

How do I rectify this

That is a question for your network administrator.

@huangpeng427
Copy link

@huangpeng427 Calculate -> Load Tutorial Model and Data

@pemsley Sorry for late response! I load tutorial model and map, and measure distance for two atoms from the model, but same as my case that there is no any distance showing from the measurement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests