Compiling Slatec on macOS

# SLATEC Common Mathematical Library, Version 4.1, July 1993
# a comprehensive software library containing over
# 1400 general purpose mathematical and statistical routines
# written in Fortran 77.

If you want to install SLATEC, you need to make sure to install gfortran.

Take a look here for a brief instructions, somewhere in the middle of shell code:

Make sure to download sources and linux makefile and put all files at the same level. By saying at the same level, I mean that all *.f files from slatec_src.tgz and makefile and dynamic and static from slatec4linux.tgz are in the same dir.

SLATEC sources:
SLATEC makefile:

Before building library, make sure to export FC variable (it is needed by makefile)

export FC=gfortran

Make sure to change this line inside dynamic/makefile $(OBJ)
    $(CC) -shared -o $@ $(OBJ)

to $(OBJ)
    $(FC) -shared -o $@ $(OBJ)

Call make


Wait a little bit. Take a look inside static and dynamic, files should be there.

find . -name "libslatec*"

Now, you can try to perform make install (pay attention here as it will overwrite hardcoded locations). Alternatively, you can use

-L${WHERE_YOUR_BUILD_WAS_DONE}/dynamic -lslatec

SLATEC refers to symbols that can be found inside LAPACK package. If you don’t have it installed, take a look here

mkdir lapack
cd lapack
curl "" -o lapack-3.7.1.tgz
tar zxf lapack-3.7.1.tgz
cd lapack-3.7.1
ln -s

After compilation is done, you can find liblapack.a inside lapack-3.7.1.

Leave a comment

Your comment