grimme-lab / xtb4stda

sTDA-xTB Hamiltonian for ground state
GNU Lesser General Public License v3.0
16 stars 10 forks source link

add MACOS option for makefile #9

Open shomikverma opened 3 years ago

shomikverma commented 3 years ago

stda recently added macos option for makefiles, so I was wondering if xtb4stda could also be similarly updated. I attempted to edit the makerules and makeconfig files but was unsuccessful - would really appreciate this feature!

For now, I've circumvented by exporting a molden file in xtb to use in stda. the manual states that the parameters are set automatically - was wondering how they are set so I can replicate this while using a molden file.

mdewergi commented 3 years ago

@cbannwarth you added those options, do you know if this is possible? Regarding xtb molden file, I suppose you mean exporting a molden file from the regular xtb program and not xtb4stda. In that case, it is not the same scheme.

cbannwarth commented 3 years ago

I have not tried this for xtb4stda, yet, just for stda. W.r.t. the molden files. You can set -al, -be, and -ax according to the sTDA-xTB paper (4, 2, and 0.5, respectively, see https://doi.org/10.1063/1.4959605). However the kshift correction is activated only when you set "-xtb", so you won't be able to exactly reproduce the sTDA-xTB results based on the moleden file alone. It could be added as a command line input option, then it should give you the same results.

shomikverma commented 3 years ago

Thanks both for the prompt responses!

I made some progress - I replaced the Makefile with the one from stda, and within the Makefile replaced all the OBJS with the respective ones in src as well as changing PROG to xtb4stda and OSTYPE to MACOS. In the repo, I then moved all the .f files out of src, .fh files out of include, and .mod files out of modules into the main folder. Running make seemed to build properly and created a statically linked executable xtb4stda in the main folder. I then linked it with

export XTB4STDAHOME=$PWD
export PATH=$PATH:$XTB4STDAHOME

And typing xtb4stda in the command line seems to work properly:


     ______________________________________
       |                                      |
       |          ===================         |
       |             xTB for sTDA             |
       |          ===================         |
       |               S. Grimme              |
       |        Universitaet Bonn, MCTC       |
       |         2015-19, Version 1.0         |
       |     Wed Apr  3 09:14:55 CEST 2019    |
       |______________________________________|

...etc

Though I'm unsure if the parameter files were properly included. Will try some test cases and let you know!

You can see my changes in my fork: https://github.com/shomikverma/xtb4stda

seriussuires commented 3 years ago

Hi, I also compiled on MacOS using ninja build_gcc and it worked after I made a few changes in the code (mostly did not accept == for comparison and a few small things). Afterwards the program (that I installed in /usr/local) required me to modify where the parameters were located. This was just a change in path on the source code. However, despite that, I got the error

**dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address Referenced from: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address Referenced from: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:

0 0x129c2c9ac

1 0x129c2bd53

2 0x7fff6c8d95fc

Abort trap: 6**

I read that this is related to Mac though. Do you see this problem?

mdewergi commented 3 years ago

I have not tried this for xtb4stda, yet, just for stda. W.r.t. the molden files. You can set -al, -be, and -ax according to the sTDA-xTB paper (4, 2, and 0.5, respectively, see https://doi.org/10.1063/1.4959605). However the kshift correction is activated only when you set "-xtb", so you won't be able to exactly reproduce the sTDA-xTB results based on the moleden file alone. It could be added as a command line input option, then it should give you the same results.

Note you can activate the kshift with the -kshift option.

mdewergi commented 3 years ago

Hi, I also compiled on MacOS using ninja build_gcc and it worked after I made a few changes in the code (mostly did not accept == for comparison and a few small things). Afterwards the program (that I installed in /usr/local) required me to modify where the parameters were located. This was just a change in path on the source code. However, despite that, I got the error

**dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address Referenced from: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address Referenced from: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:

0 0x129c2c9ac

1 0x129c2bd53

2 0x7fff6c8d95fc

Abort trap: 6**

I read that this is related to Mac though. Do you see this problem?

I do not know. @cbannwarth, any idea?

cbannwarth commented 3 years ago

@mdewergi I also never tried compiling xtb4stda on MacOS, unfortunately. @seriussuires This looks might be an issue for the omp parallelization. Does it work, if you switch to a serial compile?

seriussuires commented 3 years ago

Here is the solution: ( 0) you might need gcc from brew) 1) Install OpenBlas using brew 2) brew link --overwrite gcc 3) install xtb4stda (for that matter even stda) using the gcc build.

Point 2 is essential for the proper running of the program.