Other Vector math library on FreeBSD

hsnyder

New Member

Reaction score: 5
Messages: 5

I do a lot of scientific programming in Fortran, and would like to switch over from Linux to FreeBSD. I was doing some performance comparison between the two platforms and I noticed that FreeBSD doesn't seem to have its own vectorized math library... On Linux, gcc/gfortran will, with the appropriate compiler flags, replace calls to math functions like `cos` and `exp` with SIMD versions from glibc's libmvec, sometimes giving a tremendous speedup. I tried transplanting libmvec.a from a linux box to a FreeBSD system, but the compiler (gfortran11) ignored it when I tried to link it in, and just emitted calls to the standard scalar math library routines (e.g. `sinf`, `expf`, etc). I didn't really expect that to work, as I have no idea if the object file formats are the same or not.

In any event, I suppose my question is: does anyone here know a way to get gcc/gfortran to use an AVX SIMD implementation of those basic math functions on FreeBSD? I gather I could use the Linux compatibility layer and set up a Linux jail, but I'd prefer to just be able to use FreeBSD itself. I've been doing my experiements on a fresh install of FreeBSD 13.0-RELEASE.

Thanks in advance to anyone who knows about this topic!
 

fasxmut

New Member


Messages: 1

I don't know why you want to bind your avx simd to gcc/gfortran, you can try dlib-cpp which works both on gcc and clang, you must search the dlib-cpp.
 
Top