geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 49 forks source link

Simplify link flags in configure #534

Closed gassmoeller closed 1 month ago

gassmoeller commented 1 month ago

A suggestion for how to simplify the link options in the configure script. This should be carefully tested on systems with:

illorenzo7 commented 1 month ago

I at least tested this on Pleiades (intel + mkl) and it fixed my issue with the "$MKL_LIB" appearing in configure instead of "-mkl". (So it now compiles with this fix).

feathern commented 1 month ago

I just tested the GNU compiler with and without MKL (using Openblas through conda). This worked fine for me.

feathern commented 1 month ago

I also just tested the GNU compiler with MKL installed via apt. No problems there either.

cianwilson commented 1 month ago

I tested this on an intel mac (OS Ventura 13.6.7) using:

conda config --set channel_priority strict
conda env create -f environment.yml
conda activate radev
conda install mkl
export MKLROOT=$CONDA_PREFIX
./configure --FC=mpifort --CC=gcc -conda-mkl
make
make install

which produced a functioning executable (tested on an input_example) despite an ld warning:

ld: warning: object file (cmkdir.o) was built for newer macOS version (13.0) than being linked (11.5)
gassmoeller commented 1 month ago

So that seems pretty good then.

ld: warning: object file (cmkdir.o) was built for newer macOS version (13.0) than being linked (11.5)

Hmm, I cannot see how my change could have affected that, the flags for Macos should be exactly as before. Can you check if setting STD_FLAGS='-lc++' in the lines above resolves the warning? Then it would be related to #532 and not this one.