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

[Guide] Installation on MacOS Monterey or Ventura, and Macs with Apple Silicon #30

Open
DanielYang59 opened this issue Mar 10, 2023 · 4 comments

Comments

@DanielYang59
Copy link

DanielYang59 commented Mar 10, 2023

Hi all,

Here is a guide to get p4vasp to Run on MacOS Monterey or Ventura, and I have tested and could confirm it works on my MacBook Pro with M1 Pro chip.

  1. Install dependencies and apply vasp544 patch following guide from @Chengcheng-Xiao here.

  2. Install FLTK with homebrew with brew install fltk. Use brew info fltk to query the path to FLTK installation path, in my case it's /opt/homebrew/Cellar/fltk/1.3.8_1.

  3. Copy everything from FLTK installation path to ext directory under p4vasp with cp -r /opt/homebrew/Cellar/fltk/1.3.8_1/* P4VASP/ext where P4VASP is the path to downloaded p4vasp package.

  4. Replace #include <GL/glu.h> with #include <OpenGL/glu.h> for ALL source code including those under src/include/p4vasp (there should be a total of 12 replacement to make). In my case I just use VS Code to do a global search under src and replace all.
    Screenshot 2023-03-10 at 6 05 27 pm

  5. Your compilation should be able to finish without issue here. However you might also need to install XQuartz for X11 support, otherwise you might get GtkWarning: could not open display error. Please also restart your Mac after installing XQuartz.

@aliefekislak
Copy link

Hello,

first, I would like to express my appreciation for your efforts. However, while following your steps, I've encountered some minor errors and their solutions, which I'll share below. I am using MacBook Pro with M1 processor. Despite strictly adhering to your instructions, I've encountered numerous errors when executing the "make local" and "make" commands, specifically at step 5 of @Chengcheng-Xiao's instructions in the provided link.

Could you possibly assist me in resolving these issues? Could I request your email address for more direct and swift communication? Once we've solved the problem, we can update the necessary instructions here for the benefit of others.

In step 2 on your instructions, When I run brew install fltk I take that output zsh: command not found: brew so I fix with echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile .

In step 3 on your instructions, When I run cp -r /opt/homebrew/Cellar/fltk/1.3.8_1/* $P4VASP/ext where $P4VASP I take that output cp: /ext is not a directory so I fix with export P4VASP=/path/to/your/p4vasp .

I'm also attaching a few screenshots from the long series of errors I've had in the make local & make command.

Screenshot 2023-06-27 at 23 28 23 Screenshot 2023-06-27 at 23 28 53 Screenshot 2023-06-27 at 23 29 11

@DanielYang59
Copy link
Author

DanielYang59 commented Jun 28, 2023

Hi @aliefekislak thanks for raising your concerns.

I could see you might be getting quite a fews things wrong here.

  1. It appears to me that you're adding all environment variables to your bash config file (~/.bash_profile), while the default shell in your system seems to be zsh. To confirm your default shell, execuate echo $SHELL in your terminal.

  2. I would suggest avoid starting debug with modifying environment variables unless you know what you're doing. Environment variables related errors or warnings usually hint poorly configured packages. So the best fix is not to "brute-forcely" append or insert a path to $PATH, but to check if the package in question is properly installed. In your case, it seems to me homebrew might not have been properly installed or configured, so please make sure homebrew is properly installed.

Also I didn't see any apparent error from the screenshot you enclosed. Please give it another try and let me know if things work.

Regards,
Daniel

@aliefekislak
Copy link

Hi @DanielYang59 Thank you for your warnings.

Firstly, I changed my default shell from zsh to bash as you said.

Secondly, homebrew seems to be working fine (I don't know if there's anything extra that needs to be done) I've attached a screenshot of the reinstall. Moreover, I couldn't figure out why $P4VASP doesn't recognize it, I have to specify the ext path manually for continue installation of p4vasp. I couldn't any other solutions yet.

I am attaching all my upload steps as 5 screenshots except "Replace #include <GL/glu.h> with #include <OpenGL/glu.h>" (i did it successfully).

Do you have any suggestions how to solve this problem?

Best regards,

Ali Efe Kışlak

Screenshot 2023-07-02 at 23 18 40 Screenshot 2023-07-02 at 23 29 20 Screenshot 2023-07-02 at 23 35 01 Screenshot 2023-07-02 at 23 42 51 Screenshot 2023-07-02 at 23 43 28

@DanielYang59
Copy link
Author

Hi @aliefekislak thanks for your response.

Sorry the "$P4VASP" might be misleading as I intend to use it as a variable so that readers could replace it with the real path in their system. "$P4VASP" would not be set unless you manually set it. I have changed the expression.

Can I confirm if you copied the Makefile (cp src/Makefile.MacOS src/Makefile) for MacOS as in the tutorial by Chengcheng here before make?

I do notice there are errors related to FLTK but it should pass without any problem as the lib should be copied directly from the homebrew installation.

Also I just tried to recreate the process from a clean p4vasp download and everything seems to be working at least on my side.

Screenshot 2023-07-03 at 20 33 16 Screenshot 2023-07-03 at 20 33 24 Screenshot 2023-07-03 at 20 34 01

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

No branches or pull requests

2 participants