GenericMappingTools / 2020-unavco-course

Planning and material for the 2020 UNAVCO GMT for Geodesy course
34 stars 18 forks source link

Trouble installing GMT6.1 using Homebrew on Mac #22

Closed kstephens13 closed 4 years ago

kstephens13 commented 4 years ago

System: Mac OS X 10.13.7 (High Sierra)

I previously tried to install GMT 6.1 using macports, but was only able to install GMT 6.0 successfully. I was then recommended to rather try using homebrew instead of macports, and move the macports linked folder: sudo mv /opt/local /opt/local-saved

After installing homebrew, I encountered several errors during install command: brew install gmt Two main types of errors were observed (see attached log file of runtime output logfile_gmt_install_homebrew_errors_12Jul2020.txt): 1) Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local 2) Error: An unexpected error occurred during the brew link step The formula built, but is not symlinked into /usr/local

I was able to resolve some of the errors associated with error 1, however sometimes the forced symlink didn't always works. It seems like the issue may still be associated with macports? I have never used homebrew before so I am unsure of how to resolve the errors

PaulWessel commented 4 years ago

Looks like you already had stuff in /usr/local from another installation? Pinging @seisman who is our brew master.

seisman commented 4 years ago

I never had similar issues before. As @PaulWessel said, it may be because you already have some packages installed in /usr/local before installing homebrew? Perhaps brew install --force gmt works?

kstephens13 commented 4 years ago

Hi all, I tried out brew install --force gmt but the same error comes up:

Error: An unexpected error occurred during thebrew linkstep The formula built, but is not symlinked into /usr/local Directory not empty @ dir_s_rmdir - /usr/local/opt/fontconfig Error: Directory not empty @ dir_s_rmdir - /usr/local/opt/fontconfig

Would I need to remove previously installed packages from /usr/local? Do you have suggestions for how to go about doing that?

seisman commented 4 years ago

remove previously installed packages from /usr/local

Yes, please try that if you didn't manually install any packages in this directory before.

kstephens13 commented 4 years ago

I don't think I manually installed any packages before, so this should be possible.

Could you perhaps provide suggestions on how I go about removing packages from this directory? I am not sure how to approach this and don't want to accidentally remove something that still needs to be there. Thanks very much

seisman commented 4 years ago

Homebrew installs everything to /usr/local. If you also manually installs some packages in that directory, it may cause some conflicts.

My suggestions would be:

  1. Make a backup of your existing /usr/local directory so that you can still recovery if you did something wrong, i.e., mv /usr/local /usr/local.bak
  2. As /usr/local is removed, homebrew is also removed. So you need to install homebrew again, then install gmt.
kstephens13 commented 4 years ago

I tried to rename my /usr/local folder but Permission was denied: gsc-dkmd007:usr kirsten$ sudo mv local local-saved mv: rename local to local-saved: Operation not permitted

Then I tried changing ownership using two methods since High Sierra won't let me change chown permissions on /usr/local itself: gsc-dkmd007:usr kirsten$ sudo chown -R "$USER":admin /usr/local/* sudo chown -R $(whoami) $(brew --prefix)/*

These didn't give any errors, but I still get the recurring issue for trying to move the /usr/local directory...

seisman commented 4 years ago

Sorry, it's unclear to me why it doesn't work. Do you mind trying Anaconda (https://github.com/GenericMappingTools/2020-unavco-course/blob/master/INSTALL.md#installing-with-conda)?

kstephens13 commented 4 years ago

Hi all, Following on from the suggestions during the video install session earlier, it looks like the install went through smoothly! Here are the steps I took in summary (attached log file gives greater details just in case logfile_gmt_install_homebrew_13Jul2020PM.txt):

  1. Uninstalled Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
  2. Removed remaining Homebrew folder under /usr/local
  3. Renamed /usr/local/lib --> /usr/local/lib-saved and /usr/local/bin --> /usr/local/bin-saved
  4. Reinstalled Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  5. Reinstalled gmt (no error messages this time around!): brew install gmt
  6. Installed dependencies: brew install ghostscript graphicsmagick ffmpeg

The only thing I feel could be an issue is ffmpeg: ==> Installing ffmpeg ==> Pouring ffmpeg-4.3.1.high_sierra.bottle.tar.gz Warning: ffmpeg dependency gcc was built with a different C++ standard library (libstdc++ from clang). This may cause problems at runtime. 🍺 /usr/local/Cellar/ffmpeg/4.3.1: 299 files, 61MB

Reason being because when I tested test_2.sh script, I got the following error output: gsc-dkmd007:hw1 kirsten$ ./test_2.sh movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 4 -y -i "count/count_%02d.png" -vcodec libx264 -pix_fmt yuv420p count.mp4 movie [NOTICE]: Running: ffmpeg -loglevel warning -f image2 -framerate 4 -y -i "count/count_%02d.png" -vcodec libvpx -crf 10 -b:v 1.2M -pix_fmt yuv420p count.webm Open either count.mp4 or count.webm in an application that can view movies

Any suggestions on this? Thanks again!

PaulWessel commented 4 years ago

Can you double-click on count.mp4 and verity you see the mocie?

kstephens13 commented 4 years ago

Yupp, the movie works! (But only in QuickTime, in VLC it only shows up to number 18 and then quits)

PaulWessel commented 4 years ago

That is good enough I think.

kstephens13 commented 4 years ago

Excellent, thank you everyone for your help!